diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..f8ce38f --- /dev/null +++ b/.classpath @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..17463c1 --- /dev/null +++ b/.project @@ -0,0 +1,16 @@ + + + forge-1.7.10-10.13.2.1291 + + + + org.eclipse.jdt.core.javanature + + + + org.eclipse.jdt.core.javabuilder + + + + + diff --git a/build.gradle b/build.gradle index a031865..e31c4c6 100644 --- a/build.gradle +++ b/build.gradle @@ -17,12 +17,12 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-1.3c" +version = "1.7.10-1.4b4" group= "com.stek101.projectzulu" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "ProjectZulu" minecraft { - version = "1.7.10-10.13.1.1217" + version = "1.7.10-10.13.2.1291" runDir = "eclipse" } diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/f0fb773d302000141dbfc2e92eb0e949 b/eclipse/.metadata/.lock similarity index 100% rename from eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/f0fb773d302000141dbfc2e92eb0e949 rename to eclipse/.metadata/.lock diff --git a/eclipse/.metadata/.log b/eclipse/.metadata/.log new file mode 100644 index 0000000..05c4ce5 --- /dev/null +++ b/eclipse/.metadata/.log @@ -0,0 +1,741 @@ +!SESSION 2015-02-01 12:34:01.915 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-01 12:34:04.618 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-01 12:34:36.494 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 12:35:11.901 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-01 12:35:11.917 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-01 12:52:50.091 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-01 12:52:50.107 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/bin/com/stek101/projectzulu/common]) +!SESSION 2015-02-03 10:26:14.611 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-03 10:26:17.315 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-03 10:27:29.982 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-03 10:27:33.847 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-03 10:28:14.722 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-03 10:28:14.722 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-03 14:10:24.316 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-03 14:10:24.320 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/build/resources/main/assets/projectzuludungeon]) +!SESSION 2015-02-03 21:55:30.130 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-03 21:55:33.916 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-03 22:04:31.936 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-03 22:04:34.123 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-03 22:05:10.513 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-03 22:05:10.515 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-04 13:40:17.926 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-04 13:40:21.051 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-04 13:40:50.848 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-04 13:42:04.118 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-04 13:42:04.118 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-04 14:53:12.239 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-04 14:53:12.263 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/eclipse/.metadata/.plugins]) +!SESSION 2015-02-04 22:07:05.372 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-04 22:07:07.883 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-04 22:07:12.519 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-04 22:07:16.669 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-04 22:08:00.238 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-04 22:08:00.240 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.core.resources 4 566 2015-02-04 23:43:18.101 +!MESSAGE Workspace was not properly initialized or has already shutdown. + +!ENTRY org.eclipse.core.jobs 4 1 2015-02-04 23:43:18.105 +!MESSAGE Worker thread ended job: Refreshing workspace(10), but still holds rule: ThreadJob(Refreshing workspace(10),[F/Minecraft/src/main/resources/assets/projectzulublock]) +!SESSION 2015-02-05 09:28:01.645 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-05 09:28:05.538 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 09:28:13.173 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 09:28:58.566 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 09:28:58.568 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-05 11:54:00.028 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-05 11:54:02.889 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.core.resources 4 567 2015-02-05 11:54:40.195 +!MESSAGE Workspace restored, but some problems occurred. +!SUBENTRY 1 org.eclipse.core.resources 4 567 2015-02-05 11:54:40.195 +!MESSAGE Could not read metadata for '.org.eclipse.jdt.core.external.folders'. +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: The project description file (.project) for '.org.eclipse.jdt.core.external.folders' is missing. This file contains important information about the project. The project will not function properly until this file is restored. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:851) + at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:884) + at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:864) + at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:715) + at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1565) + at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2464) + at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2219) + at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:447) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) + at java.security.AccessController.doPrivileged(Native Method) + at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) + at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721) + at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936) + at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319) + at org.eclipse.osgi.container.Module.doStart(Module.java:571) + at org.eclipse.osgi.container.Module.start(Module.java:439) + at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454) + at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107) + at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324) + at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320) + at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36) + at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:391) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160) + at java.lang.ClassLoader.loadClass(Unknown Source) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:136) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SUBENTRY 2 org.eclipse.core.resources 4 567 2015-02-05 11:54:40.197 +!MESSAGE The project description file (.project) for '.org.eclipse.jdt.core.external.folders' is missing. This file contains important information about the project. The project will not function properly until this file is restored. +!SUBENTRY 1 org.eclipse.core.resources 4 567 2015-02-05 11:54:40.197 +!MESSAGE Could not read metadata for 'Minecraft'. +!STACK 1 +org.eclipse.core.internal.resources.ResourceException: The project description file (.project) for 'Minecraft' is missing. This file contains important information about the project. The project will not function properly until this file is restored. + at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:851) + at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:884) + at org.eclipse.core.internal.resources.SaveManager.restoreMetaInfo(SaveManager.java:864) + at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:715) + at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1565) + at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2464) + at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2219) + at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:447) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771) + at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1) + at java.security.AccessController.doPrivileged(Native Method) + at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764) + at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721) + at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936) + at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319) + at org.eclipse.osgi.container.Module.doStart(Module.java:571) + at org.eclipse.osgi.container.Module.start(Module.java:439) + at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454) + at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107) + at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324) + at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320) + at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36) + at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:391) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345) + at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337) + at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160) + at java.lang.ClassLoader.loadClass(Unknown Source) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:136) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) + at java.lang.reflect.Method.invoke(Unknown Source) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603) + at org.eclipse.equinox.launcher.Main.run(Main.java:1465) + at org.eclipse.equinox.launcher.Main.main(Main.java:1438) +!SUBENTRY 2 org.eclipse.core.resources 4 567 2015-02-05 11:54:40.198 +!MESSAGE The project description file (.project) for 'Minecraft' is missing. This file contains important information about the project. The project will not function properly until this file is restored. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 11:54:40.997 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 11:54:54.606 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 11:54:54.608 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-05 11:55:12.032 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-05 11:55:14.939 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-05 11:55:32.443 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 11:55:33.377 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 11:55:44.425 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 11:55:44.427 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. +!SESSION 2015-02-05 14:20:32.365 ----------------------------------------------- +eclipse.buildId=4.4.1.M20140925-0400 +java.version=1.8.0_11 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.eclipse.epp.package.jee.product +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product + +!ENTRY org.eclipse.jpt.dbws.eclipselink.ui 4 0 2015-02-05 14:20:34.851 +!MESSAGE FrameworkEvent ERROR +!STACK 0 +org.osgi.framework.BundleException: Could not resolve module: org.eclipse.jpt.dbws.eclipselink.ui [394] + Bundle was not resolved because of a uses contraint violation. + org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] because it is exposed to package 'javax.xml.bind' from resources org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] and javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] via two dependency chains. + +Chain 1: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.wst.common.project.facet.ui)(&(bundle-version>=1.3.0)(!(bundle-version>=2.0.0)))) + | + provide: osgi.wiring.bundle: org.eclipse.wst.common.project.facet.ui + org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.1.v20140909-1633"; singleton:="true"] + +Chain 2: + org.eclipse.jpt.dbws.eclipselink.ui [osgi.identity; osgi.identity="org.eclipse.jpt.dbws.eclipselink.ui"; type="osgi.bundle"; version:Version="1.1.100.v201310142259"; singleton:="true"] + require: (&(osgi.wiring.bundle=org.eclipse.persistence.dbws.builder)(&(bundle-version>=2.3.0)(!(bundle-version>=3.0.0)))) + | + provide: osgi.wiring.bundle; bundle-version:Version="2.6.0.v20130815-a4708b6"; osgi.wiring.bundle="org.eclipse.persistence.dbws.builder" + org.eclipse.persistence.dbws.builder [osgi.identity; osgi.identity="org.eclipse.persistence.dbws.builder"; type="osgi.bundle"; version:Version="2.6.0.v20130815-a4708b6"] + import: (osgi.wiring.package=javax.xml.bind) + | + export: osgi.wiring.package: javax.xml.bind + javax.xml.bind [osgi.identity; osgi.identity="javax.xml.bind"; type="osgi.bundle"; version:Version="2.1.9.v201005080401"] + at org.eclipse.osgi.container.Module.start(Module.java:434) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) + at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) + at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) + at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) + +!ENTRY org.eclipse.core.resources 2 10035 2015-02-05 14:21:05.412 +!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. + +!ENTRY org.eclipse.m2e.logback.configuration 2 0 2015-02-05 14:21:06.504 +!MESSAGE Exception while setting up logging:org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String +!STACK 0 +java.lang.ClassCastException: org.eclipse.osgi.internal.framework.EquinoxConfiguration$1 cannot be cast to java.lang.String + at org.eclipse.m2e.logback.configuration.LogHelper.logJavaProperties(LogHelper.java:26) + at org.eclipse.m2e.logback.configuration.LogPlugin.loadConfiguration(LogPlugin.java:189) + at org.eclipse.m2e.logback.configuration.LogPlugin.configureLogback(LogPlugin.java:144) + at org.eclipse.m2e.logback.configuration.LogPlugin.access$2(LogPlugin.java:107) + at org.eclipse.m2e.logback.configuration.LogPlugin$1.run(LogPlugin.java:62) + at java.util.TimerThread.mainLoop(Unknown Source) + at java.util.TimerThread.run(Unknown Source) + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 14:21:20.419 +!MESSAGE Warning: EGit couldn't detect the installation path "gitPrefix" of native Git. Hence EGit can't respect system level +Git settings which might be configured in ${gitPrefix}/etc/gitconfig under the native Git installation directory. +The most important of these settings is core.autocrlf. Git for Windows by default sets this parameter to true in +this system level configuration. The Git installation location can be configured on the +Team > Git > Configuration preference page's 'System Settings' tab. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.egit.ui 2 0 2015-02-05 14:21:20.421 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\BELFAM_ADMIN'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. diff --git a/eclipse/.metadata/.mylyn/repositories.xml.zip b/eclipse/.metadata/.mylyn/repositories.xml.zip new file mode 100644 index 0000000..1c9d715 Binary files /dev/null and b/eclipse/.metadata/.mylyn/repositories.xml.zip differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/3027c2a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/3027c2a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b941a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/3027c2a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,330 +0,0 @@ -package projectzulu.common.core; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - - -public class ObfuscationHelper { - - /** - * Helper used to See if we are unObfuscated by checking for a known non-Obfuscated name - * return true if unObfuscated (eclipse), false if obfuscated (Minecraft) - * @param list - */ - public static boolean isUnObfuscated(Field[] fieldList, String desired){ - for (int i = 0; i < fieldList.length; i++) { - if(fieldList[i].getName().equals(desired)){ - return true; - } - } - return false; - } - - public static boolean isUnObfuscated(Class regularClass, String regularClassName){ - return regularClass.getSimpleName().equals(regularClassName); - } - - public static Object invokeMethod(String eclipseName, String seargeName, Class containingClass, - Object containterInstance, Object... args) { - try { - Method method; - method = getIntanceOfMethod(eclipseName, seargeName, containterInstance); - if (method == null) { - throw new NoSuchMethodException(); - } - method.setAccessible(true); - return method.invoke(containterInstance, args); - } catch (NoSuchMethodException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (InvocationTargetException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } - return null; - } - - private static Method getIntanceOfMethod(String eclipseName, String seargeName, Object containterInstance, Class... topClassToLook) { - Class classToSearch = containterInstance.getClass(); - while (classToSearch.getSuperclass() != null) { - for (Method method : classToSearch.getDeclaredMethods()) { - if (eclipseName.equalsIgnoreCase(method.getName()) || seargeName.equalsIgnoreCase(method.getName())) { - return method; - } - } - classToSearch = classToSearch.getSuperclass(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get Static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Class containingClass, Class type){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(null)); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Object containterInstance, Class type){ - return getFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Get Non-Static Field - */ - public static T getFieldFromReflection(String srgName, String sourceName, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(srgName, containterInstance.getClass(), containterInstance, type); - } catch (NoSuchFieldException e) { - return getFieldFromReflection(sourceName, containterInstance.getClass(), containterInstance, type); - } - } - - public static T getFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(fieldName, containingClass, containterInstance, type); - } catch (NoSuchFieldException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", - fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Object containterInstance, Class type) - throws NoSuchFieldException { - return getCatchableFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, Class type) - throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(containterInstance)); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value) throws NoSuchFieldException{ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - - public static Class getDeclaredClass(String className, Class containingClass){ - for (Class declaredClass : containingClass.getDeclaredClasses()) { - if(declaredClass.getSimpleName().equals(className)){ - return declaredClass; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/40ff4901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/40ff4901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f68f96..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/40ff4901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,156 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFinch; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/509a1ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/509a1ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1b0428..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/509a1ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiContainerUniversalFlowerPot extends GuiContainer { - public final static ResourceLocation FLOWERPOT_GUI = new ResourceLocation(DefaultProps.coreKey, - "gui/FlowerPotGUI.png"); - - public GuiContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntity) { - super(new ContainerUniversalFlowerPot(inventoryPlayer, tileEntity)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Flower Pot", 8, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(FLOWERPOT_GUI); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/5175dcf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/5175dcf5c42100141fce95f06aba7e85 deleted file mode 100644 index 5e885da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/5175dcf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/81870cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/81870cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index df04f78..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/81870cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,104 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/9186f6f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/9186f6f8c42100141fce95f06aba7e85 deleted file mode 100644 index 57c46f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/9186f6f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/a03582e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/a03582e5c42100141fce95f06aba7e85 deleted file mode 100644 index 175f5ce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/a03582e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.models.ModelSandWorm; -import projectzulu.common.mobs.renders.RenderGenericIdle; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/b1fc1ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/b1fc1ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 0cb9561..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/b1fc1ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/d0e2b800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/d0e2b800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 05588d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/d0e2b800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/e07a4afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/e07a4afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b57847f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/e07a4afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f1d1d2f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f1d1d2f8c42100141fce95f06aba7e85 deleted file mode 100644 index 19fe516..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f1d1d2f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseRandom; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f2db75a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f2db75a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e404ac4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/0/f2db75a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemWateredDirt extends ItemBlock { - - public ItemWateredDirt(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "soil_1"; - break; - } - case 1: { - name = "soil_2"; - break; - } - case 2: { - name = "soil_3"; - break; - } - case 3: { - name = "soil_4"; - break; - } - case 4: { - name = "sand_1"; - break; - } - case 5: { - name = "sand_2"; - break; - } - case 6: { - name = "sand_3"; - break; - } - case 7: { - name = "sand_4"; - break; - } - default: - name = "ore"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/00366734bfab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/00366734bfab00141ee9bf3050c1025b new file mode 100644 index 0000000..47ee177 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/00366734bfab00141ee9bf3050c1025b @@ -0,0 +1,292 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/117025f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/117025f7c42100141fce95f06aba7e85 deleted file mode 100644 index fa7524a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/117025f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import com.ngb.projectzulu.common.potion.brewingstands.PotionIngredients; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GenericCraftingItemsDeclaration extends ItemDeclaration { - - public GenericCraftingItemsDeclaration() { - super("GenericCraftingItems1"); - } - - @Override - protected boolean createItem() { - ItemGenerics itemGenerics = (ItemGenerics) new ItemGenerics(); - ItemList.genericCraftingItems = Optional.of(itemGenerics); - PotionIngredients.addIngredientProperties(itemGenerics, itemGenerics); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.genericCraftingItems.get(); - OreDictionary.registerOre("foodSalt", new ItemStack(item, 1, ItemGenerics.Properties.Salt.meta())); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/2094262bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/2094262bc52100141fce95f06aba7e85 deleted file mode 100644 index 0ea25f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/2094262bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,527 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20e65501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20e65501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f5d95e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/20e65501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,222 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/701d439ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/701d439ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 680b206..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/701d439ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/a0da2ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/a0da2ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 37275a0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/a0da2ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBirdHead extends ModelBase{ - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - private ModelRenderer BODY; - private ModelRenderer WINGLEFROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer TAILROT; - - public ModelBirdHead(){ - textureWidth = 32; - textureHeight = 32; - setTextureOffset("BODY.Body", 0, 0); - setTextureOffset("WINGLEFROT.winglef", 22, 0); - setTextureOffset("WINGRIGROT.wingrig", 13, 0); - setTextureOffset("TAILROT.tail", 14, 8); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - - BODY = new ModelRenderer(this, "BODY"); - BODY.setRotationPoint(0F, 21F, 0F); - setRotation(BODY, 0F, 0F, 0F); - BODY.mirror = true; - BODY.addBox("Body", -1F, -1F, -2F, 2, 2, 4); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-1F, -0.7F, 0F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGLEFROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(1F, -0.7F, 0F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGRIGROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -0.2F, 1F); - setRotation(TAILROT, 0.3346145F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.4666667F, 0F, 0F, 1, 0, 3); - BODY.addChild(TAILROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1.2F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - BODY.addChild(HEADROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 1.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 0); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODY.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 1.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 0); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODY.addChild(LEGRIGTOPROT); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - // super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - // float field_78145_g = 8.0F; - // float field_78151_h = 4.0F; - // - // if (this.isChild){ - // float var8 = 2.0F; - // GL11.glPushMatrix(); - // GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - // GL11.glPopMatrix(); - // GL11.glPushMatrix(); - // GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - // GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - // Body.render(f5); - // Body.render(f5); - // wingrig.render(f5); - // winglef.render(f5); - // tail.render(f5); - // LEGRIGTOPROT.render(f5); - // LEGLEFTOPROT.render(f5); - // GL11.glPopMatrix(); - // }else{ -// Body.render(f5); -// wingrig.render(f5); -// winglef.render(f5); -// tail.render(f5); -// LEGRIGTOPROT.render(f5); -// LEGLEFTOPROT.render(f5); -// HEADROT.render(f5); - BODY.render(f5); - // } - // - } - - public void renderHead(float f5){ - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODY.rotateAngleY = f3 / (180F / (float)Math.PI); - -// Body.rotateAngleY = f3 / (180F / (float)Math.PI); -// wingrig.rotateAngleY = f3 / (180F / (float)Math.PI); -// winglef.rotateAngleY = f3 / (180F / (float)Math.PI); -// tail.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGRIGTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGLEFTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/d0517fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/d0517fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 48c8070..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/d0517fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,617 +0,0 @@ -package projectzulu.common.blocks.spike; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpike implements ISimpleBlockRenderingHandler { - - /* Leaving This here For Reference */ - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94216_b %s", var10.func_94216_b()); // 192 - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94212_f %s", var10.getMaxU()); // 0.5 - // ProjectZuluLog.info("func_94214_a %s", var10.getInterpolatedU(8D)); // 0: 0.46875, 8: 0.484375 - // ProjectZuluLog.info("func_94206_g %s", var10.getMinV()); // 0.375 - // ProjectZuluLog.info("func_94210_h %s", var10.getMaxV()); // 0.40625 - // ProjectZuluLog.info("func_94207_b %s", var10.func_94207_b(8D)); // 0: 0.375, 8: 0.390625 - // ProjectZuluLog.info("func_94215_i %s", var10.func_94215_i()); // NAME - // ProjectZuluLog.info("func_94213_j %s", var10.func_94213_j()); // 512 - // ProjectZuluLog.info("func_94208_k %s", var10.func_94208_k()); // 512 - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - return Render(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - } - - private boolean Render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - // // if (par1Block == Block.tallGrass) - // // { - // // long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; - // // var17 = var17 * var17 * 42317861L + var17 * 11L; - // // var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; - // // var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // } - if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars - || blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - // renderAsSpike(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - RenderFencePikes(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - - } else if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - boolean isNegZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - /* Check For Along Z */ - if (isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 0); - } else if (!isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 1); - } else if (isNegZ && !isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 2); - } - - /* Check For Along X */ - if (isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 0); - } else if (!isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 1); - } else if (isNegX && !isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 2); - } - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - drawSpikeCross(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - - } else { - // renderer.drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, - // var15, 1.0f); - drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - return true; - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block par1) { - return par1.isOpaqueCube() || par1 == Blocks.iron_bars || par1 == Blocks.glass; - } - - public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, - RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - 0.5D; - double var23 = par3 + 0.5D + 0.5D; - double var25 = par7 + 0.5D - 0.5D; - double var27 = par7 + 0.5D + 0.5D; - - switch (par2) { - case 0: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 1: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 2: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 3: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 4: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 5: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - case 6: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 7: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 8: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 9: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 10: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 11: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - default: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - } - } - - public void drawOnSide0(Tessellator tessellator, double par5, double var21, double var23, double var25, - double var27, double var13, double var15, double var17, double var19) { - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17); - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17); - } - - public void drawOnSide1(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide2(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide3(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide4(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide5(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - } - - public void RenderFencePikes(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 1f / 4f; - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 3f / 4f; - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - (0.625 - 0.375) / 2D; - double var23 = par3 + 0.5D + (0.625 - 0.375) / 2D; - double var25 = par7 + 0.5D - (0.625 - 0.375) / 2D; - double var27 = par7 + 0.5D + (0.625 - 0.375) / 2D; - - double maxY = 0.6; - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var15, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - - public void drawSpikeCross(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - /* Render Strip Along X */ - double var21 = par3 + 0.5D - 0.5; - double var23 = par3 + 0.5D + 0.5; - double var25 = par7 + 0.5D - 0.06; - double var27 = par7 + 0.5D + 0.06; - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - /* Render Strip Along Z */ - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - - // float var6 = 0.375F; - // float var7 = 0.625F; - maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - } - - public void drawSpikeStrip(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer, - Boolean alongX, int type) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13; - double var15; - double var17; - double var19; - - switch (type) { - case 1: - var13 = var10.getInterpolatedU(8D); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - case 2: - var13 = var10.getMinU(); - var15 = var10.getInterpolatedU(8D); // var10.getMaxU(); - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2f; // var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - default: - var13 = var10.getMinU(); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - } - - double var21; - double var23; - double var25; - double var27; - if (alongX) { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.0; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - - break; - case 2: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.0; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - default: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - } - - } else { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.0; - var27 = par7 + 0.5D + 0.5; - - break; - case 2: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.0; - - break; - default: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - break; - } - } - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - if (alongX) { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - } else { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/d2b8def8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/d2b8def8c42100141fce95f06aba7e85 deleted file mode 100644 index 90055a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1/d2b8def8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityFrog; -import com.ngb.projectzulu.common.mobs.models.ModelFrog; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/00352701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/00352701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7ddfdc5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/00352701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/203ffc9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/203ffc9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43a02d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/203ffc9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCemetary; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/20995ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/20995ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 88da588..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/20995ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; - -/* Helper Class to contain both BlockID and Meta in a single Structure */ -public class BlockWithMeta extends WeightedRandom.Item { - public final Block block; - public final int meta; - - public BlockWithMeta(Block block) { - this(block, 0); - } - - public BlockWithMeta(Block block, int meta) { - this(block, meta, 1); - } - - public BlockWithMeta(Block block, int meta, int weight) { - super(weight); - this.block = block; - this.meta = meta; - } - - /** - * Helper Function to Place Block/TileEntity/Spawner. Overridden in child to make use of specific knowledge, i.e. A - * Chests Loot Chance - */ - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (block != null) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/209e43192124001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/209e43192124001415179d45b0e27e9a deleted file mode 100644 index 08e8a5a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/209e43192124001415179d45b0e27e9a +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/216f8bf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/216f8bf5c42100141fce95f06aba7e85 deleted file mode 100644 index d4339ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/216f8bf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; -import com.ngb.projectzulu.common.mobs.models.ModelFollower; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/30dc7effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/30dc7effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 534f64b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/30dc7effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.Random; - -import projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/51206be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/51206be4c42100141fce95f06aba7e85 deleted file mode 100644 index 7a0443a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/51206be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/60ea1b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/60ea1b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index faaed09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/60ea1b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFrog; -import projectzulu.common.mobs.models.ModelFrog; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/7147a1a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/7147a1a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b025cfc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/7147a1a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803c51ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803c51ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8c7e4d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/803c51ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/810aa09ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/810aa09ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4cdeb40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/810aa09ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/909f78f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/909f78f4c42100141fce95f06aba7e85 deleted file mode 100644 index 38690ba..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/909f78f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/919f47ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/919f47ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa12d36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/919f47ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/a12ffefdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/a12ffefdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3180cd9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/a12ffefdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/a1348ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/a1348ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dd67271..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/a1348ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,141 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/b174f9fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/b174f9fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 742fce2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/b174f9fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.ItemUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f0a92cd3fa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f0a92cd3fa2000141769cb1ed0c338cd deleted file mode 100644 index fdb268e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f0a92cd3fa2000141769cb1ed0c338cd +++ /dev/null @@ -1,17 +0,0 @@ -package projectzulu.common.API; - -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public enum PotionList { - INSTANCE; - public static Optional bubbling = Optional.absent(); - public static Optional incendiary = Optional.absent(); - public static Optional slowfall = Optional.absent(); - public static Optional cleansing = Optional.absent(); - public static Optional curse = Optional.absent(); - public static Optional thorn = Optional.absent(); - public static Optional heal2 = Optional.absent(); - public static Optional harm2 = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f0a9c7f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f0a9c7f4c42100141fce95f06aba7e85 deleted file mode 100644 index 7c7b253..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f0a9c7f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f13a6fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f13a6fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a61d1a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/10/f13a6fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/01f9d69ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/01f9d69ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2d22fcb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/01f9d69ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10348dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10348dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9ea1302..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/10348dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/115aeee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/115aeee4c42100141fce95f06aba7e85 deleted file mode 100644 index b5a81ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/115aeee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3086c2fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3086c2fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d8a80cb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3086c2fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3091dde4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3091dde4c42100141fce95f06aba7e85 deleted file mode 100644 index d87f46b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3091dde4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3131ecf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3131ecf9c42100141fce95f06aba7e85 deleted file mode 100644 index b842e54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/3131ecf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,22 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/7061b1cbfa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/7061b1cbfa2000141769cb1ed0c338cd deleted file mode 100644 index d703234..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/7061b1cbfa2000141769cb1ed0c338cd +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.API; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/818c9ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/818c9ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1cd0fef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/818c9ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.api.BlockList; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/a021b5e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/a021b5e4c42100141fce95f06aba7e85 deleted file mode 100644 index 6a4f1f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/a021b5e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.world.World; - -public class TerrainFeatureHelper { - - /** - * Method to evaluate the terrain variation. Compares the height along each point of an X to the center. - * If greater than provided difference return false; - * @param world - * @param Xcoord - * @param Ycoord - * @param Zcoord - * @param maxDifference - * @param squareLength - * @return - */ - public static boolean doesTerrainFluctuate(World world, int Xcoord, int Ycoord, int Zcoord, int maxDifference, int squareLength){ - if( Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord+squareLength) - Ycoord) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord+squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference){ - return false; - } - - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/b16383f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/b16383f6c42100141fce95f06aba7e85 deleted file mode 100644 index 248da5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/b16383f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -/** - * Terrain Feature that is Restricted by Biome - */ -public abstract class BiomeFeature extends BaseFeature { - - /** List of Biome Package Names that this Feature can Spawn in */ - protected ArrayList biomesToSpawn = new ArrayList(); - - public BiomeFeature(String featureName, Size size) { - super(featureName, size); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - return biomesToSpawn.contains(getBiomePackageName(world.getBiomeGenForCoords(genBlockCoords.posX, - genBlockCoords.posZ))); - } - return false; - } - - protected abstract Collection getDefaultBiomeList(); - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - Collection defaultBiomesToSpawn = getDefaultBiomeList(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - if (config.getFeatureProperty(this, "GeneratingBiomes", - getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i]), - defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName)).getBoolean(false)) { - biomesToSpawn.add(getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i])); - } - } - } - - private String getBiomePackageName(BiomeGenBase biome) { - return biome.getClass().getName() + "." + biome.biomeName; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/c1bca9ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/c1bca9ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index bac9d84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/c1bca9ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/d07508b9052100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/d07508b9052100141769cb1ed0c338cd deleted file mode 100644 index a7da319..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/d07508b9052100141769cb1ed0c338cd +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/d09a72f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/d09a72f6c42100141fce95f06aba7e85 deleted file mode 100644 index 5d8846b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/d09a72f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/e0e29ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/e0e29ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 7fe9312..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/11/e0e29ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraft.item.Item; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public ItemDeclaration(String name) { - this(name, 0); - } - - public ItemDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("item", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createItem(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerItem(); - if (!side.isServer()) { - clientRegisterItem(); - } - } - } - - protected abstract void registerItem(); - - protected void clientRegisterItem() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/303b38f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/303b38f4c42100141fce95f06aba7e85 deleted file mode 100644 index f2f88c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/303b38f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/31f0f19dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/31f0f19dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dbc2fe1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/31f0f19dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/40217affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/40217affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ab2ff9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/40217affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectOasis; -import projectzulu.common.world2.randomizer.EdgeRandomizer; -import projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/500270e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/500270e4c42100141fce95f06aba7e85 deleted file mode 100644 index 5f13576..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/500270e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelTombstone extends ModelBase -{ - //fields - ModelRenderer baserig; - ModelRenderer body4; - ModelRenderer topcenter; - ModelRenderer baselef; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - private ModelRenderer CENTERROT; - private ModelRenderer TOPLEFROT; - private ModelRenderer TOPRIGROT; - - public ModelTombstone(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TOPLEFROT.topleft", 0, 17); - setTextureOffset("TOPRIGROT.topright", 0, 17); - - body4 = new ModelRenderer(this, 28, 15); - body4.addBox(0F, -18F, -4.5F, 9, 8, 9); - body4.setRotationPoint(0F, 28F, 0F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - topcenter = new ModelRenderer(this, 28, 16); - topcenter.addBox(-4.5F, -4F, -4.5F, 9, 4, 9); - topcenter.setRotationPoint(0F, 2F, 0F); - topcenter.setTextureSize(64, 32); - topcenter.mirror = true; - setRotation(topcenter, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 28, 15); - body3.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body3.setRotationPoint(0F, 28F, 0F); - body3.setTextureSize(64, 32); - body3.mirror = true; - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body3.mirror = false; - body2 = new ModelRenderer(this, 28, 15); - body2.addBox(0F, -18F, -4.5F, 9, 8, 9); - body2.setRotationPoint(0F, 20F, 0F); - body2.setTextureSize(64, 32); - body2.mirror = true; - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body2.mirror = false; - body1 = new ModelRenderer(this, 28, 15); - body1.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body1.setRotationPoint(0F, 20F, 0F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - baselef = new ModelRenderer(this, 0, 0); - baselef.addBox(-12F, -3F, -6F, 12, 6, 12); - baselef.setRotationPoint(0F, 21F, 0F); - baselef.setTextureSize(64, 32); - baselef.mirror = true; - baselef.mirror = true; - setRotation(baselef, 0F, 0F, 0F); - baselef.mirror = false; - baserig = new ModelRenderer(this, 0, 0); - baserig.addBox(0F, -3F, -6F, 12, 6, 12); - baserig.setRotationPoint(0F, 21F, 0F); - baserig.setTextureSize(64, 32); - baserig.mirror = true; - baserig.mirror = true; - setRotation(baserig, 0F, 0F, 0F); - baserig.mirror = false; - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 1.2F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - TOPLEFROT = new ModelRenderer(this, "TOPLEFROT"); - TOPLEFROT.setRotationPoint(-5.8F, 0F, 0F); - setRotation(TOPLEFROT, 0F, 0F, 0.837758F); - TOPLEFROT.mirror = true; - TOPLEFROT.addBox("topleft", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPLEFROT); - TOPRIGROT = new ModelRenderer(this, "TOPRIGROT"); - TOPRIGROT.setRotationPoint(5.8F, 0F, 0F); - setRotation(TOPRIGROT, 0F, 0F, -0.837758F); - TOPRIGROT.mirror = true; - TOPRIGROT.addBox("topright", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPRIGROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - baserig.render(f5); - body4.render(f5); - topcenter.render(f5); - baselef.render(f5); - body3.render(f5); - body2.render(f5); - body1.render(f5); - - CENTERROT.render(f5); - - } - - public void render1(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - body4.rotateAngleY = (float) (angle*Math.PI/180); - body4.render(f5); - topcenter.rotateAngleY = (float) (angle*Math.PI/180); - topcenter.render(f5); - - body3.rotateAngleY = (float) (angle*Math.PI/180); - body3.render(f5); - body2.rotateAngleY = (float) (angle*Math.PI/180); - body2.render(f5); - body1.rotateAngleY = (float) (angle*Math.PI/180); - body1.render(f5); - - baselef.rotateAngleY = (float) (angle*Math.PI/180); - baselef.render(f5); - baserig.rotateAngleY = (float) (angle*Math.PI/180); - baserig.render(f5); - } - - public void render2(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - CENTERROT.rotateAngleY = (float) (angle*Math.PI/180); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } - -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/500707e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/500707e4c42100141fce95f06aba7e85 deleted file mode 100644 index a9ccaf7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/500707e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/514ae49fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/514ae49fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43559de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/514ae49fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,176 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/602825f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/602825f4c42100141fce95f06aba7e85 deleted file mode 100644 index 7c0367d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/602825f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world2.Direction; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/618869e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/618869e6c42100141fce95f06aba7e85 deleted file mode 100644 index 2039367..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/618869e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericLimited; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/a1aa27a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/a1aa27a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 25a049d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/a1aa27a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,24 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionCleansing extends PotionZulu { - - public PotionCleansing(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(1, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - super.performEffect(effectedEntity, par2); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/b01f27a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/b01f27a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index af2b6f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/b01f27a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c0341ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c0341ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d9e3e93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c0341ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c0d1d801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c0d1d801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 014faa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/c0d1d801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/d2e50ffac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/d2e50ffac42100141fce95f06aba7e85 deleted file mode 100644 index 5e127d1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/d2e50ffac42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemCoconutSeed; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/f0b33501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/f0b33501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 32adadb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/12/f0b33501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMummy; -import projectzulu.common.mobs.models.ModelMummy; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/0193be01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/0193be01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d7f1c40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/0193be01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,176 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/2021eaffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/2021eaffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ad2b0ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/2021eaffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,163 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.terrain.TerrainFeature; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/21bfbff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/21bfbff8c42100141fce95f06aba7e85 deleted file mode 100644 index 2845089..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/21bfbff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,277 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityArmadillo; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelArmadillo extends ModelBase { - public ModelRenderer WHOLE; - public ModelRenderer HEADPIECE; - public ModelRenderer REARRTR1; - public ModelRenderer REARRTR2; - public ModelRenderer REARRTR3; - - public ModelRenderer leg1; - public ModelRenderer leg2; - public ModelRenderer leg3; - public ModelRenderer leg4; - public ModelRenderer body2; - public ModelRenderer tail; - public ModelRenderer body1; - public ModelRenderer body3; - public ModelRenderer body4; - - public ModelRenderer chin; - public ModelRenderer head; - public ModelRenderer nose; - - public ModelArmadillo() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("WHOLE.dltfold0", 0, 0); - - WHOLE = new ModelRenderer(this, "WHOLE"); - WHOLE.setRotationPoint(0F, 18F, 0F); - // WHOLE.setRotationPoint(0F, 0F, 0F); - WHOLE.mirror = true; - setRotation(WHOLE, 0F, 0F, 0F); - - REARRTR1 = new ModelRenderer(this, "REARRTR1"); - WHOLE.addChild(REARRTR1); - REARRTR1.setRotationPoint(0F, -3F, -2F); - setRotation(REARRTR1, 0F, 0F, 0F); - REARRTR1.mirror = true; - body2 = new ModelRenderer(this, 32, 0); - body2.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR1.addChild(body2); - body2.setRotationPoint(0F, 3F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - REARRTR2 = new ModelRenderer(this, "REARRTR2"); - REARRTR1.addChild(REARRTR2); - REARRTR2.setRotationPoint(0F, -1F, 4F); - setRotation(REARRTR2, 0F, 0F, 0F); - REARRTR2.mirror = true; - body3 = new ModelRenderer(this, 32, 0); - body3.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR2.addChild(body3); - body3.setRotationPoint(0F, 4F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - REARRTR3 = new ModelRenderer(this, "REARRTR3"); - REARRTR2.addChild(REARRTR3); - REARRTR3.setRotationPoint(0F, 0F, 4F); - setRotation(REARRTR3, 0F, 0F, 0F); - REARRTR3.mirror = true; - tail = new ModelRenderer(this, 8, 14); - tail.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); - REARRTR3.addChild(tail); - tail.setRotationPoint(0F, 6F, 4F); - tail.setTextureSize(64, 32); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 32, 0); - body4.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR3.addChild(body4); - body4.setRotationPoint(0F, 4F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(REARRTR3); - // dltfold2.addChildModelRenderer(REARRTR2); - // dltfold0.addChildModelRenderer(REARRTR1); - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - WHOLE.addChild(HEADPIECE); - HEADPIECE.setRotationPoint(0F, 1F, -6F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - nose = new ModelRenderer(this, 12, 9); - nose.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADPIECE.addChild(nose); - nose.setRotationPoint(0F, 2F, -5F); - nose.setTextureSize(64, 32); - nose.mirror = true; - setRotation(nose, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 0); - head.addBox(-2.5F, -2.5F, -1.5F, 5, 5, 3); - HEADPIECE.addChild(head); - head.setRotationPoint(0F, 0F, -1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - chin = new ModelRenderer(this, 0, 8); - chin.addBox(-1.5F, -1.5F, -2.5F, 3, 3, 3); - HEADPIECE.addChild(chin); - chin.setRotationPoint(0F, 1F, -3F); - chin.setTextureSize(64, 32); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - // dltfold0.addChildModelRenderer(HEADPIECE); - body1 = new ModelRenderer(this, 32, 0); - body1.addBox(-4.5F, -4F, -2F, 9, 8, 4); - WHOLE.addChild(body1); - body1.setRotationPoint(0F, 0F, -4F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 15); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg4); - leg4.setRotationPoint(3F, 4F, 5F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 15); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg3); - leg3.setRotationPoint(-3F, 4F, 5F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 0, 15); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg2); - leg2.setRotationPoint(3F, 4F, -4F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 15); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg1); - leg1.setRotationPoint(-3F, 4F, -4F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // Something Should GO here - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - WHOLE.render(f5); - GL11.glPopMatrix(); - } else { - WHOLE.render(f5); - } - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - EntityArmadillo var5 = (EntityArmadillo) par7Entity; - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateX(+0.05f * 2.0f, 0f, (float) (145 * Math.PI / 180f)); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - // HEADPIECE.rotateAngleX = - // var5.eHEADPIECE.rotateX(-0.05f*animSpeed,0f,(float)(145*Math.PI/180f)); - this.HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateAngleX = Math.min(Math.max(par5, -180), +180) - * (float) (Math.PI / 180f); - this.HEADPIECE.rotateAngleY = var5.eHEADPIECE.rotateAngleY = Math.min(Math.max(par4, -30), +30) - * (float) (Math.PI / 180f); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityArmadillo var5 = (EntityArmadillo) par1EntityLiving; - - if (var5.eWHOLE.isSetup == false) { - var5.eWHOLE.setup(WHOLE); - } - if (var5.eHEADPIECE.isSetup == false) { - var5.eHEADPIECE.setup(HEADPIECE); - } - if (var5.eREARRTR1.isSetup == false) { - var5.eREARRTR1.setup(REARRTR1); - } - if (var5.eREARRTR2.isSetup == false) { - var5.eREARRTR2.setup(REARRTR2); - } - if (var5.eREARRTR3.isSetup == false) { - var5.eREARRTR3.setup(REARRTR3); - } - if (var5.etail.isSetup == false) { - var5.etail.setup(tail); - } - if (var5.eleg3.isSetup == false) { - var5.eleg3.setup(leg3); - } - if (var5.eleg4.isSetup == false) { - var5.eleg4.setup(leg4); - } - - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - float animSpeed = 2.0f; - if (var5.isCharging() == true) { - animSpeed = 5.0f; - /* Make Complete Body Circle */ - if (var5.eWHOLE.rotateAngleX == (float) ((390 + 360) * Math.PI / 180f)) { - var5.eWHOLE.rotateAngleX -= 360 * Math.PI / 180; - } - WHOLE.rotateAngleX = var5.eWHOLE - .rotateX(+0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - } else { - animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(+0.09f * animSpeed, 0f, (float) (390 * Math.PI / 180f)); - } - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(+0.1f, (float) (0 * Math.PI / 180f), (float) (90 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(-0.5f * animSpeed, 2.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(-0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(-0.5f * animSpeed, -4f, 4f); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - float animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(-0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - /* Rotate Face Inward */ - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(-0.1f * animSpeed, (float) (-15 * Math.PI / 180f), - (float) (30 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(+0.5f * animSpeed, 0.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(+0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(+0.5f * animSpeed, -4f, 4f); - - leg1.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg2.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - leg3.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg4.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40d3209fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40d3209fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index afea021..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/40d3209fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseGrey; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/42cbbdfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/42cbbdfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 857b836..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/42cbbdfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/50823115312000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/50823115312000141dbfc2e92eb0e949 deleted file mode 100644 index 0929e30..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/50823115312000141dbfc2e92eb0e949 +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - // some example code - System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/514281fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/514281fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4d8445b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/514281fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,563 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getAABBPool() - .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/60cb46a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/60cb46a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0abb40e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/60cb46a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/72bd3aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/72bd3aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index db2dc74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/72bd3aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/80a507fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/80a507fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e482bb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/80a507fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/907556e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/907556e6c42100141fce95f06aba7e85 deleted file mode 100644 index a3f5688..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/907556e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world; - -import java.util.Random; - -public enum CellIndexDirection { - Middle, Inner, NorthMiddle, SouthMiddle, WestMiddle, EastMiddle, NorthWestCorner, NorthEastCorner, SouthWestCorner, SouthEastCorner, NorthWall, SouthWall, WestWall, EastWall; - - public boolean isCorner() { - return this == NorthWestCorner || this == NorthEastCorner || this == SouthWestCorner || this == SouthEastCorner; - } - - public static CellIndexDirection randomCardinalDirection(Random random) { - switch (random.nextInt(4)) { - case 0: - return NorthMiddle; - case 1: - return SouthMiddle; - case 2: - return WestMiddle; - case 3: - return EastMiddle; - default: - return NorthMiddle; - } - } - - public CellIndexDirection calcDirection(int cellIndex, int cellSize) { - - /* Check if Middle */ - if (cellSize % 2 == 1) { - if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1) / 2) { - return Middle; - } else if (cellIndex == (cellSize - 1) / 2) { - return WestMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2) { - return NorthMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) + (cellSize - 1) / 2) { - return EastMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1)) { - return SouthMiddle; - } - } - - /* Check if Corner */ - if (cellIndex == 0) { - return NorthWestCorner; - } else if (cellIndex == cellSize - 1) { - return SouthWestCorner; - } else if (cellIndex == cellSize * cellSize - 1) { - return SouthEastCorner; - } else if (cellIndex == cellSize * cellSize - cellSize) { - return NorthEastCorner; - } - - /* Check if Outer Edge */ - if ((cellIndex % cellSize == (0))) { - return NorthWall; - } else if ((cellIndex % cellSize == (cellSize - 1))) { - return SouthWall; - } else if (cellIndex >= cellSize * (cellSize - 1) && cellIndex < cellSize * cellSize) { - return EastWall; - } else if (cellIndex >= 0 && cellIndex < cellSize) { - return WestWall; - } - - /* If Nothing Else Mark as Inner */ - return Inner; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/907ccc9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/907ccc9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 658ee19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/907ccc9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a09421f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a09421f6c42100141fce95f06aba7e85 deleted file mode 100644 index 228cf5a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/a09421f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/b084abe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/b084abe4c42100141fce95f06aba7e85 deleted file mode 100644 index cfde8a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/b084abe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.core; - - -/** - * For usage see: {@link Pair} - */ -public class PairFullShortName implements Comparable> { - private final K fullName; - private final V shortName; - - public static PairFullShortName createPair(K fullName, V shortName) { - return new PairFullShortName(fullName, shortName); - } - - public PairFullShortName(K fullName, V shortName) { - this.fullName = fullName; - this.shortName = shortName; - } - - public K getFullName() { - return fullName; - } - - public V getShortName() { - return shortName; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairFullShortName)) { return false; } - PairFullShortName pair = (PairFullShortName)object; - return fullName.equals(pair.fullName) && shortName.equals(pair.shortName); - } - - @Override - public int hashCode(){ - return 7 * fullName.hashCode() + 13 * shortName.hashCode(); - } - - @Override - public int compareTo(PairFullShortName otherPair) { - if(otherPair.equals(this)){ - return 0; - }else{ - return this.getShortName().compareTo(otherPair.getShortName()); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/c0377cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/c0377cf6c42100141fce95f06aba7e85 deleted file mode 100644 index 9ff4333..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/c0377cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.blocks.GuiAnimalName; -import com.ngb.projectzulu.common.blocks.tombstone.GuiTombstone; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.blocks.universalpot.ContainerUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.GuiContainerUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import com.ngb.projectzulu.common.dungeon.GuiLimitedMobSpawner; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import com.ngb.projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingBase; -import cpw.mods.fml.common.network.IGuiHandler; - -public class ZuluGuiHandler implements IGuiHandler { - - @Override - public Object getServerGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - - TileEntity tileEntityServer; - switch (GuiID.getGuiIDByID(guiID)) { - case FlowerPot: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityUniversalFlowerPot) { - return new ContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityServer); - } - case BrewingStand: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityBrewingBase) { - return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - default: - break; - } - return null; - - } - - @Override - public Object getClientGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tileEntityClient; - switch (GuiID.getGuiIDByID(guiID)) { - case Tombstone: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityTombstone) { - return new GuiTombstone((TileEntityTombstone) tileEntityClient); - } - break; - case FlowerPot: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityUniversalFlowerPot) { - return new GuiContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityClient); - } - break; - case AnimalName: - return new GuiAnimalName(world, player, x); - case MobSpawner: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityLimitedMobSpawner) { - return new GuiLimitedMobSpawner((TileEntityLimitedMobSpawner) tileEntityClient); - } - case BrewingStand: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityBrewingBase) { - return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - } - - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/e002cf00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/e002cf00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 03bb0cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/e002cf00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/e0e1a6a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/e0e1a6a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 000e3a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/e0e1a6a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/f135dffdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/f135dffdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8ca455e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/13/f135dffdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.brewingstands.PotionIngredients; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GenericCraftingItemsDeclaration extends ItemDeclaration { - - public GenericCraftingItemsDeclaration() { - super("GenericCraftingItems1"); - } - - @Override - protected boolean createItem() { - ItemGenerics itemGenerics = (ItemGenerics) new ItemGenerics(); - ItemList.genericCraftingItems = Optional.of(itemGenerics); - PotionIngredients.addIngredientProperties(itemGenerics, itemGenerics); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.genericCraftingItems.get(); - OreDictionary.registerOre("foodSalt", new ItemStack(item, 1, ItemGenerics.Properties.Salt.meta())); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/00ba98f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/00ba98f9c42100141fce95f06aba7e85 deleted file mode 100644 index 2626abb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/00ba98f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/10e461d53720001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/10e461d53720001413909a661a93f408 deleted file mode 100644 index ad94c6d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/10e461d53720001413909a661a93f408 +++ /dev/null @@ -1,46 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone - }); - - GameRegistry.addRecipe(new ItemStack(Items.dye, 2, 15), new Object[]{ - "AB ", - "AAC", - "A ", - 'A', Blocks.cobblestone, 'B', Blocks.dirt, 'C', new ItemStack(Items.dye, 1, 1) - }); - - GameRegistry.addRecipe(new ItemStack(Item.diamond, 2), new Object[] { - "DDD", "DDD", "DDD", 'D', Blocks.dirt }); - - GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 2, 1), new Object[] - { - new ItemStack(Items.dye, 1, 1), Items.apple - }); - - GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 11), 0.1F); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/114fd3fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/114fd3fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 306b828..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/114fd3fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/3066e5ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/3066e5ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1dbf0a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/3066e5ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,22 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/3202e0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/3202e0e4c42100141fce95f06aba7e85 deleted file mode 100644 index 1f01f77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/3202e0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/50906201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/50906201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e6e39b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/50906201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/61f63ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/61f63ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 204f7c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/61f63ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempArmor { - - /** - * Factor that adds to the current Player Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Item is Equipped - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/7022da9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/7022da9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c5f1b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/7022da9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockAloeVera; -import projectzulu.common.blocks.ItemAloeVera; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/a223949ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/a223949ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f68851..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/a223949ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/c028bb9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/c028bb9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index af2b6f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/c028bb9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/e02b5a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/e02b5a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7bcccd5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/14/e02b5a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,169 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/200b52a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/200b52a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 33368cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/200b52a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/206f8bf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/206f8bf5c42100141fce95f06aba7e85 deleted file mode 100644 index b792e21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/206f8bf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityFox; -import com.ngb.projectzulu.common.mobs.models.ModelFox; -import com.ngb.projectzulu.common.mobs.renders.RenderTameable; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/213ffc9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/213ffc9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0302188..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/213ffc9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectLabyrinth; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/60945fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/60945fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2bb03ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/60945fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,147 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/80bf58e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/80bf58e6c42100141fce95f06aba7e85 deleted file mode 100644 index f24f6e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/80bf58e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,24 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/c146b2f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/c146b2f7c42100141fce95f06aba7e85 deleted file mode 100644 index e818227..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/c146b2f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGorillaHead extends ModelBase{ - - ModelRenderer HEADROT; - - public ModelGorillaHead() - { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 23F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/d17c77f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/d17c77f6c42100141fce95f06aba7e85 deleted file mode 100644 index 769f476..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/d17c77f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLimitedMobSpawner extends BlockContainer { - - public BlockLimitedMobSpawner() { - super(Material.rock); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, - float par7, float par8, float par9) { - if (player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isCreativeMode) { - ((EntityPlayer) player).openGui(ProjectZulu_Core.modInstance, GuiID.MobSpawner.getID(), par1World, par2, - par3, par4); - return true; - } - return super.onBlockActivated(par1World, par2, par3, par4, player, par6, par7, par8, par9); - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityLimitedMobSpawner(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/e07fe1fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/e07fe1fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cecf04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/e07fe1fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f0c5c9e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f0c5c9e5c42100141fce95f06aba7e85 deleted file mode 100644 index 59a1459..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f0c5c9e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.HashMap; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class PotionIngredients { - - public static interface IngredientProperty { - public abstract boolean isIngredient(ItemStack ingredient); - } - - public static class OverrideIngredient implements IngredientProperty { - boolean isIngredient = true; - - @Override - public boolean isIngredient(ItemStack ingredient) { - return isIngredient; - } - } - - private static HashMap ingredientProperties = new HashMap(); - - static { - addIngredientProperties(Items.feather, new OverrideIngredient()); - } - - public static void addIngredientProperties(Item item, IngredientProperty ingredientProperty) { - ingredientProperties.put(item, ingredientProperty); - } - - public static boolean isPotionIngredient(ItemStack ingredient) { - if (ingredient == null) { - return false; - } - - IngredientProperty property = ingredientProperties.get(ingredient.getItem()); - if (property != null) { - return property.isIngredient(ingredient); - } else { - return ingredient != null ? ingredient.getItem().isPotionIngredient(ingredient) : false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f16f06fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f16f06fac42100141fce95f06aba7e85 deleted file mode 100644 index 99dd85f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f16f06fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockNightBloom; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f17c61e7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f17c61e7c42100141fce95f06aba7e85 deleted file mode 100644 index b3fbd64..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f17c61e7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import net.minecraft.util.Vec3; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - // player.posY + player.getEyeHeight(), player.posZ), - Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), - // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - // entity.posZ) - Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) - ) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f1c4dcfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f1c4dcfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 99444c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/15/f1c4dcfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/12709a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/12709a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0abb40e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/12709a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/20bfbff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/20bfbff8c42100141fce95f06aba7e85 deleted file mode 100644 index 9c90ca6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/20bfbff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,182 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityBear; -import com.ngb.projectzulu.common.mobs.entity.EntityBlackBear; -import com.ngb.projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/2121eaffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/2121eaffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e06c031..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/2121eaffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/301029fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/301029fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cece5f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/301029fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,150 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - player.posY + player.getEyeHeight(), player.posZ), - worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - entity.posZ)) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/71def1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/71def1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4b704b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/71def1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,182 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityBear; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/80868c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/80868c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 53a4c86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/80868c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/8135f2e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/8135f2e5c42100141fce95f06aba7e85 deleted file mode 100644 index f2e6415..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/8135f2e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/90e8c2f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/90e8c2f7c42100141fce95f06aba7e85 deleted file mode 100644 index 5b1639e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/90e8c2f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; -import com.ngb.projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/a114b8ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/a114b8ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 034b47f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/a114b8ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCampfire; -import projectzulu.common.blocks.ItemCampFire; -import projectzulu.common.blocks.RenderCampFire; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/c0ad15f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/c0ad15f6c42100141fce95f06aba7e85 deleted file mode 100644 index 7a0214d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/c0ad15f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,321 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/d2e07ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/d2e07ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5a1797e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/d2e07ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,297 +0,0 @@ -package projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e093aefec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e093aefec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a58e5dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e093aefec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e0a1f300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e0a1f300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1be34fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e0a1f300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,157 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e0eb4cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e0eb4cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8249e3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/e0eb4cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/f14e43fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/f14e43fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cf75075..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/16/f14e43fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,367 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/209cbcf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/209cbcf6c42100141fce95f06aba7e85 deleted file mode 100644 index 28ea15e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/209cbcf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,14 +0,0 @@ -package com.ngb.com.ngb.projectzulu.common; - -public class CommonProxyProjectZulu { - - public int addArmor(String armor) { - return 0; - } - - public void bossHealthTicker() { - } - - public void registerModelsAndRender() { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/300ee9f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/300ee9f7c42100141fce95f06aba7e85 deleted file mode 100644 index 3393d15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/300ee9f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/30d281f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/30d281f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2397aa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/30d281f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHornBill; -import com.ngb.projectzulu.common.mobs.models.ModelHornBill; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HornbillDeclaration extends SpawnableDeclaration { - - public HornbillDeclaration() { - super("Horn Bill", 36, EntityHornBill.class, EnumCreatureType.ambient); - setSpawnProperties(10, 25, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (26 << 16) + (19 << 8) + 15; - eggColor2 = (199 << 16) + (33 << 8) + 14; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/71419101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/71419101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a920d9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/71419101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/91dcb9e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/91dcb9e4c42100141fce95f06aba7e85 deleted file mode 100644 index 6947281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/91dcb9e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandPlaceBlock extends CommandBase { - @Override - public String getCommandName() { - return "placeblock"; - } - - /** - * Return the required permission level for this command. - */ - @Override - public int getRequiredPermissionLevel() { - return 2; - } - - /** - * Command stringArgs : /placeblock [targetPlayer] [blockID] Command stringArgs == 2: /placeblock @p - * blockID Command stringArgs == 3: /placeblock @p blockID Command stringArgs == 5: /placeblock @p blockID - * Command stringArgs == 6: /placeblock @p blockID - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.placeblock.usage", new Object[0]); - } else { - int targetX = 0; - int targetY = 0; - int targetZ = 0; - int blockMeta = 0; - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - Block blockToPlace = Block.getBlockFromName(stringArgs[1]); - if (blockToPlace == null) { - throw new WrongUsageException("commands.placeblock.noblock", new Object[0]); - } - - if (stringArgs.length == 3 || stringArgs.length == 6) { - blockMeta = parseIntBounded(commandSender, stringArgs[2], 0, 4095); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - targetX = (int) targetPlayer.posX; - targetY = (int) targetPlayer.posY; - targetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - targetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - targetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, - 0); - targetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - targetPlayer.worldObj.setBlock(targetX, targetY, targetZ, blockToPlace, blockMeta, 3); - } - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spawnentity.usage"; - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/a09f8001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/a09f8001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0a66870..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/a09f8001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,290 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.EntityPZPotion; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/b072b9f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/b072b9f7c42100141fce95f06aba7e85 deleted file mode 100644 index 255cc10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/b072b9f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBoarHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBoarHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 4F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/b12ee8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/b12ee8f8c42100141fce95f06aba7e85 deleted file mode 100644 index 9e1f045..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/b12ee8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityPolarBear; -import com.ngb.projectzulu.common.mobs.models.ModelPolarBear; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/c07ba7e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/c07ba7e6c42100141fce95f06aba7e85 deleted file mode 100644 index d6fbe83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/c07ba7e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.util.Random; - -import projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/c0b7b89dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/c0b7b89dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eaab348..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/c0b7b89dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d006def6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d006def6c42100141fce95f06aba7e85 deleted file mode 100644 index 6470e86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d006def6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,617 +0,0 @@ -package com.ngb.projectzulu.common.blocks.spike; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpike implements ISimpleBlockRenderingHandler { - - /* Leaving This here For Reference */ - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94216_b %s", var10.func_94216_b()); // 192 - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94212_f %s", var10.getMaxU()); // 0.5 - // ProjectZuluLog.info("func_94214_a %s", var10.getInterpolatedU(8D)); // 0: 0.46875, 8: 0.484375 - // ProjectZuluLog.info("func_94206_g %s", var10.getMinV()); // 0.375 - // ProjectZuluLog.info("func_94210_h %s", var10.getMaxV()); // 0.40625 - // ProjectZuluLog.info("func_94207_b %s", var10.func_94207_b(8D)); // 0: 0.375, 8: 0.390625 - // ProjectZuluLog.info("func_94215_i %s", var10.func_94215_i()); // NAME - // ProjectZuluLog.info("func_94213_j %s", var10.func_94213_j()); // 512 - // ProjectZuluLog.info("func_94208_k %s", var10.func_94208_k()); // 512 - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - return Render(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - } - - private boolean Render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - // // if (par1Block == Block.tallGrass) - // // { - // // long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; - // // var17 = var17 * var17 * 42317861L + var17 * 11L; - // // var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; - // // var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // } - if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars - || blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - // renderAsSpike(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - RenderFencePikes(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - - } else if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - boolean isNegZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - /* Check For Along Z */ - if (isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 0); - } else if (!isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 1); - } else if (isNegZ && !isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 2); - } - - /* Check For Along X */ - if (isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 0); - } else if (!isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 1); - } else if (isNegX && !isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 2); - } - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - drawSpikeCross(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - - } else { - // renderer.drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, - // var15, 1.0f); - drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - return true; - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block par1) { - return par1.isOpaqueCube() || par1 == Blocks.iron_bars || par1 == Blocks.glass; - } - - public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, - RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - 0.5D; - double var23 = par3 + 0.5D + 0.5D; - double var25 = par7 + 0.5D - 0.5D; - double var27 = par7 + 0.5D + 0.5D; - - switch (par2) { - case 0: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 1: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 2: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 3: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 4: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 5: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - case 6: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 7: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 8: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 9: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 10: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 11: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - default: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - } - } - - public void drawOnSide0(Tessellator tessellator, double par5, double var21, double var23, double var25, - double var27, double var13, double var15, double var17, double var19) { - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17); - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17); - } - - public void drawOnSide1(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide2(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide3(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide4(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide5(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - } - - public void RenderFencePikes(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 1f / 4f; - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 3f / 4f; - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - (0.625 - 0.375) / 2D; - double var23 = par3 + 0.5D + (0.625 - 0.375) / 2D; - double var25 = par7 + 0.5D - (0.625 - 0.375) / 2D; - double var27 = par7 + 0.5D + (0.625 - 0.375) / 2D; - - double maxY = 0.6; - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var15, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - - public void drawSpikeCross(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - /* Render Strip Along X */ - double var21 = par3 + 0.5D - 0.5; - double var23 = par3 + 0.5D + 0.5; - double var25 = par7 + 0.5D - 0.06; - double var27 = par7 + 0.5D + 0.06; - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - /* Render Strip Along Z */ - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - - // float var6 = 0.375F; - // float var7 = 0.625F; - maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - } - - public void drawSpikeStrip(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer, - Boolean alongX, int type) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13; - double var15; - double var17; - double var19; - - switch (type) { - case 1: - var13 = var10.getInterpolatedU(8D); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - case 2: - var13 = var10.getMinU(); - var15 = var10.getInterpolatedU(8D); // var10.getMaxU(); - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2f; // var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - default: - var13 = var10.getMinU(); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - } - - double var21; - double var23; - double var25; - double var27; - if (alongX) { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.0; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - - break; - case 2: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.0; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - default: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - } - - } else { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.0; - var27 = par7 + 0.5D + 0.5; - - break; - case 2: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.0; - - break; - default: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - break; - } - } - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - if (alongX) { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - } else { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d0eaa6f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d0eaa6f9c42100141fce95f06aba7e85 deleted file mode 100644 index a3375b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d0eaa6f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.core; - -/** - * For usage see: {@link Pair} - */ -public class PairDirectoryFile { - private final K directory; - private final V file; - - public static PairDirectoryFile createPair(K directory, V file) { - return new PairDirectoryFile(directory, file); - } - - public PairDirectoryFile(K directory, V file) { - this.file = file; - this.directory = directory; - } - - public K getDirectory() { - return directory; - } - - public V getFile() { - return file; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairDirectoryFile)) { return false; } - PairDirectoryFile pair = (PairDirectoryFile)object; - return directory.equals(pair.directory) && file.equals(pair.file); - } - - @Override - public int hashCode(){ - return 7 * directory.hashCode() + 13 * file.hashCode(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d1cfd8e7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d1cfd8e7c42100141fce95f06aba7e85 deleted file mode 100644 index 5aa9050..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/d1cfd8e7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,236 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import net.minecraft.util.Vec3; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - //worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), tempE.posZ), - //worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ) - - Vec3.createVectorHelper((double)tempE.posX, (double) tempE.posY + tempE.getEyeHeight(),(double) tempE.posZ), - Vec3.createVectorHelper((double)this.posX, (double) this.posY,(double) this.posZ) - ) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/e0f8d1f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/e0f8d1f6c42100141fce95f06aba7e85 deleted file mode 100644 index 442c918..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/e0f8d1f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/e18cd7f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/e18cd7f8c42100141fce95f06aba7e85 deleted file mode 100644 index e476d3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/17/e18cd7f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,84 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseBlack; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00925c00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00925c00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11c938a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/00925c00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/21a1c89ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/21a1c89ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d66a2f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/21a1c89ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/21a65f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/21a65f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bd7cf6a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/21a65f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/31ac1cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/31ac1cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 5e885da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/31ac1cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/31c580f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/31c580f9c42100141fce95f06aba7e85 deleted file mode 100644 index dce11e7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/31c580f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,161 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import scala.annotation.meta.param; - -public class Node implements Comparable { - private Node parent; - private String name; - private List children = new ArrayList(); - - public Node(Node parent, String data) { - this.parent = parent; - parseDataForNode(data); - parseDataForChild(data); - } - - public Node getParent() { - return parent; - } - - public String getName() { - return name; - } - - /** - * Return Node name Concated after the name of its Parent(s) - * - * @return - */ - public String getFullName() { - return prefixParents(name); - } - - private String prefixParents(String name) { - if (parent != null && parent.parent != null && parent.parent.name.equals("root")) { - return parent.prefixParents(parent.name + ":" + name); - } else if (parent != null && !parent.name.equals("root")) { - return parent.prefixParents(parent.name + "." + name); - } else { - return name; - } - } - - public boolean addChild(String data) { - parseDataForChild(data); - return true; - } - - public Node getChild(int index) { - return children.get(index); - } - - public int numberOfChildren() { - return children.size(); - } - - public void sortNodeTree() { - Collections.sort(children); - for (Node child : children) { - child.sortNodeTree(); - } - } - - /** - * Return true if Name is Parsed from Data - */ - private boolean parseDataForNode(String data) { - String[] stringSplitData = data.split("\\.", 2); - this.name = stringSplitData[0]; - return true; - } - - /** - * Return true if Child is added from Data - */ - private boolean parseDataForChild(String data) { - String[] stringSplitData = data.split("\\.", 2); - if (stringSplitData.length < 2) { - return false; - } - String[] stringSplitChild = stringSplitData[1].split("\\.", 2); - - String childName = stringSplitChild[0]; - for (Node child : children) { - if (child.name.equals(childName)) { - child.addChild(stringSplitData[1]); - return true; - } - } - children.add(new Node(this, stringSplitData[1])); - return true; - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - Node otherNode = (Node) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (name == null) { - if (otherNode.name != null) { - return false; - } - } else if (!name.equals(otherNode.name)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } - - @Override - public int compareTo(Node node) { - if (node != null && node.children.size() > 0) { - if (children.size() > 0) { - return this.name.compareTo(node.name); - } else { - return +1; - } - } else if (this.children.size() > 0) { - return -1; - } - return this.name.compareTo(node.name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/3286c2fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/3286c2fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6e0e7bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/3286c2fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockWoodSlab; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockZuluSlab extends BlockWoodSlab { - - public static Block singleSlabID; - Block baseBlock; - - /** Single Slab Constructor */ - public BlockZuluSlab(Block baseBlock) { - super(false); - singleSlabID = this; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** Double Slab Constructor */ - public BlockZuluSlab(Block singleSlab, Block baseBlock) { - super(true); - singleSlabID = singleSlab; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - @Override - protected ItemStack createStackedBlock(int par1) { - return new ItemStack(singleSlabID, 2, par1 & 7); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return baseBlock.getIcon(par1, par2 & 7); - } - - @Override - public String func_150002_b(int par1) { - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(singleSlabID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/417b6bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/417b6bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b5cc916..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/417b6bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,107 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/602370f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/602370f9c42100141fce95f06aba7e85 deleted file mode 100644 index 26d85a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/602370f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/7131109fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/7131109fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 10d0405..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/7131109fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.models.ModelEagle; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/716858ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/716858ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4e78dbc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/716858ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/71d9719fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/71d9719fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 59a1459..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/71d9719fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.HashMap; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class PotionIngredients { - - public static interface IngredientProperty { - public abstract boolean isIngredient(ItemStack ingredient); - } - - public static class OverrideIngredient implements IngredientProperty { - boolean isIngredient = true; - - @Override - public boolean isIngredient(ItemStack ingredient) { - return isIngredient; - } - } - - private static HashMap ingredientProperties = new HashMap(); - - static { - addIngredientProperties(Items.feather, new OverrideIngredient()); - } - - public static void addIngredientProperties(Item item, IngredientProperty ingredientProperty) { - ingredientProperties.put(item, ingredientProperty); - } - - public static boolean isPotionIngredient(ItemStack ingredient) { - if (ingredient == null) { - return false; - } - - IngredientProperty property = ingredientProperties.get(ingredient.getItem()); - if (property != null) { - return property.isIngredient(ingredient); - } else { - return ingredient != null ? ingredient.getItem().isPotionIngredient(ingredient) : false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/82b2eafec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/82b2eafec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 68d15b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/82b2eafec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRabbit; -import projectzulu.common.mobs.models.ModelRabbit; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RabbitDeclaration extends SpawnableDeclaration { - - public RabbitDeclaration() { - super("Rabbit", 21, EntityRabbit.class, EnumCreatureType.creature); - setSpawnProperties(15, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (239 << 16) + (179 << 8) + 83; - eggColor2 = (237 << 16) + (208 << 8) + 166; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.RabbitsFoot.meta(), 8); - customMobData.entityProperties = new EntityProperties(10f, 1.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a043cbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a043cbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index deffdd6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/a043cbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,81 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBrownBear; -import projectzulu.common.mobs.models.ModelBrownBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/b1b83bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/b1b83bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a920d9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/b1b83bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/c066edfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/c066edfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4e6504d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/c066edfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/d082fff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/d082fff4c42100141fce95f06aba7e85 deleted file mode 100644 index 1ae436f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/d082fff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,13 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -public class PotionBubbling extends PotionZulu { - - protected PotionBubbling(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - @Override - public boolean isInstant() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/d1927da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/d1927da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a91b1ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/d1927da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthRandomWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if ((piecePos.posY == 0)) {// || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f16894e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f16894e6c42100141fce95f06aba7e85 deleted file mode 100644 index 89d0736..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/18/f16894e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomMid extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomMid(boolean inverted) { - super(inverted); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (inverted) { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(piecePos.posX + 1) == 0) { - return true; - } - } else { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(cellSize - 1 - piecePos.posX + 1) == 0) { - return true; - } - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randomMid"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/01fc8ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/01fc8ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 1fdf612..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/01fc8ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/414150a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/414150a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0ccd04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/414150a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/5036179fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/5036179fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4b0ddc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/5036179fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGorilla; -import projectzulu.common.mobs.models.ModelGorilla; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GorillaDeclaration extends SpawnableDeclaration { - - public GorillaDeclaration() { - super("Gorilla", 25, EntityGorilla.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (25 << 16) + (25 << 8) + 25; - eggColor2 = (93 << 16) + (93 << 8) + 93; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/507fd9ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/507fd9ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e99f15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/507fd9ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.BlockTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/509fb6fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/509fb6fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5dcdd90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/509fb6fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,264 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/609cab00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/609cab00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 801326c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/609cab00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,149 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/700b36fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/700b36fac42100141fce95f06aba7e85 deleted file mode 100644 index 5b1639e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/700b36fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; -import com.ngb.projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/70bb01f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/70bb01f7c42100141fce95f06aba7e85 deleted file mode 100644 index ed0aaca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/70bb01f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemFoodProjectZulu; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/a0a590a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/a0a590a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7ff86b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/a0a590a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,325 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/a1cbf1f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/a1cbf1f8c42100141fce95f06aba7e85 deleted file mode 100644 index 147335c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/a1cbf1f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/c15cbffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/c15cbffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 096cf98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/c15cbffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/d04ce8a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/d04ce8a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cddd77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/d04ce8a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,322 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/f09d2fe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/f09d2fe4c42100141fce95f06aba7e85 deleted file mode 100644 index 999abc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/19/f09d2fe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAnkh; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/00d0aef2c4ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/00d0aef2c4ab00141ee9bf3050c1025b new file mode 100644 index 0000000..3f198e6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/00d0aef2c4ab00141ee9bf3050c1025b @@ -0,0 +1,106 @@ +package com.stek101.projectzulu.common.mobs; + +import java.io.File; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.config.Configuration; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; + +public class BossHealthDisplayTicker { + + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + public static EntityGenericAnimal targetBoss; + protected Minecraft mc = Minecraft.getMinecraft(); + protected float zLevel = 0.0F; + static EntityPlayer player; + private Configuration config; + private boolean displayBossHealth = true; + private boolean bugRelease = true; + + // public BossHealthDisplayTicker (EntityGenericAnimal mobEntity) { + // this.targetBoss = mobEntity; + // } + + public static void registerEntity(EntityGenericAnimal newTicker) { + targetBoss = newTicker; + } + + public static boolean validTargetPresent(EntityGenericAnimal targetBoss) { + if (Minecraft.getMinecraft().thePlayer != null){ + //return targetBoss != null && !targetBoss.isDead && targetBoss.canEntityBeSeen(Minecraft.getMinecraft().thePlayer); + return targetBoss != null && !targetBoss.isDead && Minecraft.getMinecraft().thePlayer.canEntityBeSeen(targetBoss) + && (targetBoss.getDistanceToEntity(Minecraft.getMinecraft().thePlayer) < 16.0f); + } + else + return false; + } + + @SubscribeEvent + public void TickEvent(RenderTickEvent event) { + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + //bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + config.save(); + + if (event.phase == Phase.END && displayBossHealth) { + if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { + renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health"); + } + + } + } + + public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { + + FontRenderer fontRenderer = mc.fontRenderer; + + /* Draw Title */ + ScaledResolution var3 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + int screenWidth = var3.getScaledWidth(); + byte healthBarHeight = 12; + fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) + / 2, healthBarHeight - 10, 16711935); + + /* Draw Health Bar */ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(icons).getGlTextureId()); + short fullHealthBarWidth = 182; + int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; + int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); + + this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); + if (currHealthBarWidth > 0) { + this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); + var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); + var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); + var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); + var9.draw(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/303670ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/303670ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b34956..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/303670ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.api.BlockList; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/319a8ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/319a8ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7472e00..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/319a8ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/406e88fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/406e88fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ebbffb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/406e88fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/419997f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/419997f4c42100141fce95f06aba7e85 deleted file mode 100644 index eea800c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/419997f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class TileEntityWithMeta extends BlockWithMeta { - - public TileEntity tileEntity; - - public TileEntityWithMeta(Block block, int meta, TileEntity tileEntity) { - super(block, meta); - this.tileEntity = tileEntity; - } - - public TileEntityWithMeta(Block block, TileEntity tileEntity) { - this(block, 0, tileEntity); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/500f50a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/500f50a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 570d7b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/500f50a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/52a0a3e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/52a0a3e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5493676..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/52a0a3e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummyPharaoh extends ModelBiped { - - /** - * Sets the models various rotation angles. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/61167afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/61167afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 74942ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/61167afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,133 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/616c3600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/616c3600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5795c3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/616c3600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,322 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/909099a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/909099a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index edc63b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/909099a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/91e98201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/91e98201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6d85e37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/91e98201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/a1adfa9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/a1adfa9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 67ef5f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/a1adfa9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityCreature theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) this.targetEntity.posX, (double) this.targetEntity.posY, (double) this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/b0efcbf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/b0efcbf4c42100141fce95f06aba7e85 deleted file mode 100644 index 46e4935..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/b0efcbf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/b17989a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/b17989a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index da42b04..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/b17989a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,240 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/e12fa2f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/e12fa2f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5dd3700..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/e12fa2f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; - -public interface PZPacket { - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to encode into - */ - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to decode from - */ - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); - - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/f156a69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/f156a69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0ccd04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1a/f156a69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/003ad5a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/003ad5a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6a4f1f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/003ad5a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.world.World; - -public class TerrainFeatureHelper { - - /** - * Method to evaluate the terrain variation. Compares the height along each point of an X to the center. - * If greater than provided difference return false; - * @param world - * @param Xcoord - * @param Ycoord - * @param Zcoord - * @param maxDifference - * @param squareLength - * @return - */ - public static boolean doesTerrainFluctuate(World world, int Xcoord, int Ycoord, int Zcoord, int maxDifference, int squareLength){ - if( Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord+squareLength) - Ycoord) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord+squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference){ - return false; - } - - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/010ad8fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/010ad8fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2442ef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/010ad8fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutItem; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/01e0fdf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/01e0fdf5c42100141fce95f06aba7e85 deleted file mode 100644 index 028572d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/01e0fdf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/105f85e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/105f85e4c42100141fce95f06aba7e85 deleted file mode 100644 index ea2c846..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/105f85e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,151 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityUniversalFlowerPot extends TileEntity implements IInventory { - - private ItemStack[] inventory; - - public TileEntityUniversalFlowerPot() { - inventory = new ItemStack[1]; - } - - @Override - public int getSizeInventory() { - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public ItemStack decrStackSize(int slot, int amt) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize <= amt) { - setInventorySlotContents(slot, null); - } else { - stack = stack.splitStack(amt); - if (stack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - setInventorySlotContents(slot, null); - } - return stack; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this - && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - - NBTTagList itemList = new NBTTagList(); - for (int i = 0; i < inventory.length; i++) { - ItemStack stack = inventory[i]; - if (stack != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) i); - stack.writeToNBT(tag); - itemList.appendTag(tag); - } - } - tagCompound.setTag("Inventory", itemList); - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/311d0cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/311d0cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 29af418..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/311d0cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/319b7ce6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/319b7ce6c42100141fce95f06aba7e85 deleted file mode 100644 index 2e12ea9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/319b7ce6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/40d8b3f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/40d8b3f8c42100141fce95f06aba7e85 deleted file mode 100644 index 173c24f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/40d8b3f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/41f104ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/41f104ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7bcccd5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/41f104ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,169 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/60fa4201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/60fa4201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d6345aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/60fa4201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityVulture; -import projectzulu.common.mobs.models.ModelVulture; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/71e5dbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/71e5dbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7ddfdc5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/71e5dbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/906189e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/906189e5c42100141fce95f06aba7e85 deleted file mode 100644 index 688e868..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/906189e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBlackBear extends ModelBear { - - public ModelBlackBear() { - super(0); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.0f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/90d4f5f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/90d4f5f6c42100141fce95f06aba7e85 deleted file mode 100644 index b842e54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/90d4f5f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,22 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/9159c5f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/9159c5f7c42100141fce95f06aba7e85 deleted file mode 100644 index fcaf38a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/9159c5f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EntityCreeperBlossomPrimed extends Entity { - /** How long the fuse is */ - public int fuse; - - public EntityCreeperBlossomPrimed(World par1World) { - super(par1World); - this.fuse = 40; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; - } - - public EntityCreeperBlossomPrimed(World par1World, double par2, double par4, double par6) { - this(par1World); - this.setPosition(par2, par4, par6); - float var8 = (float) (Math.random() * Math.PI * 2.0D); - this.motionX = (double) (-((float) Math.sin((double) var8)) * 0.02F); - this.motionY = 0.20000000298023224D; - this.motionZ = (double) (-((float) Math.cos((double) var8)) * 0.02F); - this.fuse = 40; - this.prevPosX = par2; - this.prevPosY = par4; - this.prevPosZ = par6; - } - - @Override - protected void entityInit() { - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() { - return !this.isDead; - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.9800000190734863D; - this.motionY *= 0.9800000190734863D; - this.motionZ *= 0.9800000190734863D; - - if (this.onGround) { - this.motionX *= 0.699999988079071D; - this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - - if (this.fuse-- <= 0) { - this.setDead(); - - if (!this.worldObj.isRemote) { - this.explode(); - } - } else { - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - } - } - - private void explode() { - float var1 = 1.5F; - this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, var1, this.worldObj - .getGameRules().getGameRuleBooleanValue("mobGriefing")); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setByte("Fuse", (byte) this.fuse); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - this.fuse = par1NBTTagCompound.getByte("Fuse"); - } - - @SideOnly(Side.CLIENT) - @Override - public float getShadowSize() { - return 0.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/a01531a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/a01531a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b5a81ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/a01531a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/a0d7d000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/a0d7d000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b9c1fc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/a0d7d000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/c0ce3de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/c0ce3de4c42100141fce95f06aba7e85 deleted file mode 100644 index 2c03436..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/c0ce3de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/d0f210f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/d0f210f6c42100141fce95f06aba7e85 deleted file mode 100644 index f856262..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/d0f210f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityLimitedMobSpawnerRenderer extends TileEntitySpecialRenderer{ - public void renderTileEntityMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner, double xCoord, double yCoord, double zCoord, float par8){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)xCoord + 0.5F, (float)yCoord, (float)zCoord + 0.5F); - Entity var9 = limitedMobSpawner.getMobEntity(); - - if (var9 != null){ - var9.setWorld(limitedMobSpawner.getWorldObj()); - float var10 = 0.4375F; - GL11.glTranslatef(0.0F, 0.4F, 0.0F); - GL11.glRotatef((float)(limitedMobSpawner.yaw2 + (limitedMobSpawner.yaw - limitedMobSpawner.yaw2) * (double)par8) * 10.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.4F, 0.0F); - GL11.glScalef(var10, var10, var10); - var9.setLocationAndAngles(xCoord, yCoord, zCoord, 0.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, par8); - } - - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity par1TileEntity, double xCoord, double yCoord, double zCoord, float par8){ - this.renderTileEntityMobSpawner((TileEntityLimitedMobSpawner)par1TileEntity, xCoord, yCoord, zCoord, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/d1b16ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/d1b16ce5c42100141fce95f06aba7e85 deleted file mode 100644 index d892468..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/d1b16ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,84 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f2b693e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f2b693e4c42100141fce95f06aba7e85 deleted file mode 100644 index 8f0ac59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1b/f2b693e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraft.world.biome.BiomeGenBase; - -public class SpawnEntry { - public final BiomeGenBase biome; - public final int spawnRate; - public final int minInChunk; - public final int maxInChunk; - public SpawnEntry(BiomeGenBase biome, int spawnRate, int minInChunk, int maxInChunk) { - this.biome = biome; - this.spawnRate = spawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/1289fe9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/1289fe9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b4c94d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/1289fe9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/304a242bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/304a242bc52100141fce95f06aba7e85 deleted file mode 100644 index 598e853..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/304a242bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.blocks.itemblockdeclarations.StructurePlacerDeclaration; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_World extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.WorldModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new StructurePlacerDeclaration()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new PyramidFeature(), new LabyrinthFeature(), new CemetaryFeature(), - new OasisFeature(), new CathedralFeature()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/30ba241a4e20001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/30ba241a4e20001413909a661a93f408 deleted file mode 100644 index 4fc7bfd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/30ba241a4e20001413909a661a93f408 +++ /dev/null @@ -1,169 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a direction when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - //return par0EntityCreature.a((double) k, (double) l, (double) i1); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/50f48100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/50f48100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 24b9e76..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/50f48100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/708ed0f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/708ed0f5c42100141fce95f06aba7e85 deleted file mode 100644 index 66a9a21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/708ed0f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/715e41a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/715e41a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 999abc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/715e41a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAnkh; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/918dcdfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/918dcdfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0962a56..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/918dcdfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlueFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0e819f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0e819f5c42100141fce95f06aba7e85 deleted file mode 100644 index e4ece1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a0e819f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.entity.Render; - -/** - * Interface to hide ClientSide Render in objects on Server when Side.Client is insufficient i.e. abstract methods - */ -public interface RenderWrapper { - public Render getRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a24b2ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a24b2ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b352ddc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/a24b2ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelFoxHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFoxHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c099bd9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c099bd9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6400d8d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/c099bd9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelArmadilloHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADPIECE; - - public ModelArmadilloHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADPIECE.Ear2", 17, 0); - setTextureOffset("HEADPIECE.Ear1", 17, 0); - setTextureOffset("HEADPIECE.nose", 12, 9); - setTextureOffset("HEADPIECE.chin", 0, 8); - setTextureOffset("HEADPIECE.head", 0, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - HEADPIECE.setRotationPoint(0F, 0F, 2.5F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - HEADPIECE.addBox("Ear2", -4F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("Ear1", 2F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("nose", -0.5F, 1.5F, -7F, 1, 1, 2); - HEADPIECE.addBox("chin", -1.5F, -0.5F, -5.5F, 3, 3, 3); - HEADPIECE.addBox("head", -2.5F, -2.5F, -2.5F, 5, 5, 3); - CENTERROT.addChild(HEADPIECE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d14eb3fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d14eb3fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e9194ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/d14eb3fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e07abb00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e07abb00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cbb68ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e07abb00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e12578a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e12578a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f5aaff6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e12578a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.item.ItemSlab; -import net.minecraft.item.ItemStack; - -public class ItemZuluSlab extends ItemSlab { - - private static BlockSlab halfBlock; - private static BlockSlab doubleSlab; - private final boolean isFullBlock; - - /** - * Setup the half/double Slab instances required by ItemSlab This is a workaround as Forge does not allow Blocks to - * registered with an instance of an itemClass but an Item.class which only allow itemID constructor - */ - public static void initialise(BlockSlab halfBlock, BlockSlab doubleSlab) { - ItemZuluSlab.halfBlock = halfBlock; - ItemZuluSlab.doubleSlab = doubleSlab; - } - - public ItemZuluSlab(Block block) { - super(block, (BlockSlab) halfBlock, (BlockSlab) doubleSlab, block == doubleSlab); - isFullBlock = block == doubleSlab; - } - - /** - * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have - * different names based on their damage or NBT. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) { - return isFullBlock ? doubleSlab.func_150002_b(par1ItemStack.getItemDamage()) : super - .getUnlocalizedName(par1ItemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e1fddd9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e1fddd9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3f5b6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/e1fddd9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,167 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/f15b39f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/f15b39f9c42100141fce95f06aba7e85 deleted file mode 100644 index d47ccae..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/f15b39f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/107025f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/107025f7c42100141fce95f06aba7e85 deleted file mode 100644 index c98b349..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/107025f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20a1c89ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20a1c89ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7ef83f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20a1c89ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,149 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20a65f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20a65f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1d5ba35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20a65f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,172 +0,0 @@ -package projectzulu.common.core; - -import java.util.EnumSet; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; - -public class RenderHelper { - - public static enum Surface { - TOP(0), BOTTOM(1), - - /* +x is RIGHT */ - RIGHT(2), LEFT(3), - - /* +z is FRONT */ - FRONT(4), BACK(5); - public final int index; - - Surface(int index) { - this.index = index; - } - } - - public static boolean renderRotated2D(IIcon icon, float iconScale, RenderBlocks renderer, double posX, double posY, - double posZ, double xWidth, double yHeight, double angle) { - - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double minU = icon.getMinU(); - double maxU = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / iconScale; - double minV = icon.getMinV(); - double maxV = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / iconScale; - - double yMin = posY; - - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, maxU, minV); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle) { - renderRotatedRectangle(icon, iconScale, renderer, posX, posY, posZ, xWidth, yHeight, zWidth, angle, - EnumSet.allOf(Surface.class)); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle, - EnumSet sidesToDraw) { - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double deltaU = icon.getMaxU() - icon.getMinU(); - double deltaV = icon.getMaxV() - icon.getMinV(); - double minU = icon.getMinU() + deltaU / 2 * (1 - 1 / iconScale); - double maxU = icon.getMaxU() - deltaU / 2 * (1 - 1 / iconScale); - double minV = icon.getMinV() + deltaV / 2 * (1 - 1 / iconScale); - double maxV = icon.getMaxV() - deltaV / 2 * (1 - 1 / iconScale); - - double yMin = posY; - - double intermedVarZ = -zWidth / 2; - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = -zWidth / 2; - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = -xWidth / 2; - double point3X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point3Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = +xWidth / 2; - double point4X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point4Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - for (Surface surface : sidesToDraw) { - switch (surface) { - case RIGHT: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case LEFT: - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - break; - case BACK: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case FRONT: - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - break; - case TOP: - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - break; - case BOTTOM: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - } - - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20ad32fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20ad32fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2ce966d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/20ad32fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3002e0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3002e0e4c42100141fce95f06aba7e85 deleted file mode 100644 index e5bc1b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/3002e0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/40621e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/40621e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 670fdc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/40621e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/414244e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/414244e5c42100141fce95f06aba7e85 deleted file mode 100644 index 189c642..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/414244e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/50c8b200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/50c8b200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5fd2b60..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/50c8b200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,340 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.Properties; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/80a070fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/80a070fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e02cee7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/80a070fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/80dba41acbab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/80dba41acbab00141ee9bf3050c1025b new file mode 100644 index 0000000..f87537d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/80dba41acbab00141ee9bf3050c1025b @@ -0,0 +1,297 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(101); + + if (stickDrop <= stickSpawnRate) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(101) <= bugReleaseRate) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/a07353f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/a07353f9c42100141fce95f06aba7e85 deleted file mode 100644 index 75f0880..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/a07353f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,165 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/a18f8af6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/a18f8af6c42100141fce95f06aba7e85 deleted file mode 100644 index a3375b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/a18f8af6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.core; - -/** - * For usage see: {@link Pair} - */ -public class PairDirectoryFile { - private final K directory; - private final V file; - - public static PairDirectoryFile createPair(K directory, V file) { - return new PairDirectoryFile(directory, file); - } - - public PairDirectoryFile(K directory, V file) { - this.file = file; - this.directory = directory; - } - - public K getDirectory() { - return directory; - } - - public V getFile() { - return file; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairDirectoryFile)) { return false; } - PairDirectoryFile pair = (PairDirectoryFile)object; - return directory.equals(pair.directory) && file.equals(pair.file); - } - - @Override - public int hashCode(){ - return 7 * directory.hashCode() + 13 * file.hashCode(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/d14245f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/d14245f9c42100141fce95f06aba7e85 deleted file mode 100644 index f856262..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/d14245f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityLimitedMobSpawnerRenderer extends TileEntitySpecialRenderer{ - public void renderTileEntityMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner, double xCoord, double yCoord, double zCoord, float par8){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)xCoord + 0.5F, (float)yCoord, (float)zCoord + 0.5F); - Entity var9 = limitedMobSpawner.getMobEntity(); - - if (var9 != null){ - var9.setWorld(limitedMobSpawner.getWorldObj()); - float var10 = 0.4375F; - GL11.glTranslatef(0.0F, 0.4F, 0.0F); - GL11.glRotatef((float)(limitedMobSpawner.yaw2 + (limitedMobSpawner.yaw - limitedMobSpawner.yaw2) * (double)par8) * 10.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.4F, 0.0F); - GL11.glScalef(var10, var10, var10); - var9.setLocationAndAngles(xCoord, yCoord, zCoord, 0.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, par8); - } - - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity par1TileEntity, double xCoord, double yCoord, double zCoord, float par8){ - this.renderTileEntityMobSpawner((TileEntityLimitedMobSpawner)par1TileEntity, xCoord, yCoord, zCoord, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/e1df6df6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/e1df6df6c42100141fce95f06aba7e85 deleted file mode 100644 index 88fff06..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/e1df6df6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; - -import org.lwjgl.util.Point; - -public interface DataFields { - - public abstract boolean isEnabled(); - - public abstract void setIsEnabled(boolean isEnabled); - - public abstract DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize); - - public abstract void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID); - - public abstract void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner); - - public abstract boolean keyboardInput(char keyChar, int keyID); - - public abstract void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3); - - public abstract void mouseHover(int par1, int par2, int par3); - - public abstract void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/f0e3c4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/f0e3c4e5c42100141fce95f06aba7e85 deleted file mode 100644 index d1e94ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1d/f0e3c4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandSingle extends BlockBrewingStandBase { - - public BlockBrewingStandSingle(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new TileEntityBrewingSingle(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/0062faf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/0062faf9c42100141fce95f06aba7e85 deleted file mode 100644 index 77cb221..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/0062faf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.spike.BlockSpikes; -import com.ngb.projectzulu.common.blocks.spike.RenderSpike; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00c4f92acbab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00c4f92acbab00141ee9bf3050c1025b new file mode 100644 index 0000000..9e6fe7c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/00c4f92acbab00141ee9bf3050c1025b @@ -0,0 +1,122 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate; + private int stickSpawnRate; + + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void preInit(FMLPreInitializationEvent event, File configDirectory) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + //displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + config.save(); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/30717500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/30717500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e02cee7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/30717500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/320ee9f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/320ee9f7c42100141fce95f06aba7e85 deleted file mode 100644 index 516e241..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/320ee9f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.Random; - -import com.ngb.projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/603071f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/603071f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2e2bcf6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/603071f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityMammoth; -import com.ngb.projectzulu.common.mobs.models.ModelMammoth; -import com.ngb.projectzulu.common.mobs.renders.RenderMammoth; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/716deffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/716deffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 061b5c8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/716deffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import projectzulu.common.mobs.models.ModelTreeEnt; -import projectzulu.common.mobs.renders.RenderSnow; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/80bca0a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/80bca0a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8d64f28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/80bca0a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.util; - -import com.google.common.base.CharMatcher; - -public class StringHelper { - - public static String simplifyStringNameForDisplay(String string, int characterLimit, String splitString){ - /* Remove Surpluous Creature Data (ProjectZulu.Armadillo) */ - String[] stringParts = string.split(splitString); - String displayName; - /* Shorten Name to Declared Number of Character */ - if(stringParts.length > 0){ - displayName = stringParts[stringParts.length-1]; - }else{ - displayName = string; - } - - if(displayName.length() > characterLimit){ - displayName = displayName.substring(0, characterLimit); - } - return displayName; - } - - public static String toTitleCase(String string){ - return string.toUpperCase().replace(string.toUpperCase().substring(1), string.substring(1).toLowerCase()); - } - - public static int parseInteger(String integer, String regexRetain){ - return Integer.parseInt(CharMatcher.anyOf(regexRetain).retainFrom(integer)); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/80ef5ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/80ef5ce4c42100141fce95f06aba7e85 deleted file mode 100644 index cdb30bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/80ef5ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/82ad6a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/82ad6a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 36bfbe4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/82ad6a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.entity.Render; - -/** - * Interface to hide ClientSide Render in objects on Server when Side.Client is insufficient i.e. abstract methods - */ -public interface RenderWrapper { - public Render getRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/a0075da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/a0075da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7ef83f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/a0075da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,149 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b00ef800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b00ef800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 396f1cf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b00ef800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.command.IEntitySelector; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAINearestAttackableTarget extends EntityAITarget{ - EntityLivingBase targetEntity; - Class targetClass; - int targetChance; - private final IEntitySelector entitySelector; - EnumSet setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b09a40ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b09a40ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index bddd977..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b09a40ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityHauntedArmor; - -public class HauntedArmorWithMeta extends BlockWithMeta { - - public HauntedArmorWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityHauntedArmor mob = new EntityHauntedArmor(world, position.posX + 0.5, position.posY, - position.posZ + 0.5, true); - mob.onSpawnWithEgg(null); - mob.setPersistenceRequired(true); - world.spawnEntityInWorld(mob); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b0f5ade4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b0f5ade4c42100141fce95f06aba7e85 deleted file mode 100644 index 9322eca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/b0f5ade4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; - -public interface PZPacket { - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to encode into - */ - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to decode from - */ - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); - - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/c1fd36ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/c1fd36ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 53a4c86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/c1fd36ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e1cba0f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e1cba0f5c42100141fce95f06aba7e85 deleted file mode 100644 index 147335c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e1cba0f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e2eacc01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e2eacc01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 36a64df..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/e2eacc01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f047709ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f047709ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0b2adff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1e/f047709ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,26 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; - -import org.lwjgl.util.Point; - -public interface DataFields { - - public abstract boolean isEnabled(); - - public abstract void setIsEnabled(boolean isEnabled); - - public abstract DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize); - - public abstract void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID); - - public abstract void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner); - - public abstract boolean keyboardInput(char keyChar, int keyID); - - public abstract void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3); - - public abstract void mouseHover(int par1, int par2, int par3); - - public abstract void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/10dfbde5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/10dfbde5c42100141fce95f06aba7e85 deleted file mode 100644 index 9924c4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/10dfbde5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,12 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.util.ResourceLocation; - -public class RenderMimic extends RenderGenericLiving { - public static final ResourceLocation normalChest = new ResourceLocation("textures/entity/chest/normal.png"); - - public RenderMimic(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/10e360a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/10e360a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f24f6e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/10e360a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,24 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/11a7f5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/11a7f5f9c42100141fce95f06aba7e85 deleted file mode 100644 index b035bff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/11a7f5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.ItemUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/3012a2703620001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/3012a2703620001413909a661a93f408 deleted file mode 100644 index cd474d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/3012a2703620001413909a661a93f408 +++ /dev/null @@ -1,36 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void preinit(FMLPreInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone }); - - GameRegistry.addRecipe(new ItemStack(Items.dye, 2, 15), new Object[]{ - "AB ", - "AAC", - "A ", - 'A', Blocks.cobblestone, 'B', Blocks.dirt, 'C', new ItemStack(Items.dye, 1, 1) - }); - - GameRegistry.addRecipe(new ItemStack(Item.diamond, 2), new Object[] { - "DDD", "DDD", "DDD", 'D', Blocks.dirt }); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/306b1ef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/306b1ef7c42100141fce95f06aba7e85 deleted file mode 100644 index babf4e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/306b1ef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockJasper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/31702a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/31702a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 22fcd19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/31702a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPenguin; -import projectzulu.common.mobs.models.ModelPenguin; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PenguinDeclaration extends SpawnableDeclaration { - - public PenguinDeclaration() { - super("Penguin", 14, EntityPenguin.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (22 << 16) + (16 << 8) + 13; - eggColor2 = (235 << 16) + (235 << 8) + 235; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/5068dbf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/5068dbf9c42100141fce95f06aba7e85 deleted file mode 100644 index 415f794..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/5068dbf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/52d44aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/52d44aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e5acb66..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/52d44aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutShell; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/718684f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/718684f4c42100141fce95f06aba7e85 deleted file mode 100644 index 4c53fae..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/718684f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCarved; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericEdge; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; -import com.ngb.projectzulu.common.world2.blueprints.BPScatteredTombstonesAndFlowers; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemetaryEdge; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemetaryFountain; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemetaryFountain2; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemeteryTomb; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemeteryTomb2; - -public class ArchitectCemetary extends ArchitectBase { - BlueprintSet edge = new BPSetGenericEdge(new BlueprintCemetaryEdge()); - - public ArchitectCemetary(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPScatteredTombstonesAndFlowers())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb2(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemetaryFountain(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintCemetaryFountain2())); - stockpile.addBlueprintSet(edge); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/719a33fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/719a33fac42100141fce95f06aba7e85 deleted file mode 100644 index 2d984a6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/719a33fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,201 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/810f379ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/810f379ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d222aa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/810f379ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityUniversalFlowerPotRenderer extends TileEntitySpecialRenderer { - private RenderBlocks blockRenderer = new RenderBlocks(); - private RenderItem itemRenderer = new RenderItem(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - - renderTileEntityUniversalFlowerPotAt((TileEntityUniversalFlowerPot) tileEntity, xRenderCoord, yRenderCoord, - zRenderCoord, var8); - } - - private void renderTileEntityUniversalFlowerPotAt(TileEntityUniversalFlowerPot tileEntity, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float var8) { - - ItemStack itemStackToRender = tileEntity.getStackInSlot(0); - - if (itemStackToRender != null) { - Item itemToRender = itemStackToRender.getItem(); - - /* Try to See if I should render as Block */ - if (itemToRender != null && itemToRender instanceof ItemBlock - && Block.getBlockFromItem(itemToRender).getRenderType() != -1) { - Block blockToRender = Block.getBlockFromItem(itemToRender); - int meta = itemStackToRender.getItemDamage() > 16 ? 16 : itemStackToRender.getItemDamage() < 0 ? 0 - : itemStackToRender.getItemDamage(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glPushMatrix(); - float scaleBlock = (float) (0.29f / (blockToRender.getBlockBoundsMaxX() - blockToRender - .getBlockBoundsMinX())); - float scaleY = (float) (scaleBlock * (blockToRender.getBlockBoundsMaxY() - blockToRender - .getBlockBoundsMinY())); - - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.2 + scaleY), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleBlock, scaleBlock, scaleBlock); - - float brightness = 15f; - this.blockRenderer.renderBlockAsItem(blockToRender, meta, brightness); - GL11.glPopMatrix(); - return; - } - - /* Finally, try to render as Item */ - if (itemToRender != null) { - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(tileEntity.getWorldObj(), xRenderCoord, yRenderCoord, - zRenderCoord, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 0.6f; - GL11.glPushMatrix(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - - } - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/9109ebe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/9109ebe5c42100141fce95f06aba7e85 deleted file mode 100644 index 60edb43..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/9109ebe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/927ccc9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/927ccc9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a91b1ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/927ccc9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthRandomWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if ((piecePos.posY == 0)) {// || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b0d91cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b0d91cf6c42100141fce95f06aba7e85 deleted file mode 100644 index 7fc1e9a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b0d91cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,206 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b1011500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b1011500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d749173..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b1011500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,111 +0,0 @@ -//package com.ngb.projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import projectzulu.common.core.packets.PacketPlaySound; -//import projectzulu.common.core.packets.PacketStreamSound; -//import projectzulu.common.dungeon.packets.PacketMobSpawner; -//import projectzulu.common.mobs.packets.PacketAnimTime; -//import projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b16b47e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b16b47e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2892f7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/b16b47e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLeaves; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/c1f8b69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/c1f8b69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a806422..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1f/c1f8b69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/01bf1cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/01bf1cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f0531d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/01bf1cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20148fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20148fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f68843a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/20148fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/317f4900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/317f4900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a9428c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/317f4900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/405ba8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/405ba8e5c42100141fce95f06aba7e85 deleted file mode 100644 index 1b566a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/405ba8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,872 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/408015f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/408015f9c42100141fce95f06aba7e85 deleted file mode 100644 index 66a9a21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/408015f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/40ce899fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/40ce899fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5dd694e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/40ce899fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionBlindness; -import projectzulu.common.potion.subitem.SubItemPotionBubbling; -import projectzulu.common.potion.subitem.SubItemPotionCleansing; -import projectzulu.common.potion.subitem.SubItemPotionCurse; -import projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import projectzulu.common.potion.subitem.SubItemPotionJump; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionResistance; -import projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import projectzulu.common.potion.subitem.SubItemPotionThorns; -import projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/50f2152bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/50f2152bc52100141fce95f06aba7e85 deleted file mode 100644 index 2c9fc76..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/50f2152bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package projectzulu.common; - -import projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607606f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607606f7c42100141fce95f06aba7e85 deleted file mode 100644 index 659a906..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/607606f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemStructurePlacer; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/813c64f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/813c64f9c42100141fce95f06aba7e85 deleted file mode 100644 index 6738c99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/813c64f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/905dc900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/905dc900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f8d0f0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/905dc900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/c17abafec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/c17abafec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 93c0b8f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/c17abafec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e169499fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e169499fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e07ef90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e169499fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,213 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e1949be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e1949be6c42100141fce95f06aba7e85 deleted file mode 100644 index 50108b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/e1949be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,5 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -public interface BuildingManager { - public abstract void generate(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/f033f67d8d2100141bd6a937048980ed b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/f033f67d8d2100141bd6a937048980ed deleted file mode 100644 index c390774..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/f033f67d8d2100141bd6a937048980ed +++ /dev/null @@ -1,235 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - //worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), tempE.posZ), - //worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ) - - Vec3.createVectorHelper((double)tempE.posX, (double) tempE.posY + tempE.getEyeHeight(),(double) tempE.posZ), - Vec3.createVectorHelper((double)this.posX, (double) this.posY,(double) this.posZ) - ) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/f049e0022924001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/f049e0022924001415179d45b0e27e9a deleted file mode 100644 index 68c26a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2/f049e0022924001415179d45b0e27e9a +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString(event.source.getSourceOfDamage().toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/1002a6dd2d24001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/1002a6dd2d24001415179d45b0e27e9a deleted file mode 100644 index 0e4a7f6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/1002a6dd2d24001415179d45b0e27e9a +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString(player + " slain by " event.source.getSourceOfDamage().getCommandSenderName()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/10042bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/10042bf9c42100141fce95f06aba7e85 deleted file mode 100644 index 7fa0113..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/10042bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,119 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isRideable() function - */ -public abstract class EntityGenericRideable extends EntityGenericBreedable{ - - public EntityGenericRideable(World par1World) { - super(par1World); - } - /* Toggles Whether the Child Class can be Ridden and used methods in this Class - * i.e. If false, will not be able to be saddled/mounted */ - public boolean isRideable(){ - return false; - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handles Whether the Entity Is Saddled */ - this.dataWatcher.addObject(21, Byte.valueOf((byte)0)); - } - - /** - * Returns true if the Entity is saddled. - */ - public boolean getSaddled() { - return (this.dataWatcher.getWatchableObjectByte(21) & 1) != 0; - } - - /** - * Set or remove the saddle of the Entity. - */ - public void setSaddled(boolean par1) { - if (par1) { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)1)); - } - else { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)0)); - } - } - - /** - * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden - * by a player and the player is holding a carrot-on-a-stick - */ - @Override - public boolean canBeSteered() { - ItemStack var1 = ((EntityPlayer) this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem().equals(Items.stick); - } - - /** - * Checks if Item should Cause the Horse to Continue Moving in the Direction it was already going - */ - public boolean shouldIgnorePlayerRot(){ - if(riddenByEntity != null && riddenByEntity instanceof EntityPlayer){ - ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem() != Items.stick; - } - return false; - } - - /** - * Sets the Player Rotation to Face the Direction of the Entity - */ - @Override - public boolean shouldRiderFaceForward(EntityPlayer player) { - return true; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - if (super.interact(par1EntityPlayer)) { - return true; - } - - if(isRideable()){ - /* If Saddled Get on/off Entity */ - if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { - par1EntityPlayer.mountEntity(this); - return true; - - /* If Not Saddled: Try to Saddle Entity */ - }else if(!getSaddled() && par1EntityPlayer.inventory.getCurrentItem() != null - && par1EntityPlayer.inventory.getCurrentItem().getItem() == Items.saddle ){ - setSaddled(true); - return true; - } - } - return false; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/116dcefdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/116dcefdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 764b8e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/116dcefdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockAloeVera; -import projectzulu.common.blocks.ItemAloeVera; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/2055716cc82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/2055716cc82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ccfd9a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/2055716cc82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityGenericAnimal theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityGenericAnimal par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/20cb2dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/20cb2dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2482ca1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/20cb2dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/30fd48e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/30fd48e5c42100141fce95f06aba7e85 deleted file mode 100644 index 798743e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/30fd48e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/31a772ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/31a772ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ba47be3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/31a772ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisPool implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta water = new BlockWithMeta(Blocks.water); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return water; - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisPool"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/405524fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/405524fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b17f47f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/405524fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/413cc0fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/413cc0fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54598fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/413cc0fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5018a7f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5018a7f6c42100141fce95f06aba7e85 deleted file mode 100644 index be1b215..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/5018a7f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import net.minecraft.util.Vec3; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - // player.posY + player.getEyeHeight(), player.posZ), - Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), - // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - // entity.posZ) - Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) - ) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/519fafa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/519fafa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cc7e747..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/519fafa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,66 +0,0 @@ -package projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/60ddde9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/60ddde9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e708c5e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/60ddde9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/7010cdf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/7010cdf9c42100141fce95f06aba7e85 deleted file mode 100644 index ac1f061..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/7010cdf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityUniversalFlowerPotRenderer extends TileEntitySpecialRenderer { - private RenderBlocks blockRenderer = new RenderBlocks(); - private RenderItem itemRenderer = new RenderItem(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - - renderTileEntityUniversalFlowerPotAt((TileEntityUniversalFlowerPot) tileEntity, xRenderCoord, yRenderCoord, - zRenderCoord, var8); - } - - private void renderTileEntityUniversalFlowerPotAt(TileEntityUniversalFlowerPot tileEntity, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float var8) { - - ItemStack itemStackToRender = tileEntity.getStackInSlot(0); - - if (itemStackToRender != null) { - Item itemToRender = itemStackToRender.getItem(); - - /* Try to See if I should render as Block */ - if (itemToRender != null && itemToRender instanceof ItemBlock - && Block.getBlockFromItem(itemToRender).getRenderType() != -1) { - Block blockToRender = Block.getBlockFromItem(itemToRender); - int meta = itemStackToRender.getItemDamage() > 16 ? 16 : itemStackToRender.getItemDamage() < 0 ? 0 - : itemStackToRender.getItemDamage(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glPushMatrix(); - float scaleBlock = (float) (0.29f / (blockToRender.getBlockBoundsMaxX() - blockToRender - .getBlockBoundsMinX())); - float scaleY = (float) (scaleBlock * (blockToRender.getBlockBoundsMaxY() - blockToRender - .getBlockBoundsMinY())); - - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.2 + scaleY), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleBlock, scaleBlock, scaleBlock); - - float brightness = 15f; - this.blockRenderer.renderBlockAsItem(blockToRender, meta, brightness); - GL11.glPopMatrix(); - return; - } - - /* Finally, try to render as Item */ - if (itemToRender != null) { - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(tileEntity.getWorldObj(), xRenderCoord, yRenderCoord, - zRenderCoord, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 0.6f; - GL11.glPushMatrix(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - - } - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/7120fbe3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/7120fbe3c42100141fce95f06aba7e85 deleted file mode 100644 index 1dde782..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/7120fbe3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/917900fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/917900fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3042648..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/917900fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/a261c6fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/a261c6fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6b1cbf0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/a261c6fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCrocodile; -import projectzulu.common.mobs.models.ModelCrocodile; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/b0293effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/b0293effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 969d594..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/b0293effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/b0fc239ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/b0fc239ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5a1797e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/b0fc239ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,297 +0,0 @@ -package projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/c03f40e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/c03f40e4c42100141fce95f06aba7e85 deleted file mode 100644 index 12f3177..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/20/c03f40e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.brewingstands.PotionIngredients; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GenericCraftingItemsDeclaration extends ItemDeclaration { - - public GenericCraftingItemsDeclaration() { - super("GenericCraftingItems1"); - } - - @Override - protected boolean createItem() { - ItemGenerics itemGenerics = (ItemGenerics) new ItemGenerics(); - ItemList.genericCraftingItems = Optional.of(itemGenerics); - PotionIngredients.addIngredientProperties(itemGenerics, itemGenerics); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.genericCraftingItems.get(); - OreDictionary.registerOre("foodSalt", new ItemStack(item, 1, ItemGenerics.Properties.Salt.meta())); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/10914aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/10914aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1ccc1d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/10914aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityLimitedMobSpawnerRenderer extends TileEntitySpecialRenderer{ - public void renderTileEntityMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner, double xCoord, double yCoord, double zCoord, float par8){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)xCoord + 0.5F, (float)yCoord, (float)zCoord + 0.5F); - Entity var9 = limitedMobSpawner.getMobEntity(); - - if (var9 != null){ - var9.setWorld(limitedMobSpawner.getWorldObj()); - float var10 = 0.4375F; - GL11.glTranslatef(0.0F, 0.4F, 0.0F); - GL11.glRotatef((float)(limitedMobSpawner.yaw2 + (limitedMobSpawner.yaw - limitedMobSpawner.yaw2) * (double)par8) * 10.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.4F, 0.0F); - GL11.glScalef(var10, var10, var10); - var9.setLocationAndAngles(xCoord, yCoord, zCoord, 0.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, par8); - } - - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity par1TileEntity, double xCoord, double yCoord, double zCoord, float par8){ - this.renderTileEntityMobSpawner((TileEntityLimitedMobSpawner)par1TileEntity, xCoord, yCoord, zCoord, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/10b141f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/10b141f4c42100141fce95f06aba7e85 deleted file mode 100644 index 7ed8f40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/10b141f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomPoint extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomPoint() { - super(false); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ > 0 || random.nextInt(3) == 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randompoint"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/21f9f1f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/21f9f1f5c42100141fce95f06aba7e85 deleted file mode 100644 index 0d1d5f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/21f9f1f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,217 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; - -public abstract class EntityGenericCreature extends EntityAerial { - private PathEntity pathToEntity; - - public boolean hasPath() { - return this.pathToEntity != null; - } - - /** The Entity this EntityCreature is set to attack. */ - protected Entity entityToAttack; - - public Entity getEntityToAttack() { - return this.entityToAttack; - } - - public void setTarget(Entity par1Entity) { - this.entityToAttack = par1Entity; - } - - private float maximumHomeDistance = -1.0F; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); - private boolean field_110180_bt; - // Cooldown instituted on the entity when it attempts to find a path but fails. - private int leashPathCooldown = 0; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0f); - - /** - * returns true if a creature has attacked recently only used for creepers and skeletons - */ - /* Do I need this? */ - // protected boolean hasAttacked = false; - - /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick = 0; - - public int getFleeTick() { - return fleeingTick; - } - - public void setFleeTick(int fleeingTick) { - this.fleeingTick = fleeingTick; - } - - /* Entity State Variables */ - protected int animTime = 0; - - public int getAnimTime() { - return animTime; - } - - public void setAnimTime(int animTime) { - this.animTime = animTime; - } - - protected int angerLevel = 0; - - public int getAngerLevel() { - return angerLevel; - } - - public void setAngerLevel(int angerLevel) { - this.angerLevel = angerLevel; - } - - protected EntityStates entityState = EntityStates.idle; - - public EntityStates getEntityState() { - return entityState; - } - - public EntityGenericCreature(World par1World) { - super(par1World); - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - attackTime = Math.max(attackTime - 1, 0); - fleeingTick = Math.max(fleeingTick - 1, 0); - angerLevel = Math.max(angerLevel - 1, 0); - } - - @Override - public void onUpdate() { - super.onUpdate(); - leashPathCooldown = Math.max(leashPathCooldown - 1, 0); - } - - @Override - protected void updateLeashedState() { - super.updateLeashedState(); - - if (this.getLeashed() && this.getLeashedToEntity() != null - && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity entity = this.getLeashedToEntity(); - this.setHomeArea((int) entity.posX, (int) entity.posY, (int) entity.posZ, 5); - float f = this.getDistanceToEntity(entity); - - if (this instanceof EntityGenericTameable && ((EntityGenericTameable) this).isSitting()) { - if (f > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/41a6ef9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/41a6ef9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 84d336c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/41a6ef9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/62efcce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/62efcce4c42100141fce95f06aba7e85 deleted file mode 100644 index 255c580..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/62efcce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/71f2d1f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/71f2d1f9c42100141fce95f06aba7e85 deleted file mode 100644 index 207994b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/71f2d1f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/81a507fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/81a507fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 36f8937..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/81a507fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/92e150e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/92e150e4c42100141fce95f06aba7e85 deleted file mode 100644 index a09c2b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/92e150e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/a0715e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/a0715e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index da1dc51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/a0715e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/a19ce5e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/a19ce5e3c42100141fce95f06aba7e85 deleted file mode 100644 index ce0ed20..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/a19ce5e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/b1b3b7f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/b1b3b7f9c42100141fce95f06aba7e85 deleted file mode 100644 index 239891b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/b1b3b7f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/c0be84a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/c0be84a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5311cea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/c0be84a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/d09ae79ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/d09ae79ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5938363..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/d09ae79ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/d0bfb5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/d0bfb5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 148721b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/d0bfb5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/f133fdffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/f133fdffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f05fd75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/21/f133fdffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/0021fcf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/0021fcf7c42100141fce95f06aba7e85 deleted file mode 100644 index 7ed8f40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/0021fcf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomPoint extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomPoint() { - super(false); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ > 0 || random.nextInt(3) == 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randompoint"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/005957b2322000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/005957b2322000141dbfc2e92eb0e949 deleted file mode 100644 index f109216..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/005957b2322000141dbfc2e92eb0e949 +++ /dev/null @@ -1,26 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void preinit(FMLPreInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone }); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/00b505a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/00b505a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ba742e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/00b505a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/028b8ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/028b8ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 2551d05..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/028b8ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/1157369fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/1157369fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 688e868..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/1157369fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBlackBear extends ModelBear { - - public ModelBlackBear() { - super(0); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.0f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/11f05df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/11f05df8c42100141fce95f06aba7e85 deleted file mode 100644 index e05ad86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/11f05df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/213799fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/213799fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5344d24..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/213799fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,105 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/21b5959fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/21b5959fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4505454..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/21b5959fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,290 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.EntityPZPotion; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/308c46e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/308c46e5c42100141fce95f06aba7e85 deleted file mode 100644 index 54b37e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/308c46e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/31ff279fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/31ff279fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 68cee4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/31ff279fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMummy; -import projectzulu.common.mobs.models.ModelMummy; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/4067b1f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/4067b1f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6ab31fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/4067b1f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,190 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/6005799fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/6005799fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9cbf83c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/6005799fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class TileEntityBrewingStandRenderer extends TileEntitySpecialRenderer { - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - renderTileEntity((TileEntityBrewingBase) tileEntity, xRenderCoord, yRenderCoord, zRenderCoord, var8); - } - - private void renderTileEntity(TileEntityBrewingBase tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - RenderItem itemRenderer = new RenderItem(); - itemRenderer.setRenderManager(RenderManager.instance); - - ItemStack ingredientStack = tileEntity.brewingItemStacks[tileEntity.brewingItemStacks.length - 1]; - if (ingredientStack != null) { - if (ingredientStack.stackSize > 1) { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.28f); - } else { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.4f); - } - } - - float[] zOffsets = new float[] { 0, +0.29f, -0.29f }; - float[] rotation = new float[] { 90f, 0.0f, 0.0f }; - for (int i = 0; i < tileEntity.brewingItemStacks.length - 1; i++) { - ItemStack stackToRender = tileEntity.brewingItemStacks[i]; - if (stackToRender == null) { - continue; - } - renderItemStack(stackToRender, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord - 0.25D, - zRenderCoord + zOffsets[i], rotation[i], 0.6f); - } - } - - private void renderItemStack(ItemStack stackToRender, RenderItem renderer, World world, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float rotation, float scale) { - EntityItem entityItemToRender = new EntityItem(world, xRenderCoord, yRenderCoord, zRenderCoord, stackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = scale; - GL11.glPushMatrix(); - bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); - renderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/70fa21a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/70fa21a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f68851..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/70fa21a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/800aa09ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/800aa09ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b5a81ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/800aa09ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/813c51ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/813c51ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f733b4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/813c51ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c02dacffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c02dacffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 32ce0ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/c02dacffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/e1f573a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/e1f573a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 775491d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/e1f573a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.BPScatteredTombstonesAndFlowers; -import projectzulu.common.world2.blueprints.BlueprintCemetaryEdge; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain2; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb2; - -public class ArchitectCemetary extends ArchitectBase { - BlueprintSet edge = new BPSetGenericEdge(new BlueprintCemetaryEdge()); - - public ArchitectCemetary(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPScatteredTombstonesAndFlowers())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb2(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemetaryFountain(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintCemetaryFountain2())); - stockpile.addBlueprintSet(edge); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/f02469f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/f02469f6c42100141fce95f06aba7e85 deleted file mode 100644 index 7dfc7fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/f02469f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; - -import org.lwjgl.util.Point; - -public class GuiSaveableTextField extends GuiTextField { - - public GuiSaveableTextField(FontRenderer fontRenderer, int xPos, int yPos, int width, int height) { - super(fontRenderer, xPos, yPos, width, height); - } - - public GuiSaveableTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(maxTextChars); - } - - public GuiSaveableTextField(GuiSaveableTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setText(oldTextFields.getText()); - setupTextField(maxTextChars); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/f2c29cf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/f2c29cf7c42100141fce95f06aba7e85 deleted file mode 100644 index 1f01b41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/22/f2c29cf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import com.ngb.projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/30898e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/30898e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b67eb8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/30898e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionBlindness extends SubItemPotionGeneric { - - public SubItemPotionBlindness(Item itemID, int subID) { - super(itemID, subID, "potion.blindness"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 2, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.blindness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/30de59a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/30de59a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 514a919..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/30de59a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,473 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.io.ByteArrayOutputStream; -//import java.io.DataInputStream; -//import java.io.DataOutputStream; -//import java.io.IOException; -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.entity.EntityLiving; -//import net.minecraft.entity.EntityLivingBase; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.entity.player.EntityPlayerMP; -//import net.minecraft.nbt.NBTTagCompound; -//import net.minecraft.network.packet.Packet250CustomPayload; -//import net.minecraft.potion.Potion; -//import net.minecraft.potion.PotionEffect; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -//import cpw.mods.fml.common.network.PacketDispatcher; -//import cpw.mods.fml.common.network.Player; -// -//public class TemperatureTicker implements ITickHandler, IPlayerTracker{ -// -// /* Temperature Used When Changint Dimensions or Loading into a World for the First Time */ -// private static float defaultTemperature = 0; -// /* Player Tempurature, Used to Calculate Effects and Display */ -// private static float playerTemperature = 0; -// private static Map temperatureMap = new HashMap(); -// /* Last World the Player was in, Used to Determine if the player has Switched worlds or Just Loaded Minecraft */ -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// /* Used For Displaying the Environment Temperature around a player, used in DisplayTemperatureTicker to mark the Temp. the Player Trending Towards in */ -// private static Map playerLocTempMap = new HashMap(); -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private short DirtyFlag = 0; -// public TemperatureTicker(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( temperatureMap.containsKey( player.getEntityName() ) ){ -// playerTemperature = temperatureMap.get( player.getEntityName() ); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP ){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// /* Read From File */ -// if ( HasPendingRead() ){ -// readNBTFromFile(player); -// ClearPendingRead(); -// } -// } -// -// /* Get Outside Temperature */ -// float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// float unTouchedPlayerLocationTemperature; -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// unTouchedPlayerLocationTemperature = playerLocTempMap.get(player.getEntityName()); -// }else { -// unTouchedPlayerLocationTemperature = playerLocationTemperature; -// } -// float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -// playerLocationTemperature += item.getLocationTemperatureFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getPlayerTempContributionFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// if(currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 3)); -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 1)); -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Save Temperature To Map*/ -// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -// if(player instanceof EntityPlayerMP){ -// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -// DataOutputStream data = new DataOutputStream(bytes); -//// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -// -// /* Write PacketID into Packet */ -// try { -// data.writeInt(1); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// /* Write Temperature Into Packet*/ -// try { -// data.writeFloat(playerTemperature); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// -// Packet250CustomPayload packet = new Packet250CustomPayload(); -// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -// packet.data = bytes.toByteArray(); -// packet.length = packet.data.length; -// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -//// System.out.println( player.getEntityName().concat("Sent Packet ")); -// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// nbttagcompound.setFloat(player.getEntityName().concat("Player Temperature"), playerTemperature); -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// if (nbttagcompound.hasKey( player.getEntityName().concat("Player Temperature") )){ -// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("Player Temperature") ); -// } -// } -// -// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -// -// /* Get Relevent Data From DataStream */ -// float tempTemp = playerTemperature; -// try { -// tempTemp = data.readFloat(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// /* Make Sure Player Exists, then Assign data to map */ -// if(temperatureMap.containsKey(sender.getEntityName())){ -// temperatureMap.put(sender.getEntityName(), tempTemp); -// } -// -// -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -// temperatureMap.put(player.getEntityName(), 0.0f); -// lastWorldNameMap.put(player.getEntityName(), ""); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// } -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// setPlayerToDefaultTemp(player); -// } -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -// setPlayerToDefaultTemp(player); -// } -// -// public void setPlayerToDefaultTemp(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/416f75e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/416f75e6c42100141fce95f06aba7e85 deleted file mode 100644 index eb76021..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/416f75e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,202 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/514f77f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/514f77f9c42100141fce95f06aba7e85 deleted file mode 100644 index e0d278d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/514f77f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,93 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/60ec149fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/60ec149fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index da9b6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/60ec149fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFrog; -import projectzulu.common.mobs.models.ModelFrog; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/808c9ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/808c9ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e570fa0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/808c9ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,117 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY == cellHeight - 2) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (piecePos.posY % 2 == 1) { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - private boolean isCorner(ChunkCoordinates piecePos, int cellSize) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) - && (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1)) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "cemeterytomb2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/907aede5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/907aede5c42100141fce95f06aba7e85 deleted file mode 100644 index 4d82ea9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/907aede5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/9168ff9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/9168ff9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c90342c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/9168ff9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/91814cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/91814cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2d714be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/91814cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetDoorway; -import projectzulu.common.world2.blueprint.BPSetHallway; -import projectzulu.common.world2.blueprint.BPSetHallwaySpawner; -import projectzulu.common.world2.blueprint.BPSetPyramidEdge; -import projectzulu.common.world2.blueprint.BPSetStairs; -import projectzulu.common.world2.blueprint.BPSetTreasureDeadEnd; -import projectzulu.common.world2.blueprint.BPSetWall; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectPyramid extends ArchitectBase { - - public final BPSetStairs stairSet = new BPSetStairs(); - public final BPSetPyramidEdge edge = new BPSetPyramidEdge(); - public final BPSetDoorway door = new BPSetDoorway(); - - public ArchitectPyramid(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetWall()); - stockpile.addBlueprintSet(new BPSetTreasureDeadEnd()); - stockpile.addBlueprintSet(new BPSetHallway()); - stockpile.addBlueprintSet(new BPSetHallwaySpawner()); - stockpile.addBlueprintSet(stairSet); - stockpile.addBlueprintSet(edge); - stockpile.addBlueprintSet(door); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - /* If is Wall, use Wall Cell */ - BlueprintSet set; - if (door.isApplicable(cells, buildCoords, random)) { - set = door; - } else if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] bottomCells, MazeCell[][] topCells) { - for (int topX = 0; topX < topCells.length; topX++) { - for (int topZ = 0; topZ < topCells[0].length; topZ++) { - Point buildCoords = new Point(topX, topZ); - if (stairSet.attemptAssignBlueprint(bottomCells, topCells, buildCoords, random)) { - return; - } - } - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/a11693a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/a11693a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c6c5291..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/a11693a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,220 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEnd implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - return getWallBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall); - } else { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/b0004faa2d24001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/b0004faa2d24001415179d45b0e27e9a deleted file mode 100644 index 8327744..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/b0004faa2d24001415179d45b0e27e9a +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString(event.source.getSourceOfDamage().getCommandSenderName()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/b010f19ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/b010f19ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0e304de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/b010f19ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/d034cf01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/d034cf01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a2ea3da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/d034cf01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCathedral; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/e0413af5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/e0413af5c42100141fce95f06aba7e85 deleted file mode 100644 index b5a49a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/23/e0413af5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,326 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/002608a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/002608a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2aa1c81..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/002608a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.block.Block; - -import com.google.common.base.Optional; - -public enum BlockList { - instance; - public static Optional palmHoloTree = Optional.absent(); // Not Used? - - public static Optional aloeVera = Optional.absent(); - public static Optional wateredDirt = Optional.absent(); - public static Optional tumbleweed = Optional.absent(); - public static Optional jasper = Optional.absent(); - - public static Optional palmTreeLog = Optional.absent(); - public static Optional palmTreePlank = Optional.absent(); - public static Optional palmTreeSlab = Optional.absent(); - public static Optional palmTreeDoubleSlab = Optional.absent(); - public static Optional palmTreeStairs = Optional.absent(); - public static Optional palmTreeLeaves = Optional.absent(); - public static Optional palmTreeSapling = Optional.absent(); - public static Optional coconut = Optional.absent(); - - public static Optional nightBloom = Optional.absent(); - public static Optional creeperBlossom = Optional.absent(); - public static Optional quickSand = Optional.absent(); - - public static Optional spike = Optional.absent(); - public static Optional campfire = Optional.absent(); - public static Optional mobHeads = Optional.absent(); - public static Optional tombstone = Optional.absent(); - - public static Optional universalFlowerPot = Optional.absent(); - public static Optional customBrewingStand = Optional.absent(); - public static Optional limitedMobSpawner = Optional.absent(); - public static Optional brewingStandSingle = Optional.absent(); - public static Optional brewingStandTriple = Optional.absent(); - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/0074079ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/0074079ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b059077..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/0074079ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.BlockTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/0103059ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/0103059ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 56df7ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/0103059ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemStructurePlacer; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/20f9f1f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/20f9f1f5c42100141fce95f06aba7e85 deleted file mode 100644 index 7fa0113..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/20f9f1f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,119 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isRideable() function - */ -public abstract class EntityGenericRideable extends EntityGenericBreedable{ - - public EntityGenericRideable(World par1World) { - super(par1World); - } - /* Toggles Whether the Child Class can be Ridden and used methods in this Class - * i.e. If false, will not be able to be saddled/mounted */ - public boolean isRideable(){ - return false; - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handles Whether the Entity Is Saddled */ - this.dataWatcher.addObject(21, Byte.valueOf((byte)0)); - } - - /** - * Returns true if the Entity is saddled. - */ - public boolean getSaddled() { - return (this.dataWatcher.getWatchableObjectByte(21) & 1) != 0; - } - - /** - * Set or remove the saddle of the Entity. - */ - public void setSaddled(boolean par1) { - if (par1) { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)1)); - } - else { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)0)); - } - } - - /** - * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden - * by a player and the player is holding a carrot-on-a-stick - */ - @Override - public boolean canBeSteered() { - ItemStack var1 = ((EntityPlayer) this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem().equals(Items.stick); - } - - /** - * Checks if Item should Cause the Horse to Continue Moving in the Direction it was already going - */ - public boolean shouldIgnorePlayerRot(){ - if(riddenByEntity != null && riddenByEntity instanceof EntityPlayer){ - ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem() != Items.stick; - } - return false; - } - - /** - * Sets the Player Rotation to Face the Direction of the Entity - */ - @Override - public boolean shouldRiderFaceForward(EntityPlayer player) { - return true; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - if (super.interact(par1EntityPlayer)) { - return true; - } - - if(isRideable()){ - /* If Saddled Get on/off Entity */ - if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { - par1EntityPlayer.mountEntity(this); - return true; - - /* If Not Saddled: Try to Saddle Entity */ - }else if(!getSaddled() && par1EntityPlayer.inventory.getCurrentItem() != null - && par1EntityPlayer.inventory.getCurrentItem().getItem() == Items.saddle ){ - setSaddled(true); - return true; - } - } - return false; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/3083ef00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/3083ef00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3e0c3dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/3083ef00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,114 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/50b81afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/50b81afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e9228d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/50b81afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,132 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/61bfe39dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/61bfe39dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9536a7d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/61bfe39dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCoconut; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/6299f6fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/6299f6fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 857ce28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/6299f6fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,178 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/62a843a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/62a843a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d922708..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/62a843a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/70c00d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/70c00d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77f61c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/70c00d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBeaver; -import projectzulu.common.mobs.models.ModelBeaver; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BeaverDeclaration extends SpawnableDeclaration { - - public BeaverDeclaration() { - super("Beaver", 15, EntityBeaver.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (54 << 16) + (36 << 8) + 9; - eggColor2 = (67 << 16) + (45 << 8) + 11; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/8035f2e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/8035f2e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5734cca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/8035f2e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/81868c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/81868c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b6e8956..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/81868c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/90952cfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/90952cfac42100141fce95f06aba7e85 deleted file mode 100644 index 4ba4adc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/90952cfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelFoxHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFoxHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/a2bfe8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/a2bfe8e5c42100141fce95f06aba7e85 deleted file mode 100644 index db2dc74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/24/a2bfe8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/003d33f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/003d33f5c42100141fce95f06aba7e85 deleted file mode 100644 index 334db18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/003d33f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,173 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelRhino extends ModelBase { - float heightToRaise = 9f; - float renderScale = 1.6f; - - ModelRenderer LEG3ROT; - ModelRenderer LEG4ROT; - ModelRenderer LEG2ROT; - ModelRenderer HEADROT; - ModelRenderer LEG1ROT; - ModelRenderer TAILROT; - ModelRenderer BODYROT; - - public ModelRhino() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG3ROT.leg3", 48, 13); - setTextureOffset("LEG3ROT.toe31", 0, 0); - setTextureOffset("LEG3ROT.toe32", 0, 0); - setTextureOffset("LEG3ROT.toe33", 0, 0); - setTextureOffset("LEG4ROT.leg4", 68, 13); - setTextureOffset("LEG4ROT.toe41", 0, 0); - setTextureOffset("LEG4ROT.toe42", 0, 0); - setTextureOffset("LEG4ROT.toe43", 0, 0); - setTextureOffset("LEG2ROT.leg2", 68, 0); - setTextureOffset("LEG2ROT.toe21", 0, 0); - setTextureOffset("LEG2ROT.toe22", 0, 0); - setTextureOffset("LEG2ROT.toe23", 0, 0); - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - setTextureOffset("LEG1ROT.toe11", 0, 0); - setTextureOffset("LEG1ROT.toe12", 0, 0); - setTextureOffset("LEG1ROT.toe13", 0, 0); - setTextureOffset("LEG1ROT.leg1", 48, 0); - setTextureOffset("TAILROT.tail", 0, 25); - setTextureOffset("BODYROT.leg1dec", 20, 25); - setTextureOffset("BODYROT.leg2dec", 20, 25); - setTextureOffset("BODYROT.body", 0, 32); - - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG3ROT.addBox("toe31", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe32", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe33", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG4ROT.addBox("toe41", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe42", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe43", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(4F, 15F - heightToRaise, -5F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2.5F, 1F, -2.5F, 5, 8, 5); - LEG2ROT.addBox("toe21", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe22", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe23", 1.5F, 8F, -3.5F, 1, 1, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 9F - heightToRaise, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-4F, 15F - heightToRaise, -5F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("toe11", -2.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe12", -0.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe13", 1.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("leg1", -2.5F, 1F, -2F, 5, 8, 5); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 9F - heightToRaise, 12F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.5F, -0.5F, 0F, 1, 1, 6); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F - heightToRaise, -8F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("leg1dec", -7F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("leg2dec", 1F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("body", -7F, -7F, 0F, 14, 12, 20); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 6.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(renderScale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - GL11.glPopMatrix(); - } else { - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - HEADROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Constant Animation Rotations */ - LEG1ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - TAILROT.rotateAngleX = (float) (-90 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/009ac2e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/009ac2e5c42100141fce95f06aba7e85 deleted file mode 100644 index 2900eb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/009ac2e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/00b4fd00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/00b4fd00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 096cf98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/00b4fd00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/0104c101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/0104c101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 177b645..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/0104c101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,137 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.Blueprint; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BPSetCathedral implements BlueprintSet { - boolean isAssigned = false; - - Blueprint dome = new BPCathedralDome(); - Blueprint hallway = new BPCathedralHallway(); - Blueprint hallwayEnd = new BPCathedralHallwayEnd(); - Blueprint hallwayEnt = new BPCathedralHallwayEntrance(); - Blueprint entrance = new BPCathedralEntrance(); - Blueprint west_tower = new BPCathedralWestTower(); - Blueprint east_tower = new BPCathedralEastTower(); - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return !isAssigned; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.EastWall); - - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthWall); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 5, entrance.getIdentifier(),// entrance - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 5, entrance.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 5, west_tower.getIdentifier(), // west_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 5, west_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 6].getHeight()); - - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 5, east_tower.getIdentifier(), // east_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 5, east_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 6].getHeight()); - isAssigned = true; - return true; - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection) { - applyBlueprintToCell(cellList, xCell, zCell, subBuildingID, cellDirection, 0); - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection, int heightIncrease) { - cellList[xCell][zCell].setBuildingProperties(getIdentifier().concat("-").concat(subBuildingID), cellDirection); - cellList[xCell][zCell].rawState = -1; - cellList[xCell][zCell].setHeight(cellList[xCell][zCell].getHeight() + heightIncrease); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String childBuildingID = buildingID.split("-")[1]; - if (childBuildingID != null) { - if (childBuildingID.equals(dome.getIdentifier())) { - return dome.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallway.getIdentifier())) { - return hallway.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnd.getIdentifier())) { - return hallwayEnd.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnt.getIdentifier())) { - return hallwayEnt.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(entrance.getIdentifier())) { - return entrance.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(west_tower.getIdentifier())) { - return west_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(east_tower.getIdentifier())) { - return east_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - } - return null; - } - - @Override - public String getIdentifier() { - return "Cathedral"; - } - - @Override - public int getWeight() { - return 20; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/018b8ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/018b8ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 27a50c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/018b8ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZPotionTab extends CreativeTabs { - - public CreativePZPotionTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - public Item getTabIconItem() { - return Items.potionitem; - } - - @Override - public int func_151243_f() { - return 3; - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu Potions"; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/21cb2dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/21cb2dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 181b46d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/21cb2dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.potion.brewingstands.PotionIngredients.IngredientProperty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemGenerics extends Item implements IngredientProperty { - - public enum Properties { - /* Generic Items */ - PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - - /* Potion Effect Ingredients */ - BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( - "Antennae", 23, true), ShinyBauble("Shiny Bauble", 24, true), Talon("Talon", 25, true), Bark("Bark", - 27, true), SmallHeart("Small Heart", 28, true), LargeHeart("Large Heart", 29, true), Gill("Gill", 30, - true), Ectoplasm("Ectoplasm", 31), FrogLegs("Frog Legs", 32, true), RabbitsFoot("Rabbits Feet", 33, - true), PricklyPowder("Prickly Powder", 34, true), PowderSlush("Powder Slush", 35, true), GlowingGoo( - "Glowing Goo", 36, true), SmallUnhealthyHeart("Small Unhealthy Heart", 37, true), LargeUnhealthyHeart( - "Large Unhealthy Heart", 38, true); - - public final String displayName; - public final boolean isIngredient; - public final int meta; - - public int meta() { - return meta; - } - - @SideOnly(Side.CLIENT) - private IIcon icon; - - Properties(String name, int meta, boolean isIngredient) { - this.displayName = name; - this.meta = meta; - this.isIngredient = isIngredient; - } - - Properties(String name, int iconIndex) { - this(name, iconIndex, false); - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Properties getPropertyByMeta(int meta) { - for (Properties property : Properties.values()) { - if (property.meta == meta) { - return property; - } - } - return null; - } - } - - public ItemGenerics() { - super(); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Properties.getPropertyByMeta(par1).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - for (Properties type : Properties.values()) { - type.setIcon(par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + type.toString().toLowerCase())); - } - } - - @Override - public boolean isIngredient(ItemStack ingredient) { - Properties.getPropertyByMeta(ingredient.getItemDamage()); - return true; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - for (final Properties property : Properties.values()) { - if (property.meta == itemStack.getItemDamage()) { - return "item.".concat(property.displayName.toLowerCase().replaceAll("\\s", "")); - } - } - return ""; - } - - @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (final Properties property : Properties.values()) { - par3List.add(new ItemStack(item, 1, property.meta)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/31298dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/31298dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c8ffaec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/31298dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/31fa1bf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/31fa1bf7c42100141fce95f06aba7e85 deleted file mode 100644 index 908ef13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/31fa1bf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.heads.BlockMobHeads; -import com.ngb.projectzulu.common.blocks.heads.ItemMobHeads; -import com.ngb.projectzulu.common.blocks.heads.TileEntityMobHeads; -import com.ngb.projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a08720fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a08720fac42100141fce95f06aba7e85 deleted file mode 100644 index 4f2dd93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a08720fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a1494fe6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a1494fe6c42100141fce95f06aba7e85 deleted file mode 100644 index 521c87e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a1494fe6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempArmor { - - /** - * Factor that adds to the current Player Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Item is Equipped - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a16259f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a16259f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2f7c1a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/a16259f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBlackBear extends ModelBear { - - public ModelBlackBear() { - super(0); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.0f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/b0688f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/b0688f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e5bc1b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/b0688f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/c18219fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/c18219fac42100141fce95f06aba7e85 deleted file mode 100644 index f06d995..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/c18219fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemAnkh; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/d1b34b9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/d1b34b9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c035fc1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/d1b34b9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,351 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/e0324401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/e0324401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e370f5e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/e0324401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,277 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelArmadillo extends ModelBase { - public ModelRenderer WHOLE; - public ModelRenderer HEADPIECE; - public ModelRenderer REARRTR1; - public ModelRenderer REARRTR2; - public ModelRenderer REARRTR3; - - public ModelRenderer leg1; - public ModelRenderer leg2; - public ModelRenderer leg3; - public ModelRenderer leg4; - public ModelRenderer body2; - public ModelRenderer tail; - public ModelRenderer body1; - public ModelRenderer body3; - public ModelRenderer body4; - - public ModelRenderer chin; - public ModelRenderer head; - public ModelRenderer nose; - - public ModelArmadillo() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("WHOLE.dltfold0", 0, 0); - - WHOLE = new ModelRenderer(this, "WHOLE"); - WHOLE.setRotationPoint(0F, 18F, 0F); - // WHOLE.setRotationPoint(0F, 0F, 0F); - WHOLE.mirror = true; - setRotation(WHOLE, 0F, 0F, 0F); - - REARRTR1 = new ModelRenderer(this, "REARRTR1"); - WHOLE.addChild(REARRTR1); - REARRTR1.setRotationPoint(0F, -3F, -2F); - setRotation(REARRTR1, 0F, 0F, 0F); - REARRTR1.mirror = true; - body2 = new ModelRenderer(this, 32, 0); - body2.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR1.addChild(body2); - body2.setRotationPoint(0F, 3F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - REARRTR2 = new ModelRenderer(this, "REARRTR2"); - REARRTR1.addChild(REARRTR2); - REARRTR2.setRotationPoint(0F, -1F, 4F); - setRotation(REARRTR2, 0F, 0F, 0F); - REARRTR2.mirror = true; - body3 = new ModelRenderer(this, 32, 0); - body3.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR2.addChild(body3); - body3.setRotationPoint(0F, 4F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - REARRTR3 = new ModelRenderer(this, "REARRTR3"); - REARRTR2.addChild(REARRTR3); - REARRTR3.setRotationPoint(0F, 0F, 4F); - setRotation(REARRTR3, 0F, 0F, 0F); - REARRTR3.mirror = true; - tail = new ModelRenderer(this, 8, 14); - tail.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); - REARRTR3.addChild(tail); - tail.setRotationPoint(0F, 6F, 4F); - tail.setTextureSize(64, 32); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 32, 0); - body4.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR3.addChild(body4); - body4.setRotationPoint(0F, 4F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(REARRTR3); - // dltfold2.addChildModelRenderer(REARRTR2); - // dltfold0.addChildModelRenderer(REARRTR1); - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - WHOLE.addChild(HEADPIECE); - HEADPIECE.setRotationPoint(0F, 1F, -6F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - nose = new ModelRenderer(this, 12, 9); - nose.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADPIECE.addChild(nose); - nose.setRotationPoint(0F, 2F, -5F); - nose.setTextureSize(64, 32); - nose.mirror = true; - setRotation(nose, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 0); - head.addBox(-2.5F, -2.5F, -1.5F, 5, 5, 3); - HEADPIECE.addChild(head); - head.setRotationPoint(0F, 0F, -1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - chin = new ModelRenderer(this, 0, 8); - chin.addBox(-1.5F, -1.5F, -2.5F, 3, 3, 3); - HEADPIECE.addChild(chin); - chin.setRotationPoint(0F, 1F, -3F); - chin.setTextureSize(64, 32); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - // dltfold0.addChildModelRenderer(HEADPIECE); - body1 = new ModelRenderer(this, 32, 0); - body1.addBox(-4.5F, -4F, -2F, 9, 8, 4); - WHOLE.addChild(body1); - body1.setRotationPoint(0F, 0F, -4F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 15); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg4); - leg4.setRotationPoint(3F, 4F, 5F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 15); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg3); - leg3.setRotationPoint(-3F, 4F, 5F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 0, 15); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg2); - leg2.setRotationPoint(3F, 4F, -4F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 15); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg1); - leg1.setRotationPoint(-3F, 4F, -4F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // Something Should GO here - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - WHOLE.render(f5); - GL11.glPopMatrix(); - } else { - WHOLE.render(f5); - } - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - EntityArmadillo var5 = (EntityArmadillo) par7Entity; - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateX(+0.05f * 2.0f, 0f, (float) (145 * Math.PI / 180f)); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - // HEADPIECE.rotateAngleX = - // var5.eHEADPIECE.rotateX(-0.05f*animSpeed,0f,(float)(145*Math.PI/180f)); - this.HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateAngleX = Math.min(Math.max(par5, -180), +180) - * (float) (Math.PI / 180f); - this.HEADPIECE.rotateAngleY = var5.eHEADPIECE.rotateAngleY = Math.min(Math.max(par4, -30), +30) - * (float) (Math.PI / 180f); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityArmadillo var5 = (EntityArmadillo) par1EntityLiving; - - if (var5.eWHOLE.isSetup == false) { - var5.eWHOLE.setup(WHOLE); - } - if (var5.eHEADPIECE.isSetup == false) { - var5.eHEADPIECE.setup(HEADPIECE); - } - if (var5.eREARRTR1.isSetup == false) { - var5.eREARRTR1.setup(REARRTR1); - } - if (var5.eREARRTR2.isSetup == false) { - var5.eREARRTR2.setup(REARRTR2); - } - if (var5.eREARRTR3.isSetup == false) { - var5.eREARRTR3.setup(REARRTR3); - } - if (var5.etail.isSetup == false) { - var5.etail.setup(tail); - } - if (var5.eleg3.isSetup == false) { - var5.eleg3.setup(leg3); - } - if (var5.eleg4.isSetup == false) { - var5.eleg4.setup(leg4); - } - - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - float animSpeed = 2.0f; - if (var5.isCharging() == true) { - animSpeed = 5.0f; - /* Make Complete Body Circle */ - if (var5.eWHOLE.rotateAngleX == (float) ((390 + 360) * Math.PI / 180f)) { - var5.eWHOLE.rotateAngleX -= 360 * Math.PI / 180; - } - WHOLE.rotateAngleX = var5.eWHOLE - .rotateX(+0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - } else { - animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(+0.09f * animSpeed, 0f, (float) (390 * Math.PI / 180f)); - } - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(+0.1f, (float) (0 * Math.PI / 180f), (float) (90 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(-0.5f * animSpeed, 2.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(-0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(-0.5f * animSpeed, -4f, 4f); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - float animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(-0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - /* Rotate Face Inward */ - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(-0.1f * animSpeed, (float) (-15 * Math.PI / 180f), - (float) (30 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(+0.5f * animSpeed, 0.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(+0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(+0.5f * animSpeed, -4f, 4f); - - leg1.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg2.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - leg3.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg4.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/e0a0a4f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/e0a0a4f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0153bf5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/e0a0a4f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.minecraftforge.common.config.Configuration; - -public class ProjectZuluLog { - - private static Logger myLog; - public static boolean isSetup; - - public enum LogType { - SPAWNING, DEBUG; - public boolean isEnabled = false; - } - - public static void configureLogging(File configDirectory) { - if (!isSetup) { - isSetup = true; - myLog = Logger.getLogger("ProjectZulu|Core"); - myLog.setParent(Logger.getLogger("ForgeModLoader")); - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - for (LogType type : LogType.values()) { - if (type == LogType.DEBUG) { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", false, - "Master Switch For All Debug Printing (Not Fully Implemented)").getBoolean(false); - } else { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", true, - "Enables " + type + " Logging").getBoolean(true); - } - } - config.save(); - - } - } - - public static void log(Level level, String format, Object... data) { - myLog.log(level, String.format(format, data)); - } - - public static void info(String format, Object... data) { - log(Level.INFO, format, data); - } - - public static void warning(String format, Object... data) { - log(Level.WARNING, format, data); - } - - public static void severe(String format, Object... data) { - log(Level.SEVERE, format, data); - } - - public static void debug(Level level, String format, Object... data) { - if (LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } - - public static void log(LogType type, Level level, String format, Object... data) { - if (type.isEnabled || LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/f0d1d2f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/f0d1d2f8c42100141fce95f06aba7e85 deleted file mode 100644 index 0ce1df2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/25/f0d1d2f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseWhite; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/006c9da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/006c9da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2eca65e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/006c9da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/00806aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/00806aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 09163c3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/00806aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/00e236a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/00e236a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2347779..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/00e236a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.NBTWriter; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/10fa00a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/10fa00a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8e0e390..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/10fa00a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.world2; - -import java.util.EnumSet; -import java.util.Random; - -/** - * Two Dimensional Direction - */ -public enum Direction { - /* U = Up, D = Down, L = Left, R = Right */ - U(0, 0, 1), D(1, 0, -1), L(2, 1, 0), R(3, -1, 0), UL(4, 1, 1), UR(5, -1, 1), DL(6, 1, -1), DR(7, -1, -1); - - public final int x; - public final int z; - public final int id; - - Direction(int id, int x, int z) { - this.id = id; - this.x = x; - this.z = z; - } - - public static final Direction[] invert = { D, U, R, L, DR, DL, UR, UL }; - public static final Direction[] cwRotation = { UR, DL, UL, DR, U, R, L, D }; - public static final Direction[] ccwRotation = { UL, DR, DL, UR, L, U, D, R }; - - public Direction invert() { - return invert[id]; - } - - /* Rotate Direction by an Ordinal either Clockwise or CounterClockwise */ - public Direction rotateOrdinal(boolean clockwise) { - return clockwise ? cwRotation[id] : ccwRotation[id]; - } - - public static Direction getCardinal(Random random) { - return getCardinal(random.nextInt(4)); - } - - public static Direction getCardinal(int id) { - id = id & 3; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getCardinals() { - return EnumSet.of(U, D, L, R); - } - - public static Direction getOrdinal(Random random) { - return getOrdinal(random.nextInt(8)); - } - - public static Direction getOrdinal(int id) { - id = id & 7; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getOrdinals() { - return EnumSet.of(U, D, L, R, UL, UR, DL, DR); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/3061f49dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/3061f49dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3217cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/3061f49dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockJasper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/30eb5a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/30eb5a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 91d1bb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/30eb5a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.core; - -/** - * For usage see: {@link Pair} - */ -public class PairDirectoryFile { - private final K directory; - private final V file; - - public static PairDirectoryFile createPair(K directory, V file) { - return new PairDirectoryFile(directory, file); - } - - public PairDirectoryFile(K directory, V file) { - this.file = file; - this.directory = directory; - } - - public K getDirectory() { - return directory; - } - - public V getFile() { - return file; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairDirectoryFile)) { return false; } - PairDirectoryFile pair = (PairDirectoryFile)object; - return directory.equals(pair.directory) && file.equals(pair.file); - } - - @Override - public int hashCode(){ - return 7 * directory.hashCode() + 13 * file.hashCode(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/7091fde3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/7091fde3c42100141fce95f06aba7e85 deleted file mode 100644 index 60f6790..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/7091fde3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,203 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/b041b100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/b041b100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f33c17d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/b041b100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/c1411f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/c1411f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b829ba7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/c1411f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,60 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/c239b5a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/c239b5a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4b0ddc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/c239b5a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGorilla; -import projectzulu.common.mobs.models.ModelGorilla; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GorillaDeclaration extends SpawnableDeclaration { - - public GorillaDeclaration() { - super("Gorilla", 25, EntityGorilla.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (25 << 16) + (25 << 8) + 25; - eggColor2 = (93 << 16) + (93 << 8) + 93; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/f07921ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/f07921ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 581d0fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/f07921ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/f1e00ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/f1e00ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2be9e10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/26/f1e00ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,264 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/1020b6620a2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/1020b6620a2100141769cb1ed0c338cd deleted file mode 100644 index 6eaf2e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/1020b6620a2100141769cb1ed0c338cd +++ /dev/null @@ -1,233 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import net.minecraft.entity.*; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 0.38F)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/203799fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/203799fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index da850b0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/203799fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,309 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/20b5959fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/20b5959fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dbe60f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/20b5959fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/505635a5f52000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/505635a5f52000141769cb1ed0c338cd deleted file mode 100644 index 2fda101..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/505635a5f52000141769cb1ed0c338cd +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.tutmod; - -public class TutorialMod1 { - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/700901f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/700901f5c42100141fce95f06aba7e85 deleted file mode 100644 index 93c45b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/700901f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingTriple extends TileEntityBrewingBase { - - public TileEntityBrewingTriple() { - brewingItemStacks = new ItemStack[4]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/709367f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/709367f5c42100141fce95f06aba7e85 deleted file mode 100644 index e2883e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/709367f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import com.ngb.projectzulu.common.mobs.models.ModelMummyPharaoh; -import com.ngb.projectzulu.common.mobs.renders.RenderMummyPharaoh; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/7177a5a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/7177a5a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2551d05..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/7177a5a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/81bf58e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/81bf58e6c42100141fce95f06aba7e85 deleted file mode 100644 index 70f8fe6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/81bf58e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; - -public class ChestWithMeta extends BlockWithMeta { - - int lootChance; - int maxLoot; - TileEntityChest tileEntityChest; - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance) { - this(block, meta, tileEntityChest, lootChance, -1); - } - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance, int maxLoot) { - super(block, meta); - this.tileEntityChest = tileEntityChest; - this.lootChance = lootChance; - this.maxLoot = maxLoot; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntityChest); - int amountOfLoot = 0; - for (int slot = 0; slot < tileEntityChest.getSizeInventory(); slot++) { - if (lootChance - random.nextInt(100) >= 0) { - tileEntityChest.setInventorySlotContents(slot, ChestGenHooks.getOneItem(DUNGEON_CHEST, random)); - amountOfLoot++; - if (maxLoot > 0 && amountOfLoot >= maxLoot) { - break; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/90c261a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/90c261a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f69063e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/90c261a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,143 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidBreedingItem() function - */ -public abstract class EntityGenericBreedable extends EntityGenericAgeable{ - - protected int loveTimer = 0; - public boolean isInLove(){return loveTimer > 0 ? true: false;} - public void resetInLove(){ loveTimer = 0; } - - /* How long an Entity should be in Love Mode when Fed */ - protected int loveCooldown = 600; - - public EntityGenericBreedable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* Breeding is all Done Server Side, and only while growingAge is 0 - * Thus on Client, we know that if growage is not 0 we are not breeding / in love anymore*/ - if (this.getGrowingAge() != 0) { - this.loveTimer = 0; - } - - /* Decrement loveTimer for the purpose of hearts */ - if(getEntityState() == EntityStates.inLove){ - loveTimer--; - if(loveTimer % 10 == 0){ - String var1 = "heart"; - double var2 = this.rand.nextGaussian() * 0.02D; - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var1, - this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, - this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), - this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); - } - } - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding - * This is overriden by each Entity if deviations from default are desired - */ - public boolean isValidBreedingItem(ItemStack itemStack){ - return false; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if (var2 != null && this.isValidBreedingItem(var2) && this.getGrowingAge() == 0) { - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - - this.loveTimer = loveCooldown; - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } - - return true; - } - else { - return super.interact(par1EntityPlayer); - } - } - - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityGenericBreedable targetEntity){ - /* If Passed Entity is Self or Different Type, return False */ - if(targetEntity == this || targetEntity.getClass() != this.getClass()){ - return false; - } - /* Otherwise, if Target is in Love, and Self is. Then let them mate */ - if(this.isInLove() && targetEntity.isInLove()){ - return true; - } - - return false; - } - - /** - * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal of their Type. - */ - public EntityGenericBreedable getBabyAnimalEntity(Entity par1EntityAnimal) { - Object object = null; - try { - Class thisClass = par1EntityAnimal.getClass(); - Constructor ctor= thisClass.getConstructor(World.class); - try { - object = ctor.newInstance(new Object[] { this.worldObj }); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - return (EntityGenericBreedable) object; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/918b8df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/918b8df8c42100141fce95f06aba7e85 deleted file mode 100644 index 2601f4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/918b8df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a1d84ce6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a1d84ce6c42100141fce95f06aba7e85 deleted file mode 100644 index f86aa0d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/a1d84ce6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b024be9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b024be9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 44c6f23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b024be9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,160 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b165bca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b165bca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e1f8c30..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b165bca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b2b83bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b2b83bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f03fea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/27/b2b83bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.blocks.itemblockdeclarations.StructurePlacerDeclaration; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_World extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.WorldModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new StructurePlacerDeclaration()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new PyramidFeature(), new LabyrinthFeature(), new CemetaryFeature(), - new OasisFeature(), new CathedralFeature()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/00e8d8f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/00e8d8f4c42100141fce95f06aba7e85 deleted file mode 100644 index 3b2599b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/00e8d8f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/01ce69a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/01ce69a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75f2d0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/01ce69a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/306b7cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/306b7cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ed28418..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/306b7cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/6062ae9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/6062ae9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 59ea507..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/6062ae9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/70576a0beeac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/70576a0beeac0014196dc3517d78505a new file mode 100644 index 0000000..46c83d7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/70576a0beeac0014196dc3517d78505a @@ -0,0 +1,287 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelDeer extends ModelBase + { + float heightToRaise = 5f; + float renderScale = 1.3f; + + //fields + ModelRenderer top4hornRight; + ModelRenderer top4hornLeft; + ModelRenderer top3hornRight; + ModelRenderer top3hornLeft; + ModelRenderer top1hornRight; + ModelRenderer top1hornLeft; + ModelRenderer HEADROT; + ModelRenderer hornLeft; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer neck; + ModelRenderer BODYROT; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer tail; + ModelRenderer top2hornLeft; + ModelRenderer hornRight; + ModelRenderer top2hornRight; + + public ModelDeer() + { + textureWidth = 64; + textureHeight = 64; + + HEADROT = new ModelRenderer(this, 1, 19); + HEADROT.addBox(-1.5F, -6F, -7F, 5, 4, 7); + HEADROT.setRotationPoint(-2F, 4F - heightToRaise , -6F); + HEADROT.setTextureSize(64, 64); + HEADROT.mirror = true; + setRotation(HEADROT, 0.5230717F, 0F, 0F); + + earLeft = new ModelRenderer(this, 43, 33); + earLeft.addBox(0F, 1F, 0F, 1, 3, 1); + //earLeft.setRotationPoint(0F, 0.5F, -9F); + earLeft.setRotationPoint(2F, -3.5F, -2.0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, -2.199115F); + HEADROT.addChild(earLeft); + + earRight = new ModelRenderer(this, 50, 33); + earRight.addBox(-1F, 1F, 0F, 1, 3, 1); + //earRight.setRotationPoint(-2F, 0.5F, -9F); + earRight.setRotationPoint(-0.5F, -3.5F, -2.0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, 2.199115F); + HEADROT.addChild(earRight); + + hornLeft = new ModelRenderer(this, 8, 5); + hornLeft.addBox(0F, -3F, 0F, 1, 5, 1); + //hornLeft.setRotationPoint(0F, -3F, -9F); + hornLeft.setRotationPoint(2F, -8F, -2F); + hornLeft.setTextureSize(64, 64); + hornLeft.mirror = true; + setRotation(hornLeft, -0.5410521F, 0.1396263F, 0F); + HEADROT.addChild(hornLeft); + + hornRight = new ModelRenderer(this, 2, 5); + hornRight.addBox(-1F, -3F, 0F, 1, 5, 1); + //hornRight.setRotationPoint(-2F, -3F, -9F); + hornRight.setRotationPoint(0F, -8F, -2F); + hornRight.setTextureSize(64, 64); + hornRight.mirror = true; + setRotation(hornRight, -0.5410521F, -0.1396263F, 0F); + HEADROT.addChild(hornRight); + + top2hornLeft = new ModelRenderer(this, 21, 5); + top2hornLeft.addBox(0F, -3F, 0F, 1, 4, 1); + //top2hornLeft.setRotationPoint(0.3F, -5.5F, -8F); + top2hornLeft.setRotationPoint(0.3F, -3.5F, 0F); + top2hornLeft.setTextureSize(64, 64); + top2hornLeft.mirror = true; + setRotation(top2hornLeft, 0.6372665F, 0.0349066F, 0.0523599F); + hornLeft.addChild(top2hornLeft); + + top2hornRight = new ModelRenderer(this, 15, 5); + top2hornRight.addBox(-1F, -3F, 0F, 1, 4, 1); + //top2hornRight.setRotationPoint(-2.3F, -5.5F, -8F); + top2hornRight.setRotationPoint(0F, -3.5F, 0F); + top2hornRight.setTextureSize(64, 64); + top2hornRight.mirror = true; + setRotation(top2hornRight, 0.6372665F, -0.0349066F, -0.0523599F); + hornRight.addChild(top2hornRight); + + top1hornRight = new ModelRenderer(this, 41, 5); + top1hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top1hornRight.setRotationPoint(-2.4F, -7.5F, -8F); + top1hornRight.setRotationPoint(-0.4F, -2.0F, -0F); + top1hornRight.setTextureSize(64, 64); + top1hornRight.mirror = true; + setRotation(top1hornRight, 1.047198F, 0.1047198F, 0F); + top2hornRight.addChild(top1hornRight); + + top1hornLeft = new ModelRenderer(this, 41, 10); + top1hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top1hornLeft.setRotationPoint(0.5F, -7.5F, -8F); + top1hornLeft.setRotationPoint(0.5F, -2.0F, -0F); + top1hornLeft.setTextureSize(64, 64); + top1hornLeft.mirror = true; + setRotation(top1hornLeft, 1.047198F, -0.1047198F, 0F); + top2hornLeft.addChild(top1hornLeft); + + top3hornRight = new ModelRenderer(this, 34, 5); + top3hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top3hornRight.setRotationPoint(-2.2F, -5F, -8F); + top3hornRight.setRotationPoint(-0.2F, -2.0F, 0F); + top3hornRight.setTextureSize(64, 64); + top3hornRight.mirror = true; + setRotation(top3hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top3hornRight); + + top3hornLeft = new ModelRenderer(this, 34, 10); + top3hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top3hornLeft.setRotationPoint(0.2F, -5F, -8F); + top3hornLeft.setRotationPoint(0.2F, -2.0F, 0F); + top3hornLeft.setTextureSize(64, 64); + top3hornLeft.mirror = true; + setRotation(top3hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top3hornLeft); + + top4hornRight = new ModelRenderer(this, 28, 5); + top4hornRight.addBox(-1F, -3F, 0F, 1, 2, 1); + //top4hornRight.setRotationPoint(-2F, -2F, -8F); + top4hornRight.setRotationPoint(-0F, 1.5F, 1.5F); + top4hornRight.setTextureSize(64, 64); + top4hornRight.mirror = true; + setRotation(top4hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top4hornRight); + + top4hornLeft = new ModelRenderer(this, 28, 9); + top4hornLeft.addBox(0F, -3F, 0F, 1, 2, 1); + //top4hornLeft.setRotationPoint(0F, -2F, -8F); + top4hornLeft.setRotationPoint(0F, 1.5F, 1.5F); + top4hornLeft.setTextureSize(64, 64); + top4hornLeft.mirror = true; + setRotation(top4hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top4hornLeft); + + neck = new ModelRenderer(this, 28, 21); + neck.addBox(0F, -2F, -2F, 4, 3, 8); + neck.setRotationPoint(-3F, 2F - heightToRaise, -8F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, -0.9294653F, 0F, 0F); + BODYROT = new ModelRenderer(this, 28, 41); + BODYROT.addBox(-4F, -8F, -5F, 8, 15, 6); + BODYROT.setRotationPoint(-1F, 6F - heightToRaise, 1F); + BODYROT.setTextureSize(64, 64); + BODYROT.mirror = true; + setRotation(BODYROT, 1.570796F, 0F, 0F); + leg1 = new ModelRenderer(this, 0, 32); + leg1.addBox(-1F, 0F, -1F, 3, 10, 3); + leg1.setRotationPoint(-4F, 11F - heightToRaise, 6F); + leg1.setTextureSize(64, 64); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 13, 32); + leg2.addBox(-1F, 0F, -1F, 3, 10, 3); + leg2.setRotationPoint(1F, 11F - heightToRaise, 6F); + leg2.setTextureSize(64, 64); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 13, 49); + leg3.addBox(-2F, 0F, -1F, 3, 10, 3); + leg3.setRotationPoint(-3F, 11F - heightToRaise, -6F); + leg3.setTextureSize(64, 64); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 0, 49); + leg4.addBox(-1F, 0F, -1F, 3, 10, 3); + leg4.setRotationPoint(1F, 11F - heightToRaise, -6F); + leg4.setTextureSize(64, 64); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + tail = new ModelRenderer(this, 28, 34); + tail.addBox(-1F, 0F, 0F, 2, 1, 3); + tail.setRotationPoint(-1F, 5.5F - heightToRaise, 7F); + tail.setTextureSize(64, 64); + tail.mirror = true; + setRotation(tail, -0.4506874F, 0F, 0F); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //top4hornRight.render(f5); + //top4hornLeft.render(f5); + //top3hornRight.render(f5); + //top3hornLeft.render(f5); + //top2hornLeft.render(f5); + //top2hornRight.render(f5); + //top1hornRight.render(f5); + //top1hornLeft.render(f5); + //hornLeft.render(f5); + //hornRight.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Constant Animation Rotations */ + leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + + /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math + .log(par3 + 1))); + + earLeft.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1))); + earRight.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1)));*/ + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + + } + + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/70a734f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/70a734f6c42100141fce95f06aba7e85 deleted file mode 100644 index 435b94a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/70a734f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/714211fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/714211fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 76cbc2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/714211fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90c94ba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90c94ba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 787fbd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/90c94ba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9140bfffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9140bfffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6dc8467..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/9140bfffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/92952cfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/92952cfac42100141fce95f06aba7e85 deleted file mode 100644 index 8e66f29..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/92952cfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,138 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelCrocodileHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer MOUTHTOPROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - - public ModelCrocodileHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - CENTERROT.addChild(MOUTHTOPROT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - CENTERROT.addChild(MOUTHBOTROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/c0c31ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/c0c31ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bb6d89c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/c0c31ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandTriple extends BlockBrewingStandBase { - - public BlockBrewingStandTriple(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int par2) { - return new TileEntityBrewingTriple(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/d1a9a8f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/d1a9a8f7c42100141fce95f06aba7e85 deleted file mode 100644 index 6d98677..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/d1a9a8f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityMobHeads extends TileEntity { - - /* Passed in From Item Damage */ - private int skullType; - private int rotation; - private String ExtraType = ""; - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("SkullType", (byte) (this.skullType & 255)); - par1NBTTagCompound.setByte("Rot", (byte) (this.rotation & 255)); - par1NBTTagCompound.setString("ExtraType", this.ExtraType); - - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - skullType = par1NBTTagCompound.getByte("SkullType"); - rotation = par1NBTTagCompound.getByte("Rot"); - - if (par1NBTTagCompound.hasKey("ExtraType")) { - this.ExtraType = par1NBTTagCompound.getString("ExtraType"); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - NBTTagCompound tag = packet.func_148857_g(); - skullType = tag.getByte("SkullType"); - rotation = tag.getByte("Rot"); - } - - public void setSkullType(int par1, String par2Str) { - skullType = par1; - ExtraType = par2Str; - } - - public int getSkullType() { - return skullType; - } - - public void setRotation(int par1) { - rotation = par1; - } - - @SideOnly(Side.CLIENT) - public int getRotation() { - return rotation; - } - - @SideOnly(Side.CLIENT) - public String getExtraType() { - return ExtraType; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e0a528ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e0a528ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index eab260f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e0a528ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e15a139ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e15a139ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ad2f1ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e15a139ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemFoodProjectZulu extends ItemFood { - /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; - - /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; - - /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; - - /** - * If this field is true, the food can be consumed even if the player don't need to eat. - */ - private boolean alwaysEdible; - - /** - * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect - */ - private int potionId; - - /** set by setPotionEffect */ - private int potionDuration; - - /** set by setPotionEffect */ - private int potionAmplifier; - - /** probably of the set potion effect occurring */ - private float potionEffectProbability; - - public ItemFoodProjectZulu(int par2, float par3, boolean par4, String name) { - super(par2, par3, par4); - itemUseDuration = 32; - healAmount = par2; - isWolfsFavoriteMeat = par4; - saturationModifier = par3; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - --par1ItemStack.stackSize; - par3EntityPlayer.getFoodStats().func_151686_a(this, par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); - this.func_77849_c(par1ItemStack, par2World, par3EntityPlayer); - return par1ItemStack; - } - - protected void func_77849_c(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e19b11a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e19b11a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1a94b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e19b11a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,260 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e1fbfee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e1fbfee4c42100141fce95f06aba7e85 deleted file mode 100644 index a85bc54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/e1fbfee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,563 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getAABBPool() - .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/f2efcdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/f2efcdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 2e2bcf6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/28/f2efcdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityMammoth; -import com.ngb.projectzulu.common.mobs.models.ModelMammoth; -import com.ngb.projectzulu.common.mobs.renders.RenderMammoth; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/00cc30f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/00cc30f5c42100141fce95f06aba7e85 deleted file mode 100644 index 1073f83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/00cc30f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,1046 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import com.ngb.projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/1043f4f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/1043f4f5c42100141fce95f06aba7e85 deleted file mode 100644 index f1bba79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/1043f4f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,143 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidBreedingItem() function - */ -public abstract class EntityGenericBreedable extends EntityGenericAgeable{ - - protected int loveTimer = 0; - public boolean isInLove(){return loveTimer > 0 ? true: false;} - public void resetInLove(){ loveTimer = 0; } - - /* How long an Entity should be in Love Mode when Fed */ - protected int loveCooldown = 600; - - public EntityGenericBreedable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* Breeding is all Done Server Side, and only while growingAge is 0 - * Thus on Client, we know that if growage is not 0 we are not breeding / in love anymore*/ - if (this.getGrowingAge() != 0) { - this.loveTimer = 0; - } - - /* Decrement loveTimer for the purpose of hearts */ - if(getEntityState() == EntityStates.inLove){ - loveTimer--; - if(loveTimer % 10 == 0){ - String var1 = "heart"; - double var2 = this.rand.nextGaussian() * 0.02D; - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var1, - this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, - this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), - this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); - } - } - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding - * This is overriden by each Entity if deviations from default are desired - */ - public boolean isValidBreedingItem(ItemStack itemStack){ - return false; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if (var2 != null && this.isValidBreedingItem(var2) && this.getGrowingAge() == 0) { - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - - this.loveTimer = loveCooldown; - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } - - return true; - } - else { - return super.interact(par1EntityPlayer); - } - } - - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityGenericBreedable targetEntity){ - /* If Passed Entity is Self or Different Type, return False */ - if(targetEntity == this || targetEntity.getClass() != this.getClass()){ - return false; - } - /* Otherwise, if Target is in Love, and Self is. Then let them mate */ - if(this.isInLove() && targetEntity.isInLove()){ - return true; - } - - return false; - } - - /** - * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal of their Type. - */ - public EntityGenericBreedable getBabyAnimalEntity(Entity par1EntityAnimal) { - Object object = null; - try { - Class thisClass = par1EntityAnimal.getClass(); - Constructor ctor= thisClass.getConstructor(World.class); - try { - object = ctor.newInstance(new Object[] { this.worldObj }); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - return (EntityGenericBreedable) object; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/30d679132124001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/30d679132124001415179d45b0e27e9a deleted file mode 100644 index 2bf1ea6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/30d679132124001415179d45b0e27e9a +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/30e97be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/30e97be4c42100141fce95f06aba7e85 deleted file mode 100644 index 3d3022d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/30e97be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/418015f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/418015f9c42100141fce95f06aba7e85 deleted file mode 100644 index fa35eff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/418015f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,158 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.util.DamageSource; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public abstract class EntityMaster extends EntityGenericAnimal { - - List followerList = new ArrayList(); - int numberOfFollowers = 9; - - boolean spawnFollowers = true; - - /* Represents the increments between each slave-Piece, used to determine number of locations needed to track */ - int distanceIncrements = 10; - float distancePerIncrement; - - boolean isPositionListSetup = false; - LinkedList positionList = new LinkedList(); - - public EntityMaster(World par1World) { - super(par1World); - - distancePerIncrement = width / distanceIncrements; - while (followerList.size() < numberOfFollowers) { - followerList.add(null); - } - } - - @Override - public boolean canBePushed() { - return false; - } - - /* Handling of Child Entities Position Must be Handled on Server and Client Side */ - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - if (!isPositionListSetup) { - double xzOffset = 0; - while (positionList.size() < numberOfFollowers * distanceIncrements + 1) { - positionList.add(Vec3.createVectorHelper(posX + xzOffset, posY, posZ)); - xzOffset += distancePerIncrement; - } - isPositionListSetup = true; - } - - /* Calculate Position Array, used to set the target position for Followers */ - double minDistanceToIterateList = distancePerIncrement; - while (calcDistance(posX, posZ, positionList.getFirst().xCoord, positionList.getFirst().zCoord) > minDistanceToIterateList) { - - double xDist = posX - positionList.getFirst().xCoord; - double zDist = posZ - positionList.getFirst().zCoord; - - double scaleFactor = (minDistanceToIterateList / calcDistance(posX, posZ, positionList.getFirst().xCoord, - positionList.getFirst().zCoord)); - double actualXCoord = positionList.getFirst().xCoord + xDist * scaleFactor; - double actualZCoord = positionList.getFirst().zCoord + zDist * scaleFactor; - - positionList.addFirst(Vec3.createVectorHelper(actualXCoord, posY, actualZCoord)); - positionList.removeLast(); - } - - /* - * Store the Values Gotten from positionList.get from previous iteration Used to Calculate TargetRotation - */ - double prevX = posX; - double prevZ = posZ; - for (int i = 0; i < followerList.size(); i++) { - - if (followerList.get(i) != null) { - EntityFollower entityFollower = followerList.get(i); - - /* Get Position From Position List */ - double setXAround = positionList.get((i + 1) * distanceIncrements).xCoord; - double setZAround = positionList.get((i + 1) * distanceIncrements).zCoord; - double setYAround = positionList.get((i + 1) * distanceIncrements).yCoord; - entityFollower.setTargetPosition(Vec3.createVectorHelper(setXAround, posY, setZAround)); - - entityFollower - .setTargetRotation((float) (Math.atan2(setXAround - prevX, prevZ - setZAround) * (180.0 / Math.PI))); - prevX = setXAround; - prevZ = setZAround; - - /* Check if Prev Point is Dead, is so, I should probably be killed to */ - if (i > 0 && followerList.get(i - 1) != null) { - if (followerList.get(i - 1).isDead) { - entityFollower.shouldBeDying = true; - } - } - } - } - } - - /* Creation of Child Entities should only be Done on Server */ - @Override - public void updateAITick() { - - /* Count Number of Followers, used to determine if more followers should be spawned */ - int currentNumOfFollowers = 0; - for (int i = 0; i < followerList.size(); i++) { - /* Spawn new Followers if Neccesary */ - if (followerList.get(i) == null || (followerList.get(i).isDead && spawnFollowers)) { - followerList.set(i, new EntityFollower(worldObj, posX, posY, posZ, this, i)); - worldObj.spawnEntityInWorld(followerList.get(i)); - } - EntityFollower entityFollower = followerList.get(i); - - /* Count Number of Followers, used to determine if more followers should be spawned */ - if (!entityFollower.isDead) { - currentNumOfFollowers += 1; - } - } - - /* Check if We should Spawn More Followers */ - spawnFollowers = currentNumOfFollowers < numberOfFollowers ? true : false; - super.updateAITick(); - } - - /** - * Code to Assign body to Head, called by Body client Side to establish link - */ - public boolean linkFollowerWithMaster(EntityFollower entityFollower, int followerIndex) { - if (followerList.get(followerIndex) != null && !followerList.get(followerIndex).isDead) { - return false; - } - followerList.set(followerIndex, entityFollower); - return true; - } - - /* Shares Damage with Followers */ - public boolean attackEntityFromChild(EntityFollower var1, DamageSource var2, float var3) { - if (super.attackEntityFrom(var2, var3)) { - for (int i = 0; i < followerList.size(); i++) { - EntityFollower entityFollower = followerList.get(i); - if (entityFollower != null) { - entityFollower.hurtChildFromMaster(var2, var3); - } - } - return true; - } - return false; - } - - @Override - protected boolean canDespawn() { - return true; - } - - private double calcDistance(double x1, double z1, double x2, double z2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (z2 - z1) * (z2 - z1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/41ce899fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/41ce899fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb38494..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/41ce899fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import projectzulu.common.potion.subitem.SubItemPotionHarm; -import projectzulu.common.potion.subitem.SubItemPotionHeal; -import projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import projectzulu.common.potion.subitem.SubItemPotionNightVision; -import projectzulu.common.potion.subitem.SubItemPotionPoison; -import projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/50727ea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/50727ea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 421f59e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/50727ea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,116 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/601dd500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/601dd500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ce809d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/601dd500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/60235dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/60235dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca71647..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/60235dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/71aa61e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/71aa61e4c42100141fce95f06aba7e85 deleted file mode 100644 index a480ea0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/71aa61e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,19 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/a11e88f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/a11e88f6c42100141fce95f06aba7e85 deleted file mode 100644 index 0153bf5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/a11e88f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.minecraftforge.common.config.Configuration; - -public class ProjectZuluLog { - - private static Logger myLog; - public static boolean isSetup; - - public enum LogType { - SPAWNING, DEBUG; - public boolean isEnabled = false; - } - - public static void configureLogging(File configDirectory) { - if (!isSetup) { - isSetup = true; - myLog = Logger.getLogger("ProjectZulu|Core"); - myLog.setParent(Logger.getLogger("ForgeModLoader")); - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - for (LogType type : LogType.values()) { - if (type == LogType.DEBUG) { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", false, - "Master Switch For All Debug Printing (Not Fully Implemented)").getBoolean(false); - } else { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", true, - "Enables " + type + " Logging").getBoolean(true); - } - } - config.save(); - - } - } - - public static void log(Level level, String format, Object... data) { - myLog.log(level, String.format(format, data)); - } - - public static void info(String format, Object... data) { - log(Level.INFO, format, data); - } - - public static void warning(String format, Object... data) { - log(Level.WARNING, format, data); - } - - public static void severe(String format, Object... data) { - log(Level.SEVERE, format, data); - } - - public static void debug(Level level, String format, Object... data) { - if (LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } - - public static void log(LogType type, Level level, String format, Object... data) { - if (type.isEnabled || LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b0e8e1f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b0e8e1f4c42100141fce95f06aba7e85 deleted file mode 100644 index fb1c9d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/b0e8e1f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c08c34ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c08c34ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ffdc47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/c08c34ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/d06d41f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/d06d41f5c42100141fce95f06aba7e85 deleted file mode 100644 index 8bff96e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/29/d06d41f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,351 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/118467a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/118467a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cdb30bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/118467a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/212b2f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/212b2f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 832a5c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/212b2f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRhino; -import projectzulu.common.mobs.models.ModelRhino; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/223559f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/223559f8c42100141fce95f06aba7e85 deleted file mode 100644 index db0fe11..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/223559f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,290 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.EntityPZPotion; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/305f15e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/305f15e4c42100141fce95f06aba7e85 deleted file mode 100644 index df54433..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/305f15e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,138 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelCrocodileHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer MOUTHTOPROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - - public ModelCrocodileHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - CENTERROT.addChild(MOUTHTOPROT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - CENTERROT.addChild(MOUTHBOTROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/32898e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/32898e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d736953..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/32898e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/501ae0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/501ae0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d65e15b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/501ae0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,132 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBoar extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEGROT1; - private ModelRenderer LEGROT2; - private ModelRenderer LEGROT3; - private ModelRenderer LEGROT4; - - public ModelBoar() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - setTextureOffset("BODYROT.body", 12, 8); - setTextureOffset("LEGROT1.leg1", 0, 13); - setTextureOffset("LEGROT2.leg2", 0, 13); - setTextureOffset("LEGROT3.leg3", 0, 13); - setTextureOffset("LEGROT4.leg4", 0, 13); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 14F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 14.5F, -4F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -4.5F, 0F, 10, 8, 16); - LEGROT1 = new ModelRenderer(this, "LEGROT1"); - LEGROT1.setRotationPoint(-3F, 3.5F, 14F); - setRotation(LEGROT1, 0F, 0F, 0F); - LEGROT1.mirror = true; - LEGROT1.addBox("leg1", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT1); - LEGROT2 = new ModelRenderer(this, "LEGROT2"); - LEGROT2.setRotationPoint(3F, 3.5F, 14F); - setRotation(LEGROT2, 0F, 0F, 0F); - LEGROT2.mirror = true; - LEGROT2.addBox("leg2", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT2); - LEGROT3 = new ModelRenderer(this, "LEGROT3"); - LEGROT3.setRotationPoint(-3F, 3.5F, 2F); - setRotation(LEGROT3, 0F, 0F, 0F); - LEGROT3.mirror = true; - LEGROT3.addBox("leg3", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT3); - LEGROT4 = new ModelRenderer(this, "LEGROT4"); - LEGROT4.setRotationPoint(3F, 3.5F, 2F); - setRotation(LEGROT4, 0F, 0F, 0F); - LEGROT4.mirror = true; - LEGROT4.addBox("leg4", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT4); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_x = 0.0f; - float field_78145_g = 2.2F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGROT1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/512eada2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/512eada2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 347c932..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/512eada2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectPyramid; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/513613f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/513613f9c42100141fce95f06aba7e85 deleted file mode 100644 index d6d5f84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/513613f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,152 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.client.model.ModelRenderer; -/** - * Used for Models that need to Track their Rotation - * i.e. Rotate based on their previous rotation angle - * See {@link #ModelArmadillo} - */ -public class EntityModelRotation { - public float rotateAngleX = 0; - public float rotateAngleY = 0; - public float rotateAngleZ = 0; - - public float rotationPointX; - public float rotationPointY; - public float rotationPointZ; - - public Boolean isSetup = false; - public String assignedPiece = "nothing"; - - private int xAngleDirec = 1; - private int yAngleDirec = 1; - public int zAngleDirec = 1; - - public EntityModelRotation() {} - - public void setup(ModelRenderer modelRenderer){ - rotateAngleX = modelRenderer.rotateAngleX; - rotateAngleY = modelRenderer.rotateAngleY; - rotateAngleZ = modelRenderer.rotateAngleZ; - rotationPointX = modelRenderer.rotationPointX; - rotationPointY = modelRenderer.rotationPointY; - rotationPointZ = modelRenderer.rotationPointZ; - - isSetup = true; - assignedPiece = modelRenderer.boxName; - } - - public float rotateX(float increment, float min, float max){ - rotateAngleX = clamp(rotateAngleX+increment, min, max); - return rotateAngleX; - } - - public float rotateY(float increment, float min, float max){ - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - public float rotateZ(float increment, float min, float max){ - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - - /** - * rotateZ Angle. - * par4 = 0 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min - */ - public float rotateZ(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleZ; - - case 2: - if(rotateAngleZ+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = max; - return rotateAngleZ; - } - - if(rotateAngleZ+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = min; - return rotateAngleZ; - } - - rotateAngleZ = rotateAngleZ+increment*zAngleDirec; - return rotateAngleZ; - - default: - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - } - - /* - * rotateY Angle. - * par4 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min (Uses Cosine) - */ - public float rotateY(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleY; - - case 2: - if(rotateAngleY+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = max; - return rotateAngleY; - } - - if(rotateAngleY+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = min; - return rotateAngleY; - } - - rotateAngleY = rotateAngleY+increment*zAngleDirec; - return rotateAngleY; - - default: - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - } - - - - private float clamp(float number, float min, float max){ - return Math.max(Math.min(number, max), min); - } - private float loop(float number, float min, float max){ - if(number>max){ - return min+number-max; - } - if(number itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - - if (itemBlock.isPresent()) { - if (itemBlock.get() instanceof Item) { - type = OptionalType.ITEM; - } else if (itemBlock.get() instanceof Block) { - type = OptionalType.BLOCK; - } else if (itemBlock.get() instanceof String) { - type = OptionalType.OREDIC; - } - } else { - itemBlock = Optional.absent(); - } - } - - /* Item */ - public OptionalItemStack(Item itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.ITEM); - } - - /* Block */ - public OptionalItemStack(Block itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.BLOCK); - } - - /* Ore Dictionary String */ - public OptionalItemStack(String itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.OREDIC); - } - - /** Optional Parameter With Supplied Type */ - public OptionalItemStack(Optional itemBlock, OptionalType type) { - this(itemBlock, 1, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, OptionalType type) { - this(itemBlock, stackSize, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta, OptionalType type) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - this.type = type; - } - - public boolean isPresent() { - return itemBlock != null && itemBlock.isPresent(); - } - - public ItemStack createItemStack() { - switch (type) { - case BLOCK: - return new ItemStack((Block) (itemBlock.get()), stackSize, meta); - case ITEM: - return new ItemStack((Item) (itemBlock.get()), stackSize, meta); - default: - throw new IllegalStateException("Cannot create ItemStack for OptionalType"); - } - } - - public Object createRecipeObject() { - switch (type) { - case BLOCK: - case ITEM: - return createItemStack(); - case OREDIC: - return itemBlock.get(); - default: - throw new IllegalStateException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c158a4e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c158a4e4c42100141fce95f06aba7e85 deleted file mode 100644 index 65a6d4e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c158a4e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c27abafec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c27abafec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1be34fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/c27abafec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,157 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0217ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0217ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca7e40a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0217ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0e07ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0e07ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 572819d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/d0e07ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,605 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCampFire implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - RenderItem itemRenderer = new RenderItem(); - - ItemStack itemStackToRender = new ItemStack(block, 1, metadata); - - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 1.5f; - GL11.glPushMatrix(); - - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef((float) (90f * Math.PI / 180f), 1, 0, 0); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - /** - * Render Campfire Stones - */ - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case WoodFire: - case StoneFire: - /* Render If Should and Render Campfire Fire */ - renderBlockFire(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - break; - case Stone: - case Wood: - break; - } - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case Wood: - case WoodFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.35, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.24, var20, var15 + 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.24, var20, var15 - 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.21, var20, var15 + 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.21, var20, var15 - 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - break; - case Stone: - case StoneFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Stones */ - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 + 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 - 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - break; - } - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle2Sides(Block par1Block, int index1, int index2, int par2, double par3, - double par5, double par7, RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - double var13 = var10.getMinU(); - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2.01f; - double var17 = var10.getMinV(); - double var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) / 2.01f; - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 0.99f / 4f; - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 2.99f / 4f; - var17 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 0.99f / 4f; - var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 2.99f / 4f; - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle(Block par1Block, int var10, int par2, double par3, double par5, double par7, - RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 3, 2); - double var13 = icon.getMinU(); - double var15 = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / 2.01f; - double var17 = icon.getMinV(); - double var19 = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / 2.01f; - - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - return true; - } - - /** - * Renders a fire block at the given coordinates - */ - public boolean renderBlockFire(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - Tessellator var5 = Tessellator.instance; - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.fire, 0, 0); - double var9 = icon.getMinU(); - double var11 = icon.getMaxU(); - double var13 = icon.getMinV(); - double var15 = icon.getMaxV(); - - float var17 = 1.4F; - double var20; - double var22; - double var24; - double var26; - double var28; - double var30; - double var32; - - if (!World.doesBlockHaveSolidTopSurface(blockAccess, par2, par3 - 1, par4) - && !Blocks.fire.canCatchFire(blockAccess, par2, par3 - 1, par4, ForgeDirection.UP)) { - float var36 = 0.2F; - float var19 = 0.0625F; - - if ((par2 + par3 + par4 & 1) == 1) { - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - } - - if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { - var20 = var11; - var11 = var9; - var9 = var20; - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 - 1, par3, par4, ForgeDirection.EAST)) { - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 + 1, par3, par4, ForgeDirection.WEST)) { - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - var20 = par2 + 0.5D + 0.5D; // 1 - var22 = par2 + 0.5D - 0.5D; // 0 - var24 = par4 + 0.5D + 0.5D; - var26 = par4 + 0.5D - 0.5D; - - var28 = par2 + 0.5D - 0.5D; - var30 = par2 + 0.5D + 0.5D; - var32 = par4 + 0.5D - 0.5D; - double var34 = par4 + 0.5D + 0.5D; - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - ++par3; - var17 = -0.2F; - - if ((par2 + par3 + par4 & 1) == 0) { - var5.addVertexWithUV(var28, par3 + var17, par4 + 0, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 1, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 1, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(var30, par3 + var17, par4 + 1, var11, var13); - var5.addVertexWithUV(var22, par3 + 0, par4 + 1, var11, var15); - var5.addVertexWithUV(var22, par3 + 0, par4 + 0, var9, var15); - var5.addVertexWithUV(var30, par3 + var17, par4 + 0, var9, var13); - } else { - var5.addVertexWithUV(par2 + 0, par3 + var17, var34, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0, var26, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0, var26, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17, var34, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 1, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17, var32, var9, var13); - } - } - } else { - double var18 = par2 + 0.5D + 0.2D; - var20 = par2 + 0.5D - 0.2D; // - var22 = par4 + 0.5D + 0.2D; - var24 = par4 + 0.5D - 0.2D; - var26 = par2 + 0.5D - 0.3D; - var28 = par2 + 0.5D + 0.3D; - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - - var18 = par2 + 0.5D - 0.3D; // - var20 = par2 + 0.5D + 0.3D; // / - var22 = par4 + 0.5D - 0.3D; - var24 = par4 + 0.5D + 0.3D; - var26 = par2 + 0.5D - 0.3D; // - var28 = par2 + 0.5D + 0.3D; // / - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - } - - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/e1fdd9f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/e1fdd9f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2397aa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/e1fdd9f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHornBill; -import com.ngb.projectzulu.common.mobs.models.ModelHornBill; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HornbillDeclaration extends SpawnableDeclaration { - - public HornbillDeclaration() { - super("Horn Bill", 36, EntityHornBill.class, EnumCreatureType.ambient); - setSpawnProperties(10, 25, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (26 << 16) + (19 << 8) + 15; - eggColor2 = (199 << 16) + (33 << 8) + 14; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/f0ee88792324001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/f0ee88792324001415179d45b0e27e9a deleted file mode 100644 index c904444..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/f0ee88792324001415179d45b0e27e9a +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/f14591e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/f14591e4c42100141fce95f06aba7e85 deleted file mode 100644 index ef93884..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2a/f14591e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,25 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public interface EntityDeclaration { - public abstract boolean shouldExist(); - - /** - * Returns the Entities Unique Identifier. Typically the Entity name, i.e. "Alligator" or "Red Finch" - */ - public abstract String getIdentifier(); - public abstract void loadCreaturesFromConfig(Configuration config); - public abstract void loadBiomesFromConfig(Configuration config); - public abstract void loadCustomMobData(File configDirectory); - public abstract void registerEntity(); - public abstract void registerEgg(); - public abstract void addSpawn(); - - @SideOnly(Side.CLIENT) - public abstract void registerModelAndRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0012c6f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0012c6f6c42100141fce95f06aba7e85 deleted file mode 100644 index 4c00f9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/0012c6f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public class GuiContainerUniversalFlowerPot extends GuiContainer { - public final static ResourceLocation FLOWERPOT_GUI = new ResourceLocation(DefaultProps.coreKey, - "gui/FlowerPotGUI.png"); - - public GuiContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntity) { - super(new ContainerUniversalFlowerPot(inventoryPlayer, tileEntity)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Flower Pot", 8, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(FLOWERPOT_GUI); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/10a029f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/10a029f5c42100141fce95f06aba7e85 deleted file mode 100644 index 98837f1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/10a029f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/201db501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/201db501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca71647..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/201db501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/61749ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/61749ce5c42100141fce95f06aba7e85 deleted file mode 100644 index e07ef90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/61749ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,213 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/705b75fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/705b75fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3bc18ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/705b75fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,165 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c007eda0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c007eda0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1e6243d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c007eda0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,367 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c055ec9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c055ec9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43fb0bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c055ec9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,103 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c0e97cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c0e97cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 51f5566..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c0e97cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,349 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c26c71e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c26c71e5c42100141fce95f06aba7e85 deleted file mode 100644 index 52be4ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c26c71e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseRandom; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c2d018f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c2d018f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1bc607d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/c2d018f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/e09e59ac9a22001414aab7e331350948 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/e09e59ac9a22001414aab7e331350948 deleted file mode 100644 index f0cdb83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/e09e59ac9a22001414aab7e331350948 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f0c06f11beab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f0c06f11beab00141ee9bf3050c1025b new file mode 100644 index 0000000..b301876 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f0c06f11beab00141ee9bf3050c1025b @@ -0,0 +1,292 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(6); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.grass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(50) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f1476cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f1476cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 95a3cc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2b/f1476cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,143 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/008c5fe8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/008c5fe8c42100141fce95f06aba7e85 deleted file mode 100644 index 000e3a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/008c5fe8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/31188c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/31188c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9fa6dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/31188c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/70b1d79dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/70b1d79dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c8212d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/70b1d79dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/81ef5ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/81ef5ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 98a7f14..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/81ef5ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockWateredDirt; -import projectzulu.common.blocks.ItemWateredDirt; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/900127f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/900127f8c42100141fce95f06aba7e85 deleted file mode 100644 index a840d39..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/900127f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCarved; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/9013ff00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/9013ff00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 004e702..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/9013ff00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/903bce9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/903bce9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7e4971d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/903bce9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,52 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelPenguinHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelPenguinHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 24F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/909f5af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/909f5af9c42100141fce95f06aba7e85 deleted file mode 100644 index 6650448..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/909f5af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/a13cf89ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/a13cf89ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c7b234d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/a13cf89ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,157 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/c1f053fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/c1f053fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ceb4169..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/c1f053fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/d06ae3a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/d06ae3a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7717a0a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/d06ae3a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,345 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/10522af7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/10522af7c42100141fce95f06aba7e85 deleted file mode 100644 index 7a84eb3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/10522af7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/1088f600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/1088f600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d658ae0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/1088f600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityGenericAnimal theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityGenericAnimal par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/300777e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/300777e4c42100141fce95f06aba7e85 deleted file mode 100644 index 54de43c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/300777e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50224a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50224a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8552024..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50224a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50540ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50540ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 441b7cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/50540ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/800f379ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/800f379ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ea2c846..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/800f379ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,151 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityUniversalFlowerPot extends TileEntity implements IInventory { - - private ItemStack[] inventory; - - public TileEntityUniversalFlowerPot() { - inventory = new ItemStack[1]; - } - - @Override - public int getSizeInventory() { - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public ItemStack decrStackSize(int slot, int amt) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize <= amt) { - setInventorySlotContents(slot, null); - } else { - stack = stack.splitStack(amt); - if (stack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - setInventorySlotContents(slot, null); - } - return stack; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this - && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - - NBTTagList itemList = new NBTTagList(); - for (int i = 0; i < inventory.length; i++) { - ItemStack stack = inventory[i]; - if (stack != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) i); - stack.writeToNBT(tag); - itemList.appendTag(tag); - } - } - tagCompound.setTag("Inventory", itemList); - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/825031fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/825031fac42100141fce95f06aba7e85 deleted file mode 100644 index da536cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/825031fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelArmadilloHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADPIECE; - - public ModelArmadilloHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADPIECE.Ear2", 17, 0); - setTextureOffset("HEADPIECE.Ear1", 17, 0); - setTextureOffset("HEADPIECE.nose", 12, 9); - setTextureOffset("HEADPIECE.chin", 0, 8); - setTextureOffset("HEADPIECE.head", 0, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - HEADPIECE.setRotationPoint(0F, 0F, 2.5F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - HEADPIECE.addBox("Ear2", -4F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("Ear1", 2F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("nose", -0.5F, 1.5F, -7F, 1, 1, 2); - HEADPIECE.addBox("chin", -1.5F, -0.5F, -5.5F, 3, 3, 3); - HEADPIECE.addBox("head", -2.5F, -2.5F, -2.5F, 5, 5, 3); - CENTERROT.addChild(HEADPIECE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90e150e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90e150e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2bb5234..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/90e150e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,42 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluStairs; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/b07a7de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/b07a7de5c42100141fce95f06aba7e85 deleted file mode 100644 index 22fcd19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/b07a7de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPenguin; -import projectzulu.common.mobs.models.ModelPenguin; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PenguinDeclaration extends SpawnableDeclaration { - - public PenguinDeclaration() { - super("Penguin", 14, EntityPenguin.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (22 << 16) + (16 << 8) + 13; - eggColor2 = (235 << 16) + (235 << 8) + 235; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/b181f39ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/b181f39ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a4dca28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/b181f39ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; -import net.minecraft.util.MathHelper; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/d00817a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/d00817a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cd68e3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/d00817a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.Properties; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/d1810ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/d1810ef6c42100141fce95f06aba7e85 deleted file mode 100644 index 5888ffe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/d1810ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/e17373f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/e17373f8c42100141fce95f06aba7e85 deleted file mode 100644 index c5e1d50..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/e17373f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,52 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHeal2 extends PotionZulu { - - public PotionHeal2(int par1, boolean par2) { - super(par1, par2, 16262179); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - par1EntityLiving.heal(amplifier * 3); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/f1b8729ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/f1b8729ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9548460..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2d/f1b8729ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,129 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData() - .func_150283_g(nodeList.get(clickedIndex).getData().getId()), nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/102f27f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/102f27f5c42100141fce95f06aba7e85 deleted file mode 100644 index 8896c13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/102f27f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/108288e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/108288e6c42100141fce95f06aba7e85 deleted file mode 100644 index c6c5291..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/108288e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,220 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEnd implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - return getWallBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall); - } else { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/10ff979fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/10ff979fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5734cca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/10ff979fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/211db501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/211db501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 670c03c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/211db501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/30754cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/30754cf6c42100141fce95f06aba7e85 deleted file mode 100644 index 67e1fbf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/30754cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,84 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short length = par0DataInputStream.readShort(); - if (length < 0) - return null; - else { - byte[] compressed = new byte[length]; - par0DataInputStream.readFully(compressed); - return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed)); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/31cdeaf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/31cdeaf5c42100141fce95f06aba7e85 deleted file mode 100644 index e205f8c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/31cdeaf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityGreenFinch extends EntityFinch{ - - public EntityGreenFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/40b252a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/40b252a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8506d03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/40b252a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWaterBreathing extends SubItemPotionGeneric { - - public SubItemPotionWaterBreathing(Item itemID, int subID) { - super(itemID, subID, "potion.waterBreathing"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.waterBreathing); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/51436ee6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/51436ee6c42100141fce95f06aba7e85 deleted file mode 100644 index ca7e40a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/51436ee6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/609472f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/609472f9c42100141fce95f06aba7e85 deleted file mode 100644 index 49f38c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/609472f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/613cd4f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/613cd4f9c42100141fce95f06aba7e85 deleted file mode 100644 index c886707..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/613cd4f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,204 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityTombstone extends TileEntity { - /* List of Items this Tombstone will Empty Upon Right-Clicking */ - private ArrayList deathItems = new ArrayList(); - public int experience = 0; - private EntityXPOrb xpOrb = null; - - public EntityXPOrb getEntityOrb() { - if (hasDrops()) { - if (xpOrb == null) { - xpOrb = new EntityXPOrb(worldObj, xCoord, yCoord, zCoord, worldObj.rand.nextInt(5) + 1); - } - return xpOrb; - } - return null; - } - - public boolean addDrop(ItemStack itemDrop) { - return deathItems.add(itemDrop); - } - - public boolean hasDrops() { - return !deathItems.isEmpty() || experience > 0; - } - - /* Give items in Tombstone to Player */ - public void giveItemsToPlayer(EntityPlayer player) { - player.addExperience(experience); - experience = 0; - - Iterator unSortIterator = deathItems.iterator(); - boolean itemAdded = true; - while (unSortIterator.hasNext() && itemAdded) { - ItemStack deathItem = unSortIterator.next(); - itemAdded = player.inventory.addItemStackToInventory(deathItem); - if (itemAdded) { - unSortIterator.remove(); - } - } - } - - /** An array of four strings storing the lines of text on the sign. */ - public String[] signText; - public final int maxLines = 7; - public final int maxcharPerLine = 13; - - /** - * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only - * really used when the > < are going to be visible. - */ - public int lineBeingEdited = -1; - private boolean isEditable = true; - - public TileEntityTombstone() { - signText = new String[maxLines]; - for (int i = 0; i < signText.length; i++) { - signText[i] = ""; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - for (int i = 0; i < signText.length; i++) { - if (signText[i].length() > 0) { - tagCompound.setString("Text" + (i + 1), signText[i]); - } - } - tagCompound.setInteger("Experience", experience); - addItemsToCompound(tagCompound, "DeathItems", deathItems); - } - - private void addItemsToCompound(NBTTagCompound tileCompound, String itemTagName, List items) { - NBTTagList itemsTag = new NBTTagList(); - for (ItemStack itemStack : items) { - NBTTagCompound tag = new NBTTagCompound(); - itemStack.writeToNBT(tag); - itemsTag.appendTag(tag); - } - tileCompound.setTag(itemTagName, itemsTag); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - this.isEditable = false; - super.readFromNBT(tagCompound); - for (int i = 0; i < signText.length; ++i) { - this.signText[i] = tagCompound.getString("Text" + (i + 1)); - if (this.signText[i].length() > maxcharPerLine) { - this.signText[i] = this.signText[i].substring(0, maxcharPerLine); - } - } - experience = tagCompound.hasKey("Experience") ? tagCompound.getInteger("Experience") : 0; - deathItems = readItemsFromCompound(tagCompound, "DeathItems"); - } - - public ArrayList readItemsFromCompound(NBTTagCompound tileCompound, String itemTagName) { - ArrayList items = new ArrayList(); - if (tileCompound.hasKey(itemTagName)) { - NBTTagList itemsTag = (NBTTagList) tileCompound.getTag(itemTagName); - for (int i = 0; i < itemsTag.tagCount(); i++) { - ItemStack itemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) itemsTag.getCompoundTagAt(i)); - if (itemStack != null) { - items.add(itemStack); - } - } - } - return items; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - public void setSignString(String inputString) { - String[] words = inputString.split(" "); - int startWord = 0; - for (int currentLine = 0; currentLine < signText.length; currentLine++) { - StringBuilder currentLineText = new StringBuilder(maxcharPerLine); - /* Add Words until Line is full */ - for (int i = startWord; i < words.length; i++) { - String currentWord = getFilteredWord(words[i]); - - if (currentLineText.length() + (currentLineText.length() != 0 ? 1 : 0) + currentWord.length() <= maxcharPerLine) { - if (currentLineText.length() != 0) { - currentLineText.append(" "); - } - currentLineText.append(currentWord); - /* If This is the last line, we want to write the text */ - if (i + 1 >= words.length) { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i + 1; - break; - } - } else { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i; - break; - } - } - } - } - - /** - * Handlers filtering word if it is invalid in some way, such as truncating a word that is too long. - */ - private String getFilteredWord(String word) { - return word.length() > maxcharPerLine ? word.substring(0, maxcharPerLine - 2).concat(".") : word; - } - - @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() { - return 16384.0D; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/70353be0c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/70353be0c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1a368de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/70353be0c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,353 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - 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(vec3, vec31); - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/70b997e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/70b997e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5853d75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/70b997e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,211 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGiraffe; - -public class ModelGiraffe extends ModelBase { - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer tail; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - private ModelRenderer HEADROT; - - public ModelGiraffe() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT1.neck1", 103, 36); - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - body = new ModelRenderer(this, 0, 24); - body.addBox(-7F, -16F, -23F, 14, 16, 24); - body.setRotationPoint(0F, 5F, 11F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 56, 12); - body2.addBox(-5F, -28F, 2F, 10, 21, 12); - body2.setRotationPoint(0F, 5F, 11F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 1.047198F, 0F, 0F); - body3 = new ModelRenderer(this, 92, 0); - body3.addBox(-4.5F, -26F, -23F, 11, 10, 6); - body3.setRotationPoint(-1F, 5F, 11F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 0); - leg1.addBox(-2F, 0F, -2F, 4, 19, 4); - leg1.setRotationPoint(-5F, 5F, -9F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 18, 0); - leg2.addBox(-2F, 0F, -2F, 4, 19, 4); - leg2.setRotationPoint(5F, 5F, -9F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 36, 0); - leg3.addBox(-2F, 0F, -2F, 4, 19, 4); - leg3.setRotationPoint(-5F, 5F, 9F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 24); - leg4.addBox(-2F, 0F, -2F, 4, 19, 4); - leg4.setRotationPoint(5F, 5F, 9F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - tail = new ModelRenderer(this, 54, 0); - tail.addBox(-1F, 0F, 0F, 2, 17, 2); - tail.setRotationPoint(0F, -8F, 12F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -21F, -9F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -3F, -3F, -3F, 6, 3, 6); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - body2.render(f5); - body3.render(f5); - leg1.render(f5); - leg2.render(f5); - leg3.render(f5); - leg4.render(f5); - tail.render(f5); - NECKROT1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -45), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityGiraffe var5 = (EntityGiraffe) par1EntityLiving; - /* State Animation Rotations */ - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg1.rotateAngleZ = (float) (0 * Math.PI / 180); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg2.rotateAngleZ = (float) (0 * Math.PI / 180); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - float minTime; - float maxTime; - if (var5.getAnimTime() > 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/71ed3ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/71ed3ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c5f1b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/71ed3ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockAloeVera; -import projectzulu.common.blocks.ItemAloeVera; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/911f97a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/911f97a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1d2f276..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/911f97a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,196 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.blocks.ModelTombstone; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/91fecffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/91fecffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index df43b34..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/91fecffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.models.ModelEagle; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/b1f280f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/b1f280f6c42100141fce95f06aba7e85 deleted file mode 100644 index 3fc009c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/b1f280f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/d0e50ffac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/d0e50ffac42100141fce95f06aba7e85 deleted file mode 100644 index f3d3fa5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/d0e50ffac42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockCreeperBlossom; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CreeperBlossomDeclaration extends BlockDeclaration { - - public CreeperBlossomDeclaration() { - super("CreeperBlossom"); - } - - @Override - protected boolean createBlock() { - BlockList.creeperBlossom = Optional.of(new BlockCreeperBlossom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.creeperBlossom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/d116d401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/d116d401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ed28418..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/d116d401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e052a9a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e052a9a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a9f4fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e052a9a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.models.ModelArmadillo; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ArmadilloDeclaration extends SpawnableDeclaration { - - public ArmadilloDeclaration() { - super("Armadillo", 0, EntityArmadillo.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 2, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (116 << 16) + (64 << 8) + 33; - eggColor2 = (60 << 16) + (51 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e1dc0fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e1dc0fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 464644a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/e1dc0fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.grass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(50) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/f24dc301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/f24dc301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d4174bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2e/f24dc301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/00ec342bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/00ec342bc52100141fce95f06aba7e85 deleted file mode 100644 index 28ccce0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/00ec342bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/02ce69a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/02ce69a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3496413..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/02ce69a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,419 +0,0 @@ -package projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/202b2f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/202b2f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2a2ad6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/202b2f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRedFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedFinchDeclaration extends SpawnableDeclaration { - - public RedFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/3261f49dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/3261f49dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41a9242..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/3261f49dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockNightBloom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/512ce99fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/512ce99fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0f2bace..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/512ce99fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/609ea0f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/609ea0f8c42100141fce95f06aba7e85 deleted file mode 100644 index 352bfdf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/609ea0f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,222 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelPenguin extends ModelBase { - private ModelRenderer BODYROT; - private ModelRenderer TAILROT; - private ModelRenderer HEADROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer WINGLEFROT; - private ModelRenderer LEGLEFROT; - private ModelRenderer FOOTLEFROT; - private ModelRenderer TOELEF2ROT; - private ModelRenderer TOELEF1ROT; - private ModelRenderer TOELEF3ROT; - private ModelRenderer LEGRIGROT; - private ModelRenderer FOOTRIGROT; - private ModelRenderer TOERIG2ROT; - private ModelRenderer TOERIG1ROT; - private ModelRenderer TOERIG3ROT; - - public ModelPenguin() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 13); - setTextureOffset("BODYROT.bodydec", 37, 0); - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - setTextureOffset("TAILROT.tail3", 50, 11); - setTextureOffset("TAILROT.tail2", 40, 11); - setTextureOffset("TAILROT.tail1", 30, 11); - setTextureOffset("WINGRIGROT.wingrig", 44, 15); - setTextureOffset("WINGLEFROT.winglef", 30, 15); - setTextureOffset("LEGLEFROT.leglef", 52, 0); - setTextureOffset("TOELEF2ROT.toelefbase2", 56, 7); - setTextureOffset("TOELEF2ROT.toelefclaw2", 60, 19); - setTextureOffset("TOELEF2ROT.toeleftop2", 58, 16); - setTextureOffset("TOELEF1ROT.toelefbase1", 56, 7); - setTextureOffset("TOELEF1ROT.toelefclaw1", 60, 19); - setTextureOffset("TOELEF1ROT.toeleftop1", 58, 16); - setTextureOffset("TOELEF3ROT.toelefbase3", 56, 7); - setTextureOffset("TOELEF3ROT.toelefclaw3", 60, 19); - setTextureOffset("TOELEF3ROT.toeleftop3", 58, 16); - setTextureOffset("LEGRIGROT.legrig", 52, 0); - setTextureOffset("TOERIG2ROT.toerigbase2", 56, 7); - setTextureOffset("TOERIG2ROT.toerigclaw2", 60, 19); - setTextureOffset("TOERIG2ROT.toerigtop2", 58, 16); - setTextureOffset("TOERIG1ROT.toerigbase1", 56, 7); - setTextureOffset("TOERIG1ROT.toerigclaw1", 60, 19); - setTextureOffset("TOERIG1ROT.toerigtop1", 58, 16); - setTextureOffset("TOERIG3ROT.toerigbase3", 56, 7); - setTextureOffset("TOERIG3ROT.toerigclaw3", 60, 19); - setTextureOffset("TOERIG3ROT.toerigtop3", 58, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -4.5F, -10F, -4F, 9, 13, 6); - BODYROT.addBox("bodydec", -3F, -7.5F, -5F, 6, 9, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -10F, -1.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tail3.mirror = true; - TAILROT.addBox("tail3", -1F, 1F, 2F, 2, 1, 3); - // tail3.mirror = false; - TAILROT.addBox("tail2", -1.5F, 0F, 0F, 3, 2, 2); - TAILROT.addBox("tail1", -2F, -1F, -1F, 4, 3, 1); - BODYROT.addChild(TAILROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(4.5F, -10F, -1F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGRIGROT); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-4.5F, -10F, -1F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGLEFROT); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-3F, 3F, -0.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("leglef", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTLEFROT = new ModelRenderer(this, "FOOTLEFROT"); - FOOTLEFROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTLEFROT, 0F, 0F, 0F); - FOOTLEFROT.mirror = true; - TOELEF2ROT = new ModelRenderer(this, "TOELEF2ROT"); - TOELEF2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOELEF2ROT, 0F, 0F, 0F); - TOELEF2ROT.mirror = true; - TOELEF2ROT.addBox("toelefbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF2ROT.addBox("toelefclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF2ROT.addBox("toeleftop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF2ROT); - TOELEF1ROT = new ModelRenderer(this, "TOELEF1ROT"); - TOELEF1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOELEF1ROT, 0F, 0F, 0F); - TOELEF1ROT.mirror = true; - TOELEF1ROT.addBox("toelefbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF1ROT.addBox("toelefclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF1ROT.addBox("toeleftop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF1ROT); - TOELEF3ROT = new ModelRenderer(this, "TOELEF3ROT"); - TOELEF3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOELEF3ROT, 0F, 0F, 0F); - TOELEF3ROT.mirror = true; - TOELEF3ROT.addBox("toelefbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF3ROT.addBox("toelefclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF3ROT.addBox("toeleftop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF3ROT); - LEGLEFROT.addChild(FOOTLEFROT); - BODYROT.addChild(LEGLEFROT); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(3F, 3F, -0.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("legrig", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTRIGROT = new ModelRenderer(this, "FOOTRIGROT"); - FOOTRIGROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTRIGROT, 0F, 0F, 0F); - FOOTRIGROT.mirror = true; - TOERIG2ROT = new ModelRenderer(this, "TOERIG2ROT"); - TOERIG2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOERIG2ROT, 0F, 0F, 0F); - TOERIG2ROT.mirror = true; - TOERIG2ROT.addBox("toerigbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG2ROT.addBox("toerigclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG2ROT.addBox("toerigtop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG2ROT); - TOERIG1ROT = new ModelRenderer(this, "TOERIG1ROT"); - TOERIG1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOERIG1ROT, 0F, 0F, 0F); - TOERIG1ROT.mirror = true; - TOERIG1ROT.addBox("toerigbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG1ROT.addBox("toerigclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG1ROT.addBox("toerigtop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG1ROT); - TOERIG3ROT = new ModelRenderer(this, "TOERIG3ROT"); - TOERIG3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOERIG3ROT, 0F, 0F, 0F); - TOERIG3ROT.mirror = true; - TOERIG3ROT.addBox("toerigbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG3ROT.addBox("toerigclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG3ROT.addBox("toerigtop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG3ROT); - LEGRIGROT.addChild(FOOTRIGROT); - BODYROT.addChild(LEGRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -20), +20) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGRIGROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODYROT.rotateAngleZ = MathHelper.cos(par2 * 0.6662F * 2f) * 0.1F * par3; - - TAILROT.rotateAngleX = (float) (-20 * Math.PI / 180 + (MathHelper.cos(par2 * 0.6662F * 2f) * 0.5F * par3)); - - WINGRIGROT.rotateAngleZ = -Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - WINGLEFROT.rotateAngleZ = Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - - TOELEF1ROT.rotateAngleY = (float) (10 * Math.PI / 180); - TOERIG3ROT.rotateAngleY = (float) (-10 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/60ec6e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/60ec6e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 313e859..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/60ec6e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,349 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/611946a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/611946a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a18dc98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/611946a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCampfire; -import projectzulu.common.blocks.ItemCampFire; -import projectzulu.common.blocks.RenderCampFire; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/704911962624001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/704911962624001415179d45b0e27e9a deleted file mode 100644 index c3ba0a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/704911962624001415179d45b0e27e9a +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString((EntityPlayer) event.entity).toString(); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/a1eef8a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/a1eef8a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 45bcc09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/a1eef8a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,144 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/b08d5dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/b08d5dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6488219..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/b08d5dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/b16d269ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/b16d269ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 184c18f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/b16d269ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c06156fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c06156fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7158ec7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c06156fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c1d258fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c1d258fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index bbe968f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/c1d258fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/f03dcdf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/f03dcdf6c42100141fce95f06aba7e85 deleted file mode 100644 index c886707..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2f/f03dcdf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,204 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityTombstone extends TileEntity { - /* List of Items this Tombstone will Empty Upon Right-Clicking */ - private ArrayList deathItems = new ArrayList(); - public int experience = 0; - private EntityXPOrb xpOrb = null; - - public EntityXPOrb getEntityOrb() { - if (hasDrops()) { - if (xpOrb == null) { - xpOrb = new EntityXPOrb(worldObj, xCoord, yCoord, zCoord, worldObj.rand.nextInt(5) + 1); - } - return xpOrb; - } - return null; - } - - public boolean addDrop(ItemStack itemDrop) { - return deathItems.add(itemDrop); - } - - public boolean hasDrops() { - return !deathItems.isEmpty() || experience > 0; - } - - /* Give items in Tombstone to Player */ - public void giveItemsToPlayer(EntityPlayer player) { - player.addExperience(experience); - experience = 0; - - Iterator unSortIterator = deathItems.iterator(); - boolean itemAdded = true; - while (unSortIterator.hasNext() && itemAdded) { - ItemStack deathItem = unSortIterator.next(); - itemAdded = player.inventory.addItemStackToInventory(deathItem); - if (itemAdded) { - unSortIterator.remove(); - } - } - } - - /** An array of four strings storing the lines of text on the sign. */ - public String[] signText; - public final int maxLines = 7; - public final int maxcharPerLine = 13; - - /** - * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only - * really used when the > < are going to be visible. - */ - public int lineBeingEdited = -1; - private boolean isEditable = true; - - public TileEntityTombstone() { - signText = new String[maxLines]; - for (int i = 0; i < signText.length; i++) { - signText[i] = ""; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - for (int i = 0; i < signText.length; i++) { - if (signText[i].length() > 0) { - tagCompound.setString("Text" + (i + 1), signText[i]); - } - } - tagCompound.setInteger("Experience", experience); - addItemsToCompound(tagCompound, "DeathItems", deathItems); - } - - private void addItemsToCompound(NBTTagCompound tileCompound, String itemTagName, List items) { - NBTTagList itemsTag = new NBTTagList(); - for (ItemStack itemStack : items) { - NBTTagCompound tag = new NBTTagCompound(); - itemStack.writeToNBT(tag); - itemsTag.appendTag(tag); - } - tileCompound.setTag(itemTagName, itemsTag); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - this.isEditable = false; - super.readFromNBT(tagCompound); - for (int i = 0; i < signText.length; ++i) { - this.signText[i] = tagCompound.getString("Text" + (i + 1)); - if (this.signText[i].length() > maxcharPerLine) { - this.signText[i] = this.signText[i].substring(0, maxcharPerLine); - } - } - experience = tagCompound.hasKey("Experience") ? tagCompound.getInteger("Experience") : 0; - deathItems = readItemsFromCompound(tagCompound, "DeathItems"); - } - - public ArrayList readItemsFromCompound(NBTTagCompound tileCompound, String itemTagName) { - ArrayList items = new ArrayList(); - if (tileCompound.hasKey(itemTagName)) { - NBTTagList itemsTag = (NBTTagList) tileCompound.getTag(itemTagName); - for (int i = 0; i < itemsTag.tagCount(); i++) { - ItemStack itemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) itemsTag.getCompoundTagAt(i)); - if (itemStack != null) { - items.add(itemStack); - } - } - } - return items; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - public void setSignString(String inputString) { - String[] words = inputString.split(" "); - int startWord = 0; - for (int currentLine = 0; currentLine < signText.length; currentLine++) { - StringBuilder currentLineText = new StringBuilder(maxcharPerLine); - /* Add Words until Line is full */ - for (int i = startWord; i < words.length; i++) { - String currentWord = getFilteredWord(words[i]); - - if (currentLineText.length() + (currentLineText.length() != 0 ? 1 : 0) + currentWord.length() <= maxcharPerLine) { - if (currentLineText.length() != 0) { - currentLineText.append(" "); - } - currentLineText.append(currentWord); - /* If This is the last line, we want to write the text */ - if (i + 1 >= words.length) { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i + 1; - break; - } - } else { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i; - break; - } - } - } - } - - /** - * Handlers filtering word if it is invalid in some way, such as truncating a word that is too long. - */ - private String getFilteredWord(String word) { - return word.length() > maxcharPerLine ? word.substring(0, maxcharPerLine - 2).concat(".") : word; - } - - @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() { - return 16384.0D; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/012b9f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/012b9f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c91fc31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/012b9f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/10a7f5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/10a7f5f9c42100141fce95f06aba7e85 deleted file mode 100644 index ed0aaca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/10a7f5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemFoodProjectZulu; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/11dfbde5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/11dfbde5c42100141fce95f06aba7e85 deleted file mode 100644 index d108923..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/11dfbde5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,100 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.BossHealthDisplayTicker; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/206bb673072100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/206bb673072100141769cb1ed0c338cd deleted file mode 100644 index be30e2c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/206bb673072100141769cb1ed0c338cd +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/30f5e2ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/30f5e2ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index dd94442..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/30f5e2ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/7029a6a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/7029a6a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 49280ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/7029a6a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world2; - -import org.apache.commons.lang3.tuple.Pair; - -/** - * For usage see: {@link Pair} - */ -public class BoundaryPair { - private final K lower; - private final V upper; - - public static BoundaryPair createPair(K lower, V upper) { - return new BoundaryPair(lower, upper); - } - - public BoundaryPair(K lower, V upper) { - this.lower = lower; - this.upper = upper; - } - - public K getLowerLimit() { - return lower; - } - - public V getUpperLimit() { - return upper; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/904cc8a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/904cc8a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 68b5fde..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/904cc8a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMammoth; -import projectzulu.common.mobs.models.ModelMammoth; -import projectzulu.common.mobs.renders.RenderMammoth; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/92fc8ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/92fc8ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 7f4da1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/92fc8ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/a185baffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/a185baffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index de6f48b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/a185baffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b0c2da00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b0c2da00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 634f73c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b0c2da00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,404 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b1737901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b1737901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c1cd6e4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/b1737901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/c16c71e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/c16c71e5c42100141fce95f06aba7e85 deleted file mode 100644 index afea021..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/c16c71e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseGrey; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/c1d018f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/c1d018f8c42100141fce95f06aba7e85 deleted file mode 100644 index 65bfb84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/c1d018f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/d1740dfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/d1740dfac42100141fce95f06aba7e85 deleted file mode 100644 index 7a84eb3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/d1740dfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/f0e00ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/f0e00ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 53dfefa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/f0e00ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.api; - -import projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/f17921ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/f17921ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 747abb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3/f17921ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.PotionList; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.potion.effects.PotionCleansing; -import projectzulu.common.potion.effects.PotionCurse; -import projectzulu.common.potion.effects.PotionHarm2; -import projectzulu.common.potion.effects.PotionHeal2; -import projectzulu.common.potion.effects.PotionIncendiary; -import projectzulu.common.potion.effects.PotionSlowFall; -import projectzulu.common.potion.effects.PotionThorns; -import projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/205594fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/205594fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 87c8e55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/205594fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,241 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Reminder: This is technically a 'Flying' Entity - */ -public class EntityFollower extends EntityLiving { - - EntityMaster masterEntity; - int followerIndex = -1; - - public int getFollowerIndex() { - return followerIndex; - } - - private Vec3 targetPosition = Vec3.createVectorHelper(0, 0, 0); - - public void setTargetPosition(Vec3 targetPosition) { - this.targetPosition = targetPosition; - } - - float targetRotation; - - public void setTargetRotation(float targetRotation) { - this.targetRotation = wrapAngleTo360(targetRotation); - } - - boolean shouldBeDying = false; - - /* Client Side Variable that Controls if it should Sync its Contents with Client Master */ - boolean isClientSetup = false; - - public EntityFollower(World par1World) { - super(par1World); - noClip = true; - setSize(0.65f, 0.5f); - } - - public EntityFollower(World par1World, double parx, double pary, double parz, EntityMaster masterEntity, - int followerIndex) { - this(par1World); - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.followerIndex = followerIndex; - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns False so that Entity doesn't Suffocate while in a wall - */ - @Override - public boolean isEntityInsideOpaqueBlock() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - - /* - * Note that the Client Side Entity will exists for several ticks before the masterEntity is Synced from server, - * So we only Check if should SetDead on Server - * - * Also, onReload, the Server will re-create its Children, this the old Children must dye. - */ - if (masterEntity == null && ticksExisted > 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/307bd4f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/307bd4f4c42100141fce95f06aba7e85 deleted file mode 100644 index 1c35aac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/307bd4f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/40f104ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/40f104ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index df69443..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/40f104ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,872 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/40f444e7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/40f444e7c42100141fce95f06aba7e85 deleted file mode 100644 index 0599b3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/40f444e7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,14 +0,0 @@ -package com.ngb.projectzulu.common; - -public class CommonProxyProjectZulu { - - public int addArmor(String armor) { - return 0; - } - - public void bossHealthTicker() { - } - - public void registerModelsAndRender() { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/5127ddf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/5127ddf7c42100141fce95f06aba7e85 deleted file mode 100644 index b96d91e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/5127ddf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/51aad1e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/51aad1e4c42100141fce95f06aba7e85 deleted file mode 100644 index 8ab6a9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/51aad1e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.EnumSet; -import java.util.HashMap; - -/** - * Represent the readable Tags for OptionalSettings - */ -public enum Key { - /* Category Tags */ - spawn("spawn", KeyParserSpawn.class), despawn("despawn", KeyParserDespawn.class), - - /* Properties */ - sky("sky", KeyParserSky.class), block("block", KeyParserBlock.class), blockFoot("blockFoot", - KeyParserBlockFoot.class), light("light", KeyParserLight.class), entityCap("cap", KeyParserEntityCap.class), spawnRange( - "spawnRange", KeyParserSpawnRange.class), maxSpawnRange("maxSpawnRange", KeyParserMaxSpawnRange.class), despawnAge( - "despawnAge", KeyParserDespawnAge.class), spawnRate("spawnRate", KeyParserSpawnRate.class), blockRange( - "blockRange", KeyParserBlockRange.class), material("material", null), minSpawnHeight("minSpawnHeight", - KeyParserMinHeight.class), maxSpawnHeight("maxSpawnHeight", KeyParserMaxHeight.class), normal("normal", - KeyParserNormalCube.class), liquid("liquid", KeyParserLiquid.class), opaque("opaque", - KeyParserOpaqueBlock.class), solidSide("solidSide", KeyParserSolidSide.class), difficulty("difficulty", - KeyParserDifficulty.class), torchLight("torchLight", KeyParserTorchLight.class), ground("ground", - KeyParserGround.class), top("top", KeyParserTop.class), fill("fill", KeyParserFill.class), modspawn( - "modSpawn", KeyParserModSpawn.class), origin("origin", KeyParserOrigin.class), players("players", - KeyParserPlayers.class), entities("entities", KeyParserEntities.class), random("random", - KeyParserRandom.class), writenbt("writenbt", KeyParserWriteNBT.class), - - /* Sub Tags */ - blockRangeX("blockRangeX", null), blockRangeY("blockRangeY", null), blockRangeZ("blockRangeZ", null), - - /**/ - UNKNOWN("", null); - - public final String key; - private static final HashMap lookupEnum = new HashMap(); - static { - for (Key key : EnumSet.allOf(Key.class)) - lookupEnum.put(key.key.toUpperCase(), key); - } - - public KeyParser keyParser; - - Key(String key, Class keyParserClass) { - this.key = key; - if (keyParserClass != null) { - try { - keyParser = keyParserClass.getConstructor(new Class[] { Key.class }).newInstance(new Object[] { this }); - } catch (Exception exception) { - exception.printStackTrace(); - return; - } - } - } - - /** - * Gets the Key associated with the String. Is not case Sensitive - * - * @param string - * @return - */ - public static Key getKeybyString(String string) { - Key value = lookupEnum.get(string.toUpperCase()); - if (value != null) { - return value; - } else { - return UNKNOWN; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/61efcce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/61efcce4c42100141fce95f06aba7e85 deleted file mode 100644 index 6048e32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/61efcce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,161 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import scala.annotation.meta.param; - -public class Node implements Comparable { - private Node parent; - private String name; - private List children = new ArrayList(); - - public Node(Node parent, String data) { - this.parent = parent; - parseDataForNode(data); - parseDataForChild(data); - } - - public Node getParent() { - return parent; - } - - public String getName() { - return name; - } - - /** - * Return Node name Concated after the name of its Parent(s) - * - * @return - */ - public String getFullName() { - return prefixParents(name); - } - - private String prefixParents(String name) { - if (parent != null && parent.parent != null && parent.parent.name.equals("root")) { - return parent.prefixParents(parent.name + ":" + name); - } else if (parent != null && !parent.name.equals("root")) { - return parent.prefixParents(parent.name + "." + name); - } else { - return name; - } - } - - public boolean addChild(String data) { - parseDataForChild(data); - return true; - } - - public Node getChild(int index) { - return children.get(index); - } - - public int numberOfChildren() { - return children.size(); - } - - public void sortNodeTree() { - Collections.sort(children); - for (Node child : children) { - child.sortNodeTree(); - } - } - - /** - * Return true if Name is Parsed from Data - */ - private boolean parseDataForNode(String data) { - String[] stringSplitData = data.split("\\.", 2); - this.name = stringSplitData[0]; - return true; - } - - /** - * Return true if Child is added from Data - */ - private boolean parseDataForChild(String data) { - String[] stringSplitData = data.split("\\.", 2); - if (stringSplitData.length < 2) { - return false; - } - String[] stringSplitChild = stringSplitData[1].split("\\.", 2); - - String childName = stringSplitChild[0]; - for (Node child : children) { - if (child.name.equals(childName)) { - child.addChild(stringSplitData[1]); - return true; - } - } - children.add(new Node(this, stringSplitData[1])); - return true; - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - Node otherNode = (Node) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (name == null) { - if (otherNode.name != null) { - return false; - } - } else if (!name.equals(otherNode.name)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } - - @Override - public int compareTo(Node node) { - if (node != null && node.children.size() > 0) { - if (children.size() > 0) { - return this.name.compareTo(node.name); - } else { - return +1; - } - } else if (this.children.size() > 0) { - return -1; - } - return this.name.compareTo(node.name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70895cfc0a2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70895cfc0a2100141769cb1ed0c338cd deleted file mode 100644 index ca1bb5a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/70895cfc0a2100141769cb1ed0c338cd +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entityai.RandomPositionGenerator; -//import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityCreature theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) this.targetEntity.posX, (double) this.targetEntity.posY, (double) this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/803c64f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/803c64f9c42100141fce95f06aba7e85 deleted file mode 100644 index 42f1ffc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/803c64f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,109 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/a0331501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/a0331501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index edead57..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/a0331501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCentipede; -import projectzulu.common.mobs.models.ModelCentipede; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/a1cbdefec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/a1cbdefec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b4642f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/a1cbdefec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseGrey; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/d11aabf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/d11aabf7c42100141fce95f06aba7e85 deleted file mode 100644 index 011c0fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/d11aabf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - - - -public class ModelTreeEntHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer NOSEROT; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer BACKTREESTEM6; - - public ModelTreeEntHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("BODYROT.mosscb2", 0, 28); - setTextureOffset("BODYROT.mosscb", 0, 20); - setTextureOffset("HEADROT.head", 88, 0); - setTextureOffset("HEADROT.brow5", 98, 18); - setTextureOffset("HEADROT.brow4", 98, 18); - setTextureOffset("HEADROT.brow3", 98, 18); - setTextureOffset("HEADROT.brow2", 106, 17); - setTextureOffset("HEADROT.brow1", 106, 13); - setTextureOffset("NOSEROT.nose1", 90, 16); - setTextureOffset("NOSEROT.nose2", 94, 20); - setTextureOffset("NOSEROT.nose3", 90, 22); - setTextureOffset("BACKTREESTEM5.backtreestem5", 32, 28); - setTextureOffset("BACKTREESTEM5.backtreesleaves5", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreesleaves6", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreestem6", 32, 28); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 24F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 0F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("mosscb2", -3.5F, -3F, 1F, 7, 3, 4); - BODYROT.addBox("mosscb", -4.5F, -3F, -3F, 9, 3, 4); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2.5F, -9F, -2.5F, 5, 12, 4); - HEADROT.addBox("brow5", 1.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow4", -0.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow3", -2.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow2", -2.5F, -3.5F, -3.5F, 5, 3, 1); - HEADROT.addBox("brow1", -2.5F, -7.5F, -3.5F, 5, 2, 1); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - NOSEROT.addBox("nose1", -0.5F, 0F, -2.5F, 1, 1, 2); - NOSEROT.addBox("nose2", -0.5F, 1F, -2.5F, 1, 1, 1); - NOSEROT.addBox("nose3", -1F, 2F, -3F, 2, 2, 2); - HEADROT.addChild(NOSEROT); - BODYROT.addChild(HEADROT); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BACKTREESTEM5.setRotationPoint(3F, -3F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - BACKTREESTEM5.addBox("backtreestem5", -0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addBox("backtreesleaves5", -3F, -7F, -3F, 6, 3, 6); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BACKTREESTEM6.setRotationPoint(-3F, -3F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - BACKTREESTEM6.addBox("backtreesleaves6", -3F, -7F, -3F, 6, 3, 6); - BACKTREESTEM6.addBox("backtreestem6", -0.5F, -4F, -0.5F, 1, 4, 1); - BODYROT.addChild(BACKTREESTEM6); - CENTERROT.addChild(BODYROT); - } - - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BACKTREESTEM5.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM5.rotateAngleZ = (float)(+20*Math.PI/180f); - - BACKTREESTEM6.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM6.rotateAngleZ = (float)(-20*Math.PI/180f); - - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/d15612fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/d15612fac42100141fce95f06aba7e85 deleted file mode 100644 index 714a992..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/d15612fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemCoconutItem; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f06f06fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f06f06fac42100141fce95f06aba7e85 deleted file mode 100644 index 6e7e8ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f06f06fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockZuluSlab; -import com.ngb.projectzulu.common.blocks.ItemZuluSlab; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeDoubleSlabDeclaration extends BlockDeclaration { - - public PalmTreeDoubleSlabDeclaration() { - super("PalmTreeDoubleSlab", 2); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeDoubleSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreeSlab.get(), - BlockList.palmTreePlank.get())).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeDoubleSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f0c4dcfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f0c4dcfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a062a66..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f0c4dcfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCreeperBlossom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CreeperBlossomDeclaration extends BlockDeclaration { - - public CreeperBlossomDeclaration() { - super("CreeperBlossom"); - } - - @Override - protected boolean createBlock() { - BlockList.creeperBlossom = Optional.of(new BlockCreeperBlossom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.creeperBlossom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f1c5c9e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f1c5c9e5c42100141fce95f06aba7e85 deleted file mode 100644 index 2978a2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/30/f1c5c9e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,184 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import projectzulu.common.core.RenderHelper; -import projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/00c9d2a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/00c9d2a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b577ce5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/00c9d2a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/2292ecffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/2292ecffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f667c62..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/2292ecffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.api.BlockList; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/306d57a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/306d57a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 521c87e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/306d57a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempArmor { - - /** - * Factor that adds to the current Player Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Item is Equipped - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/403f17f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/403f17f7c42100141fce95f06aba7e85 deleted file mode 100644 index fd1928d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/403f17f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeLog; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/409997f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/409997f4c42100141fce95f06aba7e85 deleted file mode 100644 index f231022..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/409997f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/416e88fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/416e88fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e2d6b55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/416e88fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/42bf539ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/42bf539ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 169e1c4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/42bf539ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,247 +0,0 @@ -package projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.core.packets.PacketStreamSound; -import projectzulu.common.core.packets.PacketTameParticle; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.mobs.packets.PacketAnimTime; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import projectzulu.common.mobs.packets.PacketNameSync; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/503600ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/503600ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 63c877c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/503600ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,351 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/50de61ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/50de61ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b877027..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/50de61ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/704afff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/704afff6c42100141fce95f06aba7e85 deleted file mode 100644 index 1da8df1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/704afff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockWateredDirt; -import com.ngb.projectzulu.common.blocks.ItemWateredDirt; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/70a96da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/70a96da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b338830..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/70a96da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90cfbcffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90cfbcffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 192366a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/90cfbcffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutSeed; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/91cb8701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/91cb8701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9b13b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/91cb8701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/b0e8b0ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/b0e8b0ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a80bccf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/b0e8b0ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAloeVeraSeeds; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c00aa5e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c00aa5e6c42100141fce95f06aba7e85 deleted file mode 100644 index 8e0e390..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c00aa5e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.world2; - -import java.util.EnumSet; -import java.util.Random; - -/** - * Two Dimensional Direction - */ -public enum Direction { - /* U = Up, D = Down, L = Left, R = Right */ - U(0, 0, 1), D(1, 0, -1), L(2, 1, 0), R(3, -1, 0), UL(4, 1, 1), UR(5, -1, 1), DL(6, 1, -1), DR(7, -1, -1); - - public final int x; - public final int z; - public final int id; - - Direction(int id, int x, int z) { - this.id = id; - this.x = x; - this.z = z; - } - - public static final Direction[] invert = { D, U, R, L, DR, DL, UR, UL }; - public static final Direction[] cwRotation = { UR, DL, UL, DR, U, R, L, D }; - public static final Direction[] ccwRotation = { UL, DR, DL, UR, L, U, D, R }; - - public Direction invert() { - return invert[id]; - } - - /* Rotate Direction by an Ordinal either Clockwise or CounterClockwise */ - public Direction rotateOrdinal(boolean clockwise) { - return clockwise ? cwRotation[id] : ccwRotation[id]; - } - - public static Direction getCardinal(Random random) { - return getCardinal(random.nextInt(4)); - } - - public static Direction getCardinal(int id) { - id = id & 3; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getCardinals() { - return EnumSet.of(U, D, L, R); - } - - public static Direction getOrdinal(Random random) { - return getOrdinal(random.nextInt(8)); - } - - public static Direction getOrdinal(int id) { - id = id & 7; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getOrdinals() { - return EnumSet.of(U, D, L, R, UL, UR, DL, DR); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c0bd0b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c0bd0b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index db49962..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c0bd0b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.models.ModelArmadillo; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ArmadilloDeclaration extends SpawnableDeclaration { - - public ArmadilloDeclaration() { - super("Armadillo", 0, EntityArmadillo.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 2, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (116 << 16) + (64 << 8) + 33; - eggColor2 = (60 << 16) + (51 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c25cbffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c25cbffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 004e702..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/c25cbffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/d1381ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/d1381ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cbd8e09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/31/d1381ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/118288e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/118288e6c42100141fce95f06aba7e85 deleted file mode 100644 index 43559de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/118288e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,176 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/203bb001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/203bb001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d3c636f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/203bb001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/404150a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/404150a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f091dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/404150a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/5049dc00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/5049dc00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 10a3d58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/5049dc00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/600af9fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/600af9fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d66a581..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/600af9fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/70756cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/70756cf5c42100141fce95f06aba7e85 deleted file mode 100644 index 2033f95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/70756cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityOstrich; -import com.ngb.projectzulu.common.mobs.models.ModelOstrich; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/714ff4fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/714ff4fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0236ac1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/714ff4fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/80870cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/80870cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e06c031..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/80870cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/b13d1efac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/b13d1efac42100141fce95f06aba7e85 deleted file mode 100644 index 790e033..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/b13d1efac42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/e00948fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/e00948fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c1f6766..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/32/e00948fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,577 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/00799e9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/00799e9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e6f0b3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/00799e9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/01ab62f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/01ab62f8c42100141fce95f06aba7e85 deleted file mode 100644 index cfea057..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/01ab62f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionBlindness extends SubItemPotionGeneric { - - public SubItemPotionBlindness(Item itemID, int subID) { - super(itemID, subID, "potion.blindness"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 2, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.blindness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/21e2c6a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/21e2c6a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb54ce0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/21e2c6a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/30ac09ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/30ac09ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 28bc461..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/30ac09ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,524 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/407b6bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/407b6bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7195af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/407b6bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryEdge implements Blueprint { - - List wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/5054fbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/5054fbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a5cdba6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/5054fbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,159 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/52acacf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/52acacf8c42100141fce95f06aba7e85 deleted file mode 100644 index 6eb9015..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/52acacf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,211 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGiraffe; - -public class ModelGiraffe extends ModelBase { - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer tail; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - private ModelRenderer HEADROT; - - public ModelGiraffe() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT1.neck1", 103, 36); - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - body = new ModelRenderer(this, 0, 24); - body.addBox(-7F, -16F, -23F, 14, 16, 24); - body.setRotationPoint(0F, 5F, 11F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 56, 12); - body2.addBox(-5F, -28F, 2F, 10, 21, 12); - body2.setRotationPoint(0F, 5F, 11F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 1.047198F, 0F, 0F); - body3 = new ModelRenderer(this, 92, 0); - body3.addBox(-4.5F, -26F, -23F, 11, 10, 6); - body3.setRotationPoint(-1F, 5F, 11F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 0); - leg1.addBox(-2F, 0F, -2F, 4, 19, 4); - leg1.setRotationPoint(-5F, 5F, -9F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 18, 0); - leg2.addBox(-2F, 0F, -2F, 4, 19, 4); - leg2.setRotationPoint(5F, 5F, -9F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 36, 0); - leg3.addBox(-2F, 0F, -2F, 4, 19, 4); - leg3.setRotationPoint(-5F, 5F, 9F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 24); - leg4.addBox(-2F, 0F, -2F, 4, 19, 4); - leg4.setRotationPoint(5F, 5F, 9F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - tail = new ModelRenderer(this, 54, 0); - tail.addBox(-1F, 0F, 0F, 2, 17, 2); - tail.setRotationPoint(0F, -8F, 12F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -21F, -9F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -3F, -3F, -3F, 6, 3, 6); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - body2.render(f5); - body3.render(f5); - leg1.render(f5); - leg2.render(f5); - leg3.render(f5); - leg4.render(f5); - tail.render(f5); - NECKROT1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -45), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityGiraffe var5 = (EntityGiraffe) par1EntityLiving; - /* State Animation Rotations */ - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg1.rotateAngleZ = (float) (0 * Math.PI / 180); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg2.rotateAngleZ = (float) (0 * Math.PI / 180); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - float minTime; - float maxTime; - if (var5.getAnimTime() > 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/618a48a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/618a48a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 01fb9a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/618a48a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutItem; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/713b3e9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/713b3e9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2551d05..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/713b3e9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/82323aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/82323aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5ed96ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/82323aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a00fc79dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a00fc79dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2a7d9b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a00fc79dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,127 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGiraffeHead extends ModelBase{ - - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - - public ModelGiraffeHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, 24F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - NECKROT2.render(f5); - } -// null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - // NECKROT1.rotateAngleX = (float) (75*Math.PI/180); - switch ((int)skullState) { - case 0: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - case 1: - NECKROT2.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) ( 5*Math.PI/180); - break; - default: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - } - NECKROT2.rotateAngleY = f3 / (180F / (float)Math.PI); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a12d1c00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a12d1c00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2ce966d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a12d1c00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a16ebcf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a16ebcf9c42100141fce95f06aba7e85 deleted file mode 100644 index 7da6b47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/a16ebcf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,120 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/c18c65f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/c18c65f4c42100141fce95f06aba7e85 deleted file mode 100644 index c6aa73e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/c18c65f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f04e43fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f04e43fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65e6f16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/33/f04e43fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,129 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData() - .func_150283_g(nodeList.get(clickedIndex).getData().getId()), nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/01c799f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/01c799f5c42100141fce95f06aba7e85 deleted file mode 100644 index c3559d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/01c799f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityCrocodile; -import com.ngb.projectzulu.common.mobs.models.ModelCrocodile; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/225681e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/225681e6c42100141fce95f06aba7e85 deleted file mode 100644 index 8578e9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/225681e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/30e3f0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/30e3f0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c035fc1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/30e3f0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,351 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/50d9ddf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/50d9ddf9c42100141fce95f06aba7e85 deleted file mode 100644 index 6470e86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/50d9ddf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,617 +0,0 @@ -package com.ngb.projectzulu.common.blocks.spike; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpike implements ISimpleBlockRenderingHandler { - - /* Leaving This here For Reference */ - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94216_b %s", var10.func_94216_b()); // 192 - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94212_f %s", var10.getMaxU()); // 0.5 - // ProjectZuluLog.info("func_94214_a %s", var10.getInterpolatedU(8D)); // 0: 0.46875, 8: 0.484375 - // ProjectZuluLog.info("func_94206_g %s", var10.getMinV()); // 0.375 - // ProjectZuluLog.info("func_94210_h %s", var10.getMaxV()); // 0.40625 - // ProjectZuluLog.info("func_94207_b %s", var10.func_94207_b(8D)); // 0: 0.375, 8: 0.390625 - // ProjectZuluLog.info("func_94215_i %s", var10.func_94215_i()); // NAME - // ProjectZuluLog.info("func_94213_j %s", var10.func_94213_j()); // 512 - // ProjectZuluLog.info("func_94208_k %s", var10.func_94208_k()); // 512 - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - return Render(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - } - - private boolean Render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - // // if (par1Block == Block.tallGrass) - // // { - // // long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; - // // var17 = var17 * var17 * 42317861L + var17 * 11L; - // // var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; - // // var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // } - if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars - || blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - // renderAsSpike(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - RenderFencePikes(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - - } else if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - boolean isNegZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - /* Check For Along Z */ - if (isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 0); - } else if (!isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 1); - } else if (isNegZ && !isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 2); - } - - /* Check For Along X */ - if (isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 0); - } else if (!isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 1); - } else if (isNegX && !isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 2); - } - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - drawSpikeCross(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - - } else { - // renderer.drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, - // var15, 1.0f); - drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - return true; - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block par1) { - return par1.isOpaqueCube() || par1 == Blocks.iron_bars || par1 == Blocks.glass; - } - - public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, - RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - 0.5D; - double var23 = par3 + 0.5D + 0.5D; - double var25 = par7 + 0.5D - 0.5D; - double var27 = par7 + 0.5D + 0.5D; - - switch (par2) { - case 0: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 1: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 2: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 3: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 4: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 5: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - case 6: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 7: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 8: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 9: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 10: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 11: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - default: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - } - } - - public void drawOnSide0(Tessellator tessellator, double par5, double var21, double var23, double var25, - double var27, double var13, double var15, double var17, double var19) { - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17); - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17); - } - - public void drawOnSide1(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide2(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide3(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide4(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide5(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - } - - public void RenderFencePikes(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 1f / 4f; - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 3f / 4f; - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - (0.625 - 0.375) / 2D; - double var23 = par3 + 0.5D + (0.625 - 0.375) / 2D; - double var25 = par7 + 0.5D - (0.625 - 0.375) / 2D; - double var27 = par7 + 0.5D + (0.625 - 0.375) / 2D; - - double maxY = 0.6; - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var15, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - - public void drawSpikeCross(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - /* Render Strip Along X */ - double var21 = par3 + 0.5D - 0.5; - double var23 = par3 + 0.5D + 0.5; - double var25 = par7 + 0.5D - 0.06; - double var27 = par7 + 0.5D + 0.06; - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - /* Render Strip Along Z */ - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - - // float var6 = 0.375F; - // float var7 = 0.625F; - maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - } - - public void drawSpikeStrip(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer, - Boolean alongX, int type) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13; - double var15; - double var17; - double var19; - - switch (type) { - case 1: - var13 = var10.getInterpolatedU(8D); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - case 2: - var13 = var10.getMinU(); - var15 = var10.getInterpolatedU(8D); // var10.getMaxU(); - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2f; // var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - default: - var13 = var10.getMinU(); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - } - - double var21; - double var23; - double var25; - double var27; - if (alongX) { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.0; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - - break; - case 2: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.0; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - default: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - } - - } else { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.0; - var27 = par7 + 0.5D + 0.5; - - break; - case 2: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.0; - - break; - default: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - break; - } - } - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - if (alongX) { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - } else { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/601767e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/601767e6c42100141fce95f06aba7e85 deleted file mode 100644 index 1f1be10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/601767e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/61e4aaa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/61e4aaa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0302188..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/61e4aaa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectLabyrinth; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/907ddb99eeac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/907ddb99eeac0014196dc3517d78505a new file mode 100644 index 0000000..7976d19 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/34/907ddb99eeac0014196dc3517d78505a @@ -0,0 +1,287 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelDeer extends ModelBase + { + float heightToRaise = 5f; + float renderScale = 1.3f; + + //fields + ModelRenderer top4hornRight; + ModelRenderer top4hornLeft; + ModelRenderer top3hornRight; + ModelRenderer top3hornLeft; + ModelRenderer top1hornRight; + ModelRenderer top1hornLeft; + ModelRenderer HEADROT; + ModelRenderer hornLeft; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer neck; + ModelRenderer BODYROT; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer tail; + ModelRenderer top2hornLeft; + ModelRenderer hornRight; + ModelRenderer top2hornRight; + + public ModelDeer() + { + textureWidth = 64; + textureHeight = 64; + + HEADROT = new ModelRenderer(this, 1, 19); + HEADROT.addBox(-1.5F, -6F, -7F, 5, 4, 7); + HEADROT.setRotationPoint(-2F, 4F - heightToRaise , -6F); + HEADROT.setTextureSize(64, 64); + HEADROT.mirror = true; + setRotation(HEADROT, 0.5230717F, 0F, 0F); + + earLeft = new ModelRenderer(this, 43, 33); + earLeft.addBox(0F, 1F, 0F, 1, 3, 1); + //earLeft.setRotationPoint(0F, 0.5F, -9F); + earLeft.setRotationPoint(2F, -3.5F, -2.0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, -2.199115F); + HEADROT.addChild(earLeft); + + earRight = new ModelRenderer(this, 50, 33); + earRight.addBox(-1F, 1F, 0F, 1, 3, 1); + //earRight.setRotationPoint(-2F, 0.5F, -9F); + earRight.setRotationPoint(-0.5F, -3.5F, -2.0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, 2.199115F); + HEADROT.addChild(earRight); + + hornLeft = new ModelRenderer(this, 8, 5); + hornLeft.addBox(0F, -3F, 0F, 1, 5, 1); + //hornLeft.setRotationPoint(0F, -3F, -9F); + hornLeft.setRotationPoint(2F, -8F, -2F); + hornLeft.setTextureSize(64, 64); + hornLeft.mirror = true; + setRotation(hornLeft, -0.5410521F, 0.1396263F, 0F); + HEADROT.addChild(hornLeft); + + hornRight = new ModelRenderer(this, 2, 5); + hornRight.addBox(-1F, -3F, 0F, 1, 5, 1); + //hornRight.setRotationPoint(-2F, -3F, -9F); + hornRight.setRotationPoint(0F, -8F, -2F); + hornRight.setTextureSize(64, 64); + hornRight.mirror = true; + setRotation(hornRight, -0.5410521F, -0.1396263F, 0F); + HEADROT.addChild(hornRight); + + top2hornLeft = new ModelRenderer(this, 21, 5); + top2hornLeft.addBox(0F, -3F, 0F, 1, 4, 1); + //top2hornLeft.setRotationPoint(0.3F, -5.5F, -8F); + top2hornLeft.setRotationPoint(0.3F, -3.5F, 0F); + top2hornLeft.setTextureSize(64, 64); + top2hornLeft.mirror = true; + setRotation(top2hornLeft, 0.6372665F, 0.0349066F, 0.0523599F); + hornLeft.addChild(top2hornLeft); + + top2hornRight = new ModelRenderer(this, 15, 5); + top2hornRight.addBox(-1F, -3F, 0F, 1, 4, 1); + //top2hornRight.setRotationPoint(-2.3F, -5.5F, -8F); + top2hornRight.setRotationPoint(0F, -3.5F, 0F); + top2hornRight.setTextureSize(64, 64); + top2hornRight.mirror = true; + setRotation(top2hornRight, 0.6372665F, -0.0349066F, -0.0523599F); + hornRight.addChild(top2hornRight); + + top1hornRight = new ModelRenderer(this, 41, 5); + top1hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top1hornRight.setRotationPoint(-2.4F, -7.5F, -8F); + top1hornRight.setRotationPoint(-0.4F, -2.0F, -0F); + top1hornRight.setTextureSize(64, 64); + top1hornRight.mirror = true; + setRotation(top1hornRight, 1.047198F, 0.1047198F, 0F); + top2hornRight.addChild(top1hornRight); + + top1hornLeft = new ModelRenderer(this, 41, 10); + top1hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top1hornLeft.setRotationPoint(0.5F, -7.5F, -8F); + top1hornLeft.setRotationPoint(0.5F, -2.0F, -0F); + top1hornLeft.setTextureSize(64, 64); + top1hornLeft.mirror = true; + setRotation(top1hornLeft, 1.047198F, -0.1047198F, 0F); + top2hornLeft.addChild(top1hornLeft); + + top3hornRight = new ModelRenderer(this, 34, 5); + top3hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top3hornRight.setRotationPoint(-2.2F, -5F, -8F); + top3hornRight.setRotationPoint(-0.2F, -2.0F, 0F); + top3hornRight.setTextureSize(64, 64); + top3hornRight.mirror = true; + setRotation(top3hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top3hornRight); + + top3hornLeft = new ModelRenderer(this, 34, 10); + top3hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top3hornLeft.setRotationPoint(0.2F, -5F, -8F); + top3hornLeft.setRotationPoint(0.2F, -2.0F, 0F); + top3hornLeft.setTextureSize(64, 64); + top3hornLeft.mirror = true; + setRotation(top3hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top3hornLeft); + + top4hornRight = new ModelRenderer(this, 28, 5); + top4hornRight.addBox(-1F, -3F, 0F, 1, 2, 1); + //top4hornRight.setRotationPoint(-2F, -2F, -8F); + top4hornRight.setRotationPoint(-0F, 1.5F, 1.5F); + top4hornRight.setTextureSize(64, 64); + top4hornRight.mirror = true; + setRotation(top4hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top4hornRight); + + top4hornLeft = new ModelRenderer(this, 28, 9); + top4hornLeft.addBox(0F, -3F, 0F, 1, 2, 1); + //top4hornLeft.setRotationPoint(0F, -2F, -8F); + top4hornLeft.setRotationPoint(0F, 1.5F, 1.5F); + top4hornLeft.setTextureSize(64, 64); + top4hornLeft.mirror = true; + setRotation(top4hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top4hornLeft); + + neck = new ModelRenderer(this, 28, 21); + neck.addBox(0F, -2F, -2F, 4, 3, 8); + neck.setRotationPoint(-3F, 2F - heightToRaise, -8F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, -0.9294653F, 0F, 0F); + BODYROT = new ModelRenderer(this, 28, 41); + BODYROT.addBox(-4F, -8F, -5F, 8, 15, 6); + BODYROT.setRotationPoint(-1F, 6F - heightToRaise, 1F); + BODYROT.setTextureSize(64, 64); + BODYROT.mirror = true; + setRotation(BODYROT, 1.570796F, 0F, 0F); + leg1 = new ModelRenderer(this, 0, 32); + leg1.addBox(-1F, 0F, -1F, 3, 10, 3); + leg1.setRotationPoint(-4F, 11F - heightToRaise, 6F); + leg1.setTextureSize(64, 64); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 13, 32); + leg2.addBox(-1F, 0F, -1F, 3, 10, 3); + leg2.setRotationPoint(1F, 11F - heightToRaise, 6F); + leg2.setTextureSize(64, 64); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 13, 49); + leg3.addBox(-2F, 0F, -1F, 3, 10, 3); + leg3.setRotationPoint(-3F, 11F - heightToRaise, -6F); + leg3.setTextureSize(64, 64); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 0, 49); + leg4.addBox(-1F, 0F, -1F, 3, 10, 3); + leg4.setRotationPoint(1F, 11F - heightToRaise, -6F); + leg4.setTextureSize(64, 64); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + tail = new ModelRenderer(this, 28, 34); + tail.addBox(-1F, 0F, 0F, 2, 1, 3); + tail.setRotationPoint(-1F, 5.5F - heightToRaise, 7F); + tail.setTextureSize(64, 64); + tail.mirror = true; + setRotation(tail, -0.4506874F, 0F, 0F); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //top4hornRight.render(f5); + //top4hornLeft.render(f5); + //top3hornRight.render(f5); + //top3hornLeft.render(f5); + //top2hornLeft.render(f5); + //top2hornRight.render(f5); + //top1hornRight.render(f5); + //top1hornLeft.render(f5); + //hornLeft.render(f5); + //hornRight.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Constant Animation Rotations */ + leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + + /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math + .log(par3 + 1))); + + earLeft.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1))); + earRight.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1)));*/ + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + + } + + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/01ada2fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/01ada2fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f809084..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/01ada2fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/215594fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/215594fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 801326c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/215594fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,149 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/50fce4a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/50fce4a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f4f6002..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/50fce4a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/601edd9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/601edd9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11ca5e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/601edd9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetTreasureDeadEnd implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetTreasureDeadEnd() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "deadend"; - } - - @Override - public int getWeight() { - return 50; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - cells[buildCoords.x][buildCoords.y].rawState = 2; - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 && ArchitectBase.isDeadEnd(cells, buildCoords, 1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1) { - if (random.nextInt(5) == 0) { - PyramidFeature terrainFeature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), terrainFeature.chestLootChance, - terrainFeature.chestMaxLoot); - - } else if (random.nextInt(4) == 0) { - return new MimicWithMeta(); - } - } - return new BlockWithMeta(Blocks.air); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/6199f6fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/6199f6fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c80f79f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/6199f6fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,190 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/61a843a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/61a843a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 30b6bc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/61a843a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/808ffaf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/808ffaf6c42100141fce95f06aba7e85 deleted file mode 100644 index 18ed9e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/808ffaf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCampFire extends ItemBlock { - - public ItemCampFire(Block block) { - super(block); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Block.getBlockFromItem(this).getIcon(2, par1); - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return "tile." - + BlockCampfire.Type.getTypeByMeta(itemstack.getItemDamage()).displayName().toLowerCase() - .replaceAll("\\s", ""); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/809999f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/809999f8c42100141fce95f06aba7e85 deleted file mode 100644 index e32a569..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/809999f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,524 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import com.ngb.projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/90edce9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/90edce9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 777aab8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/90edce9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/b0b84ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/b0b84ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 61eca55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/b0b84ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,133 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0461000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0461000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ec5dde2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0461000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c060d601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c060d601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ebcf6e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c060d601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,66 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0d8dce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0d8dce5c42100141fce95f06aba7e85 deleted file mode 100644 index 826e268..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/c0d8dce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/d0122e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/d0122e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 49bb5f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/d0122e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseWhite; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/d089e9f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/d089e9f4c42100141fce95f06aba7e85 deleted file mode 100644 index 763536f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/d089e9f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionBlindness; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionBubbling; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionCleansing; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionCurse; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionJump; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionResistance; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionThorns; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/f03a6fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/f03a6fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ba3899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/35/f03a6fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/108467a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/108467a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b67d03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/108467a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.ItemUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/206e6901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/206e6901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c743c31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/206e6901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/20e2c6a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/20e2c6a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7839452..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/20e2c6a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/220ff8a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/220ff8a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 56ac669..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/220ff8a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,169 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/30a785f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/30a785f9c42100141fce95f06aba7e85 deleted file mode 100644 index b5a7524..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/30a785f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,577 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/318e259fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/318e259fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 16d70e4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/318e259fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMimic; -import projectzulu.common.mobs.models.ModelMimic; -import projectzulu.common.mobs.renders.RenderMimic; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MimicDeclaration extends EggableDeclaration { - - public MimicDeclaration() { - super("Mimic", 11, EntityMimic.class, null); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - shouldDespawn = false; - - eggColor1 = (171 << 16) + (121 << 8) + 45; - eggColor2 = (143 << 16) + (105 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 5); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/404244e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/404244e5c42100141fce95f06aba7e85 deleted file mode 100644 index 0e74eb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/404244e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,114 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/40e14e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/40e14e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 16ce900..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/40e14e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,211 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGiraffe; - -public class ModelGiraffe extends ModelBase { - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer tail; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - private ModelRenderer HEADROT; - - public ModelGiraffe() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT1.neck1", 103, 36); - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - body = new ModelRenderer(this, 0, 24); - body.addBox(-7F, -16F, -23F, 14, 16, 24); - body.setRotationPoint(0F, 5F, 11F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 56, 12); - body2.addBox(-5F, -28F, 2F, 10, 21, 12); - body2.setRotationPoint(0F, 5F, 11F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 1.047198F, 0F, 0F); - body3 = new ModelRenderer(this, 92, 0); - body3.addBox(-4.5F, -26F, -23F, 11, 10, 6); - body3.setRotationPoint(-1F, 5F, 11F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 0); - leg1.addBox(-2F, 0F, -2F, 4, 19, 4); - leg1.setRotationPoint(-5F, 5F, -9F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 18, 0); - leg2.addBox(-2F, 0F, -2F, 4, 19, 4); - leg2.setRotationPoint(5F, 5F, -9F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 36, 0); - leg3.addBox(-2F, 0F, -2F, 4, 19, 4); - leg3.setRotationPoint(-5F, 5F, 9F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 24); - leg4.addBox(-2F, 0F, -2F, 4, 19, 4); - leg4.setRotationPoint(5F, 5F, 9F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - tail = new ModelRenderer(this, 54, 0); - tail.addBox(-1F, 0F, 0F, 2, 17, 2); - tail.setRotationPoint(0F, -8F, 12F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -21F, -9F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -3F, -3F, -3F, 6, 3, 6); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - body2.render(f5); - body3.render(f5); - leg1.render(f5); - leg2.render(f5); - leg3.render(f5); - leg4.render(f5); - tail.render(f5); - NECKROT1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -45), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityGiraffe var5 = (EntityGiraffe) par1EntityLiving; - /* State Animation Rotations */ - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg1.rotateAngleZ = (float) (0 * Math.PI / 180); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg2.rotateAngleZ = (float) (0 * Math.PI / 180); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - float minTime; - float maxTime; - if (var5.getAnimTime() > 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/41621e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/41621e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a8ab7da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/41621e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/51de74f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/51de74f9c42100141fce95f06aba7e85 deleted file mode 100644 index 766ba0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/51de74f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/60853cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/60853cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 495b847..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/60853cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,473 +0,0 @@ -//package com.ngb.projectzulu.common.temperature; -// -//import java.io.ByteArrayOutputStream; -//import java.io.DataInputStream; -//import java.io.DataOutputStream; -//import java.io.IOException; -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.entity.EntityLiving; -//import net.minecraft.entity.EntityLivingBase; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.entity.player.EntityPlayerMP; -//import net.minecraft.nbt.NBTTagCompound; -//import net.minecraft.network.packet.Packet250CustomPayload; -//import net.minecraft.potion.Potion; -//import net.minecraft.potion.PotionEffect; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -//import cpw.mods.fml.common.network.PacketDispatcher; -//import cpw.mods.fml.common.network.Player; -// -//public class TemperatureTicker implements ITickHandler, IPlayerTracker{ -// -// /* Temperature Used When Changint Dimensions or Loading into a World for the First Time */ -// private static float defaultTemperature = 0; -// /* Player Tempurature, Used to Calculate Effects and Display */ -// private static float playerTemperature = 0; -// private static Map temperatureMap = new HashMap(); -// /* Last World the Player was in, Used to Determine if the player has Switched worlds or Just Loaded Minecraft */ -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// /* Used For Displaying the Environment Temperature around a player, used in DisplayTemperatureTicker to mark the Temp. the Player Trending Towards in */ -// private static Map playerLocTempMap = new HashMap(); -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private short DirtyFlag = 0; -// public TemperatureTicker(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( temperatureMap.containsKey( player.getEntityName() ) ){ -// playerTemperature = temperatureMap.get( player.getEntityName() ); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP ){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// /* Read From File */ -// if ( HasPendingRead() ){ -// readNBTFromFile(player); -// ClearPendingRead(); -// } -// } -// -// /* Get Outside Temperature */ -// float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// float unTouchedPlayerLocationTemperature; -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// unTouchedPlayerLocationTemperature = playerLocTempMap.get(player.getEntityName()); -// }else { -// unTouchedPlayerLocationTemperature = playerLocationTemperature; -// } -// float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -// playerLocationTemperature += item.getLocationTemperatureFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getPlayerTempContributionFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// if(currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 3)); -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 1)); -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Save Temperature To Map*/ -// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -// if(player instanceof EntityPlayerMP){ -// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -// DataOutputStream data = new DataOutputStream(bytes); -//// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -// -// /* Write PacketID into Packet */ -// try { -// data.writeInt(1); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// /* Write Temperature Into Packet*/ -// try { -// data.writeFloat(playerTemperature); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// -// Packet250CustomPayload packet = new Packet250CustomPayload(); -// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -// packet.data = bytes.toByteArray(); -// packet.length = packet.data.length; -// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -//// System.out.println( player.getEntityName().concat("Sent Packet ")); -// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// nbttagcompound.setFloat(player.getEntityName().concat("Player Temperature"), playerTemperature); -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// if (nbttagcompound.hasKey( player.getEntityName().concat("Player Temperature") )){ -// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("Player Temperature") ); -// } -// } -// -// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -// -// /* Get Relevent Data From DataStream */ -// float tempTemp = playerTemperature; -// try { -// tempTemp = data.readFloat(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// /* Make Sure Player Exists, then Assign data to map */ -// if(temperatureMap.containsKey(sender.getEntityName())){ -// temperatureMap.put(sender.getEntityName(), tempTemp); -// } -// -// -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -// temperatureMap.put(player.getEntityName(), 0.0f); -// lastWorldNameMap.put(player.getEntityName(), ""); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// } -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// setPlayerToDefaultTemp(player); -// } -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -// setPlayerToDefaultTemp(player); -// } -// -// public void setPlayerToDefaultTemp(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70d2fbe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70d2fbe5c42100141fce95f06aba7e85 deleted file mode 100644 index 62e8ae8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/70d2fbe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/800b1cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/800b1cf5c42100141fce95f06aba7e85 deleted file mode 100644 index 24101a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/800b1cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/90bb6001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/90bb6001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 29af418..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/90bb6001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a01bd3f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a01bd3f4c42100141fce95f06aba7e85 deleted file mode 100644 index 82cf4ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/a01bd3f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/b0c5a9e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/b0c5a9e6c42100141fce95f06aba7e85 deleted file mode 100644 index ba742e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/b0c5a9e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/b18686f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/b18686f8c42100141fce95f06aba7e85 deleted file mode 100644 index e4ece1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/b18686f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.entity.Render; - -/** - * Interface to hide ClientSide Render in objects on Server when Side.Client is insufficient i.e. abstract methods - */ -public interface RenderWrapper { - public Render getRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/c2fd36ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/c2fd36ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b6e8956..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/c2fd36ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/e041af9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/e041af9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8de057b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/e041af9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,12 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; -import net.minecraft.init.Blocks; - -public class BlockZuluStairs extends BlockStairs { - public BlockZuluStairs(Block par2Block, int par3) { - super(par2Block, par3); - setLightOpacity(0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/e06c01e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/e06c01e5c42100141fce95f06aba7e85 deleted file mode 100644 index 1ccc1d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/e06c01e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityLimitedMobSpawnerRenderer extends TileEntitySpecialRenderer{ - public void renderTileEntityMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner, double xCoord, double yCoord, double zCoord, float par8){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)xCoord + 0.5F, (float)yCoord, (float)zCoord + 0.5F); - Entity var9 = limitedMobSpawner.getMobEntity(); - - if (var9 != null){ - var9.setWorld(limitedMobSpawner.getWorldObj()); - float var10 = 0.4375F; - GL11.glTranslatef(0.0F, 0.4F, 0.0F); - GL11.glRotatef((float)(limitedMobSpawner.yaw2 + (limitedMobSpawner.yaw - limitedMobSpawner.yaw2) * (double)par8) * 10.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.4F, 0.0F); - GL11.glScalef(var10, var10, var10); - var9.setLocationAndAngles(xCoord, yCoord, zCoord, 0.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, par8); - } - - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity par1TileEntity, double xCoord, double yCoord, double zCoord, float par8){ - this.renderTileEntityMobSpawner((TileEntityLimitedMobSpawner)par1TileEntity, xCoord, yCoord, zCoord, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/f035dffdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/f035dffdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6dc8467..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/f035dffdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/f0987e00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/f0987e00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 487394d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/36/f0987e00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/11a029f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/11a029f5c42100141fce95f06aba7e85 deleted file mode 100644 index 6d6d269..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/11a029f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; -import com.ngb.projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/213bb001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/213bb001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4e78dbc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/213bb001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/60577800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/60577800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb99a41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/60577800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.NBTWriter; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/707c38fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/707c38fac42100141fce95f06aba7e85 deleted file mode 100644 index fcaf38a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/707c38fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EntityCreeperBlossomPrimed extends Entity { - /** How long the fuse is */ - public int fuse; - - public EntityCreeperBlossomPrimed(World par1World) { - super(par1World); - this.fuse = 40; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; - } - - public EntityCreeperBlossomPrimed(World par1World, double par2, double par4, double par6) { - this(par1World); - this.setPosition(par2, par4, par6); - float var8 = (float) (Math.random() * Math.PI * 2.0D); - this.motionX = (double) (-((float) Math.sin((double) var8)) * 0.02F); - this.motionY = 0.20000000298023224D; - this.motionZ = (double) (-((float) Math.cos((double) var8)) * 0.02F); - this.fuse = 40; - this.prevPosX = par2; - this.prevPosY = par4; - this.prevPosZ = par6; - } - - @Override - protected void entityInit() { - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() { - return !this.isDead; - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.9800000190734863D; - this.motionY *= 0.9800000190734863D; - this.motionZ *= 0.9800000190734863D; - - if (this.onGround) { - this.motionX *= 0.699999988079071D; - this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - - if (this.fuse-- <= 0) { - this.setDead(); - - if (!this.worldObj.isRemote) { - this.explode(); - } - } else { - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - } - } - - private void explode() { - float var1 = 1.5F; - this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, var1, this.worldObj - .getGameRules().getGameRuleBooleanValue("mobGriefing")); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setByte("Fuse", (byte) this.fuse); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - this.fuse = par1NBTTagCompound.getByte("Fuse"); - } - - @SideOnly(Side.CLIENT) - @Override - public float getShadowSize() { - return 0.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/7174d9fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/7174d9fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 47cad4e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/7174d9fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBeige; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8008a700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8008a700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 073e1b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8008a700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,121 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8017f7e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8017f7e5c42100141fce95f06aba7e85 deleted file mode 100644 index df7e593..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/8017f7e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/80d3cbf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/80d3cbf5c42100141fce95f06aba7e85 deleted file mode 100644 index f028864..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/80d3cbf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/910bca9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/910bca9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca7e40a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/910bca9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/919530a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/919530a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1ba40d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/919530a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGorillaHead extends ModelBase{ - - ModelRenderer HEADROT; - - public ModelGorillaHead() - { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 23F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/a01b2aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/a01b2aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 25e6fc5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/a01b2aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.potion.effects; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.PotionEffect; - -public class PotionCurse extends PotionZulu { - - public PotionCurse(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(2, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - - /* Get Active Potion effect Collection from Entity */ - Collection potionEffects = effectedEntity.getActivePotionEffects(); - - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - /* Check if we Should Try to Get a PotionEffect, proportional to Potion Strength */ - if ((par2 + 1) * 25 + 25 - effectedEntity.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToAct = numOfElemenents > 0 ? effectedEntity.worldObj.rand.nextInt(numOfElemenents) : 0; - Iterator iterator = potionEffects.iterator(); - - /* Get Specific Element and assuming its not the Current Potion ID, mark it for Removal */ - int i = 0; - PotionEffect potionEffectToPerform = null; - while (iterator.hasNext() && i <= elementToAct) { - potionEffectToPerform = (PotionEffect) iterator.next(); - if (i == elementToAct && !effectedEntity.worldObj.isRemote && potionEffectToPerform != null - && potionEffectToPerform.getPotionID() != id) { - potionEffectToPerform.performEffect(effectedEntity); - break; - } - i++; - } - } - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b001b7f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b001b7f7c42100141fce95f06aba7e85 deleted file mode 100644 index 96a43af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b001b7f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelElephantHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - - public ModelElephantHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); -// setTextureOffset("EARLEFROT.earlef", 55, 41); -// setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 12F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -6F, 8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); -// EARLEFROT = new ModelRenderer(this, "EARLEFROT"); -// EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); -// setRotation(EARLEFROT, 0F, 1.22173F, 0F); -// EARLEFROT.mirror = true; -// EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARLEFROT); -// EARRIGROT = new ModelRenderer(this, "EARRIGROT"); -// EARRIGROT.setRotationPoint(7F, -0.5F, -4F); -// setRotation(EARRIGROT, 0F, -1.22173F, 0F); -// EARRIGROT.mirror = true; -// EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - TRUNK1ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK2ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK3ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK4ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK5ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK6ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK7ROT.rotateAngleX = (float) (45*Math.PI/180); - -// switch ((int)skullState) { -// case 1: -// NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); -// break; -// -// default: -// NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); -// break; -// } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b1a6c1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b1a6c1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ce8d6b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/b1a6c1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/c2f8b69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/c2f8b69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0fc7033..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/c2f8b69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class MobSpawnerWithMeta extends BlockWithMeta { - - String mobName; - - public MobSpawnerWithMeta(String mobName) { - super(Blocks.mob_spawner); - this.mobName = mobName; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - /* Create Mob Spawner */ - world.setBlock(position.posX, position.posY, position.posZ, block); - TileEntityMobSpawner tileEntityMobSpawner = (TileEntityMobSpawner) world.getTileEntity(position.posX, - position.posY, position.posZ); - - if (tileEntityMobSpawner != null) { - tileEntityMobSpawner.func_145881_a().setEntityName(mobName); - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/e1d0ac9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/e1d0ac9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b3b1e35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/37/e1d0ac9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockWoodSlab; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockZuluSlab extends BlockWoodSlab { - - public static Block singleSlabID; - Block baseBlock; - - /** Single Slab Constructor */ - public BlockZuluSlab(Block baseBlock) { - super(false); - singleSlabID = this; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** Double Slab Constructor */ - public BlockZuluSlab(Block singleSlab, Block baseBlock) { - super(true); - singleSlabID = singleSlab; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - @Override - protected ItemStack createStackedBlock(int par1) { - return new ItemStack(singleSlabID, 2, par1 & 7); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return baseBlock.getIcon(par1, par2 & 7); - } - - @Override - public String func_150002_b(int par1) { - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(singleSlabID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/00f603a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/00f603a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3fcd3c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/00f603a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30e5ecf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30e5ecf4c42100141fce95f06aba7e85 deleted file mode 100644 index 56f5443..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/30e5ecf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.potion.effects.PotionCleansing; -import com.ngb.projectzulu.common.potion.effects.PotionCurse; -import com.ngb.projectzulu.common.potion.effects.PotionHarm2; -import com.ngb.projectzulu.common.potion.effects.PotionHeal2; -import com.ngb.projectzulu.common.potion.effects.PotionIncendiary; -import com.ngb.projectzulu.common.potion.effects.PotionSlowFall; -import com.ngb.projectzulu.common.potion.effects.PotionThorns; -import com.ngb.projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/326d57a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/326d57a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca7a128..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/326d57a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a temperature Item - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempItem { - - /** - * Factor that adds to the current Player Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public Float getPlayerTempContributionFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public Float getLocationTemperatureFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate when the Item is in hand - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/402b4af6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/402b4af6c42100141fce95f06aba7e85 deleted file mode 100644 index dba2e6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/402b4af6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/41d3209fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/41d3209fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 52be4ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/41d3209fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseRandom; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/8185ccf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/8185ccf7c42100141fce95f06aba7e85 deleted file mode 100644 index fe41ac5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/8185ccf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/8297bee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/8297bee4c42100141fce95f06aba7e85 deleted file mode 100644 index 0b2adff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/8297bee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; - -import org.lwjgl.util.Point; - -public interface DataFields { - - public abstract boolean isEnabled(); - - public abstract void setIsEnabled(boolean isEnabled); - - public abstract DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize); - - public abstract void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID); - - public abstract void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner); - - public abstract boolean keyboardInput(char keyChar, int keyID); - - public abstract void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3); - - public abstract void mouseHover(int par1, int par2, int par3); - - public abstract void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c167dae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c167dae5c42100141fce95f06aba7e85 deleted file mode 100644 index 3c3394a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/c167dae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.effects; - -public class PotionThorns extends PotionZulu { - - public PotionThorns(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/d095509fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/d095509fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5493676..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/d095509fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummyPharaoh extends ModelBiped { - - /** - * Sets the models various rotation angles. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/d19f7e9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/d19f7e9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a56da39..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/d19f7e9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/e0ada5f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/e0ada5f5c42100141fce95f06aba7e85 deleted file mode 100644 index 217ff50..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/e0ada5f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAIBase; - -public class EntityAISmoothSwimming extends EntityAIBase{ - private EntityLiving theEntity; - private boolean smootherSwimming = false; - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving){ - this.theEntity = par1EntityLiving; - this.setMutexBits(4); - par1EntityLiving.getNavigator().setCanSwim(true); - } - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving, boolean smootherSwimming){ - this(par1EntityLiving); - this.smootherSwimming = smootherSwimming; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - - /** - * Updates the task - */ - public void updateTask(){ -// if(smootherSwimming -//// && this.theEntity.getRNG().nextFloat() < 0.8F -//// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ) -// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ)){ -// this.theEntity.getJumpHelper().setJumping(); -// } - - if(this.theEntity.getRNG().nextFloat() < 0.8F){ - this.theEntity.getJumpHelper().setJumping(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/e179ca01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/e179ca01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ba47be3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/e179ca01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisPool implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta water = new BlockWithMeta(Blocks.water); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return water; - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisPool"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f1e3c4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f1e3c4e5c42100141fce95f06aba7e85 deleted file mode 100644 index bb6d89c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/38/f1e3c4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandTriple extends BlockBrewingStandBase { - - public BlockBrewingStandTriple(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int par2) { - return new TileEntityBrewingTriple(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/31d2f69dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/31d2f69dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2892f7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/31d2f69dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLeaves; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/40da6401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/40da6401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9affc23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/40da6401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/41217affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/41217affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d035140..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/41217affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectPyramid; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/42d04da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/42d04da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f18cb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/42d04da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionResistance extends SubItemPotionHalfPower { - - public SubItemPotionResistance(Item itemID, int subID) { - super(itemID, subID, "Resistance"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 13, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.resistance); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/512eb4fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/512eb4fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7639a38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/512eb4fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public abstract class BaseModule implements Module { - - @Override - public void registration(ItemBlockManager manager) { - } - - @Override - public void registration(CustomEntityManager manager) { - } - - @Override - public void registration(FeatureGenerator manager) { - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - } - - @Override - public void init(FMLInitializationEvent event, File configDirectory) { - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - } - - @Override - public void serverStart(FMLServerStartedEvent event, File configDirectory) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/702e3da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/702e3da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d736953..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/702e3da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/70ffd2f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/70ffd2f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2c64906..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/70ffd2f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/8023edfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/8023edfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b65e245..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/8023edfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRedFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedFinchDeclaration extends SpawnableDeclaration { - - public RedFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/81f1c6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/81f1c6f5c42100141fce95f06aba7e85 deleted file mode 100644 index 975f663..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/81f1c6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/914dbce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/914dbce4c42100141fce95f06aba7e85 deleted file mode 100644 index c61a38a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/914dbce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,124 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandSpawnEntity extends CommandBase{ - @Override - public String getCommandName(){ - return "spawnentity"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel(){ - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender){ - return "commands.spawnentity.usage"; - } - - /** - * Command stringArgs : /spawnentity [targetPlayer] [entityName] - * Command stringArgs == 2: /spawnentity @p entityName - * Command stringArgs == 5: /spawnentity @p entityName - * Command stringArgs == 7: /spawnentity @p entityName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs){ - if(stringArgs.length < 2){ - throw new WrongUsageException("commands.spawnentity.usage", new Object[0]); - }else{ - double spawnTargetX = 0; - double spawnTargetY = 0; - double spawnTargetZ = 0; - float rotYaw = 0; - float rotPitch = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if(targetPlayer == null){ - throw new PlayerNotFoundException(); - } - - Entity spawnableEntity = EntityList.createEntityByName(stringArgs[1], targetPlayer.worldObj); - if(spawnableEntity == null){ - System.out.println("Entity is Null"); - throw new WrongUsageException("commands.spawnentity.noentity", new Object[0]); - } - - if(stringArgs.length == 2){ - spawnTargetX = (int)targetPlayer.posX; - spawnTargetY = (int)targetPlayer.posY; - spawnTargetZ = (int)targetPlayer.posZ; - }else if(stringArgs.length == 5 || stringArgs.length == 7){ - int indexOfPos = stringArgs.length - 3; - spawnTargetX = (int)parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - spawnTargetY = (int)parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, 0); - spawnTargetZ = (int)parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - if(stringArgs.length == 7){ - rotYaw = parseIntBounded(commandSender, stringArgs[2], 0, 360); - rotPitch = parseIntBounded(commandSender, stringArgs[3], 0, 360); - } - -// ProjectZuluLog.info("Placing Block at %s, %s, %s with Yaw %s and pitch %s", spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch ); - spawnableEntity.setLocationAndAngles(spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch); - targetPlayer.worldObj.spawnEntityInWorld(spawnableEntity); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr){ - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble){ - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, int lowerLimit, int upperLimit){ - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1){ - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords){ - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords){ - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0){ - if (targetPos < (double)lowerLimit){ - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(targetPos), Integer.valueOf(lowerLimit)}); - } - - if (targetPos > (double)upperLimit){ - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(targetPos), Integer.valueOf(upperLimit)}); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/b0027701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/b0027701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 181fe64..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/b0027701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/b02951f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/b02951f9c42100141fce95f06aba7e85 deleted file mode 100644 index 4c1ab76..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/b02951f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,127 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import com.ngb.projectzulu.common.core.ProjectZuluLog; - - -public class ParsingHelper { - - /** - * Attempt to Parse an Integer. Performs no filters. - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static int parseInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Integer. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static int parseFilteredInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Long. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static Long parseFilteredLong(String value, Long fallBack, String fieldName) { - try { - return Long.parseLong(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an long. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an long. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Float. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static float parseFilteredFloat(String value, float fallBack, String fieldName) { - try { - return Float.parseFloat(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Double. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static double parseFilteredDouble(String value, double fallBack, String fieldName) { - try { - return Double.parseDouble(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Boolean - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static boolean parseBoolean(String value, boolean fallBack, String fieldName) { - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for a boolean. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for a boolean. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } else { - return Boolean.parseBoolean(value); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/c043cc00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/c043cc00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2ba5e41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/c043cc00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/c0aab7a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/c0aab7a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 46de0af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/c0aab7a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGreenFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d09808e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d09808e5c42100141fce95f06aba7e85 deleted file mode 100644 index 570d7b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d09808e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,70 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d1bd75f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d1bd75f8c42100141fce95f06aba7e85 deleted file mode 100644 index 543fa3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d1bd75f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionCleansing extends PotionZulu { - - public PotionCleansing(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(1, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - super.performEffect(effectedEntity, par2); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d2244e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d2244e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 543f3f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/d2244e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummy extends ModelBiped { - - /** - * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms - * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how - * "far" arms and legs can swing at most. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/e004b1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/e004b1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89eb2fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/e004b1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/e03ca3f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/e03ca3f5c42100141fce95f06aba7e85 deleted file mode 100644 index 71e6a1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/e03ca3f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/f05b39f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/f05b39f9c42100141fce95f06aba7e85 deleted file mode 100644 index c6d3da0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/f05b39f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/f0db6d18ce21001418ceed54b1d01b94 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/f0db6d18ce21001418ceed54b1d01b94 deleted file mode 100644 index 2d474d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/39/f0db6d18ce21001418ceed54b1d01b94 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/11fa00a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/11fa00a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cc7e747..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/11fa00a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,66 +0,0 @@ -package projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/21670effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/21670effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ef32ae0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/21670effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/609927f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/609927f4c42100141fce95f06aba7e85 deleted file mode 100644 index 3393d15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/609927f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/71b8a3a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/71b8a3a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 370f9c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/71b8a3a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900633a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900633a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a160c8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/900633a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelLizardHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADBASE; - private ModelRenderer FRILL3ROT; - private ModelRenderer FRILL4ROT; - - public ModelLizardHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("FRILL3ROT.Frill3", 37, 22); - setTextureOffset("HEADBASE.head", 0, 0); - setTextureOffset("HEADBASE.Frill1", 29, 22); - setTextureOffset("HEADBASE.Frill2", 29, 22); - setTextureOffset("FRILL4ROT.Frill4", 37, 22); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 0F, 3F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - FRILL3ROT = new ModelRenderer(this, "FRILL3ROT"); - FRILL3ROT.setRotationPoint(1F, -2F, -2.5F); - setRotation(FRILL3ROT, 0F, 0F, 0F); - FRILL3ROT.mirror = true; - FRILL3ROT.addBox("Frill3", 0F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL3ROT); - HEADBASE.addBox("head", -3F, -3F, -8F, 6, 6, 8); - HEADBASE.addBox("Frill1", 3F, -2F, -3F, 3, 5, 1); - HEADBASE.addBox("Frill2", -6F, -2F, -3F, 3, 5, 1); - FRILL4ROT = new ModelRenderer(this, "FRILL4ROT"); - FRILL4ROT.setRotationPoint(-1F, -2F, -2.5F); - setRotation(FRILL4ROT, 0F, 0F, 0F); - FRILL4ROT.mirror = true; - FRILL4ROT.addBox("Frill4", -4F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL4ROT); - CENTERROT.addChild(HEADBASE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - FRILL3ROT.rotateAngleZ = (float)( -45*Math.PI/180 ); - FRILL4ROT.rotateAngleZ = (float)( 45*Math.PI/180 ); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/906bb7e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/906bb7e4c42100141fce95f06aba7e85 deleted file mode 100644 index 0ea25f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/906bb7e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,527 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/91242afac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/91242afac42100141fce95f06aba7e85 deleted file mode 100644 index 8f30501..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/91242afac42100141fce95f06aba7e85 +++ /dev/null @@ -1,127 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGiraffeHead extends ModelBase{ - - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - - public ModelGiraffeHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, 24F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - NECKROT2.render(f5); - } -// null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - // NECKROT1.rotateAngleX = (float) (75*Math.PI/180); - switch ((int)skullState) { - case 0: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - case 1: - NECKROT2.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) ( 5*Math.PI/180); - break; - default: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - } - NECKROT2.rotateAngleY = f3 / (180F / (float)Math.PI); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/a13ce1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/a13ce1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 49bb5f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/a13ce1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseWhite; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/a1b0b2e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/a1b0b2e4c42100141fce95f06aba7e85 deleted file mode 100644 index f410cb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/a1b0b2e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public interface TerrainFeature { - - /** - * The ordinal declaration of this ENUM determines priority during feature generation. Value declared first gets - * precedent. - */ - enum Size { - /* Feature is larger than a single chunk */ - LARGE, - /* Is approximately the size of a chunk */ - MEDIUM, - /* Size is less than a chunk, but more than a block */ - SMALL, - /* Spans a single or a couple blocks */ - TINY - } - - public enum FeatureDirection { - /* Structure should be centered on Current Block */ - CENTERED, - /* Structure should be centered along X but generate along -Z axis away from this block */ - NORTH, - /* Structure should be centered along X but generate along +Z axis away from this block */ - SOUTH, - /* Structure should be centered along Z but generate along -X axis away from this block */ - WEST, - /* Structure should be centered along Z but generate along +X axis away from this block */ - EAST; - } - - public abstract String getFeatureName(); - - public abstract boolean isEnabled(); - - public abstract Size getFeatureSize(); - - public abstract void initialize(File modConfigDirectory); - - /** - * From the World and Chunk. Generates an array of positions to attempt to generate the feature at. - * - * Each Point should be able to spawn - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @return - */ - public abstract ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ); - - /** - * Determines if the Feature can generate at the specified coordinates - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @param genBlockCoords Coordinates to generate at - * @param random - * @return - */ - public abstract boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random, FeatureDirection direction); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/b07f14e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/b07f14e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4a54893..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/b07f14e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/b0fa44e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/b0fa44e4c42100141fce95f06aba7e85 deleted file mode 100644 index a3217cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/b0fa44e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockJasper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/c02051a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/c02051a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3bb58a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/c02051a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/d095dbf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/d095dbf6c42100141fce95f06aba7e85 deleted file mode 100644 index 3edb61f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/d095dbf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/d16040f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/d16040f9c42100141fce95f06aba7e85 deleted file mode 100644 index 00970be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/d16040f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,215 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityAerial extends EntityLiving { - - protected ChunkCoordinates targetPosition; - /** Tries to Assign targetPosition - * Checks if Valid first using isTargetPositionValid - * Returns False if invald - */ - public boolean setTargetPosition(ChunkCoordinates targetPosition){ - if(isTargetPositionValid(targetPosition)){ - this.targetPosition = targetPosition; - return true; - } - return false; - } - protected int maxFlightHeight = 20; - public int getMaxFlightHeight(){ return maxFlightHeight; } - public EntityAerial(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handle whether Entity is Flying or not*/ - if( defaultGrounded() ){ - this.dataWatcher.addObject(17, Byte.valueOf((byte)1)); - }else{ - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - } - - } - - public boolean defaultGrounded() { - return true; - } - - public boolean isEntityGrounded() { - return this.dataWatcher.getWatchableObjectByte(17) != 0; - } - protected void setEntityGrounded(Boolean par1) { - if(par1){ - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - }else { - this.dataWatcher.updateObject(17, Byte.valueOf((byte)0)); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("Is Grounded", this.dataWatcher.getWatchableObjectByte(17)); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - if(par1NBTTagCompound.hasKey("Is Grounded")){ - this.dataWatcher.updateObject(17, par1NBTTagCompound.getByte("Is Grounded")); - } - } - - @Override - protected void updateAITasks() { - if(!isEntityGrounded() && targetPosition != null){ - /* Get The Direction I want to travel in */ - double var1 = (double)this.targetPosition.posX + 0.5D - this.posX; - double var3 = (double)this.targetPosition.posY + 0.1D - this.posY; - double var5 = (double)this.targetPosition.posZ + 0.5D - this.posZ; - - /* Change Velocity */ - /* Normalize the Direction I want to travel in, then add and scale it to Motion */ - this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D*0.3D; - this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D*0.3D; - this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D*0.3D; - float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; - float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); - this.moveForward = 0.5F; - this.rotationYaw += var8; - } - super.updateAITasks(); - } - - protected boolean shouldBeFlying() { - return false; - } - - public boolean isTargetPositionValid(){ - return isTargetPositionValid(this.targetPosition); - } - - public boolean isTargetPositionValid(ChunkCoordinates targetPosition){ - /* Invalid if Water, is below height = 3 (superflat), and if its null */ - if (targetPosition != null && (!this.worldObj.isAirBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ) || targetPosition.posY < 3 - || this.worldObj.getBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ).getMaterial().equals(Material.water))){ -// targetPosition = null; - return false; - } - return true; - } - - /* Checks if Entity is at the target position, return true if TargetPosition is null*/ - public boolean atTargetPosition(){ - if(targetPosition != null){ - return getDistance(targetPosition.posX, targetPosition.posY, targetPosition.posZ) < 2; - } - return true; - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if(isEntityGrounded()){ - super.moveEntityWithHeading(par1, par2); - return; - } - - if (this.isInWater()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } - else if (this.handleLavaMovement()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - else - { - float var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double)var3; - this.motionY *= (double)var3; - this.motionZ *= (double)var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) - { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwing; - } - - - /** - * Method Designed for Flying Entities to adjust the Direction They are facing to the direction they are moving - */ - protected void adjustRotationToWaypoint() { - double var8 = targetPosition.posX - this.posX; - double var10 = targetPosition.posZ - this.posZ; - float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI);// - 90.0F; - float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); - - if (var15 > 30.0F){ - var15 = 30.0F; - } - - if (var15 < -30.0F){ - var15 = -30.0F; - } - this.renderYawOffset = this.rotationYaw += var15; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/f03f06a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/f03f06a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d6219f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3a/f03f06a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/20f55494baab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/20f55494baab00141ee9bf3050c1025b new file mode 100644 index 0000000..b63d7f4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/20f55494baab00141ee9bf3050c1025b @@ -0,0 +1,289 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(6); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.grass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(50) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/212623f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/212623f7c42100141fce95f06aba7e85 deleted file mode 100644 index 6163abd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/212623f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/50d26be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/50d26be6c42100141fce95f06aba7e85 deleted file mode 100644 index 973398f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/50d26be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetDoorway; -import projectzulu.common.world2.blueprint.BPSetHallway; -import projectzulu.common.world2.blueprint.BPSetHallwaySpawner; -import projectzulu.common.world2.blueprint.BPSetPyramidEdge; -import projectzulu.common.world2.blueprint.BPSetStairs; -import projectzulu.common.world2.blueprint.BPSetTreasureDeadEnd; -import projectzulu.common.world2.blueprint.BPSetWall; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectPyramid extends ArchitectBase { - - public final BPSetStairs stairSet = new BPSetStairs(); - public final BPSetPyramidEdge edge = new BPSetPyramidEdge(); - public final BPSetDoorway door = new BPSetDoorway(); - - public ArchitectPyramid(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetWall()); - stockpile.addBlueprintSet(new BPSetTreasureDeadEnd()); - stockpile.addBlueprintSet(new BPSetHallway()); - stockpile.addBlueprintSet(new BPSetHallwaySpawner()); - stockpile.addBlueprintSet(stairSet); - stockpile.addBlueprintSet(edge); - stockpile.addBlueprintSet(door); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - /* If is Wall, use Wall Cell */ - BlueprintSet set; - if (door.isApplicable(cells, buildCoords, random)) { - set = door; - } else if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] bottomCells, MazeCell[][] topCells) { - for (int topX = 0; topX < topCells.length; topX++) { - for (int topZ = 0; topZ < topCells[0].length; topZ++) { - Point buildCoords = new Point(topX, topZ); - if (stairSet.attemptAssignBlueprint(bottomCells, topCells, buildCoords, random)) { - return; - } - } - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/703b3af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/703b3af8c42100141fce95f06aba7e85 deleted file mode 100644 index 0f2ea1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/703b3af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world; - -import java.util.Random; - -public enum CellIndexDirection { - Middle, Inner, NorthMiddle, SouthMiddle, WestMiddle, EastMiddle, NorthWestCorner, NorthEastCorner, SouthWestCorner, SouthEastCorner, NorthWall, SouthWall, WestWall, EastWall; - - public boolean isCorner() { - return this == NorthWestCorner || this == NorthEastCorner || this == SouthWestCorner || this == SouthEastCorner; - } - - public static CellIndexDirection randomCardinalDirection(Random random) { - switch (random.nextInt(4)) { - case 0: - return NorthMiddle; - case 1: - return SouthMiddle; - case 2: - return WestMiddle; - case 3: - return EastMiddle; - default: - return NorthMiddle; - } - } - - public CellIndexDirection calcDirection(int cellIndex, int cellSize) { - - /* Check if Middle */ - if (cellSize % 2 == 1) { - if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1) / 2) { - return Middle; - } else if (cellIndex == (cellSize - 1) / 2) { - return WestMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2) { - return NorthMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) + (cellSize - 1) / 2) { - return EastMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1)) { - return SouthMiddle; - } - } - - /* Check if Corner */ - if (cellIndex == 0) { - return NorthWestCorner; - } else if (cellIndex == cellSize - 1) { - return SouthWestCorner; - } else if (cellIndex == cellSize * cellSize - 1) { - return SouthEastCorner; - } else if (cellIndex == cellSize * cellSize - cellSize) { - return NorthEastCorner; - } - - /* Check if Outer Edge */ - if ((cellIndex % cellSize == (0))) { - return NorthWall; - } else if ((cellIndex % cellSize == (cellSize - 1))) { - return SouthWall; - } else if (cellIndex >= cellSize * (cellSize - 1) && cellIndex < cellSize * cellSize) { - return EastWall; - } else if (cellIndex >= 0 && cellIndex < cellSize) { - return WestWall; - } - - /* If Nothing Else Mark as Inner */ - return Inner; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/8141e8fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/8141e8fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e8afc3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/8141e8fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.models.ModelPelican; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/91105df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/91105df9c42100141fce95f06aba7e85 deleted file mode 100644 index 433cdfb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/91105df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a00524f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a00524f6c42100141fce95f06aba7e85 deleted file mode 100644 index 8db5cd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a00524f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a02410f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a02410f5c42100141fce95f06aba7e85 deleted file mode 100644 index d675fc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a02410f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.HashMap; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class PotionIngredients { - - public static interface IngredientProperty { - public abstract boolean isIngredient(ItemStack ingredient); - } - - public static class OverrideIngredient implements IngredientProperty { - boolean isIngredient = true; - - @Override - public boolean isIngredient(ItemStack ingredient) { - return isIngredient; - } - } - - private static HashMap ingredientProperties = new HashMap(); - - static { - addIngredientProperties(Items.feather, new OverrideIngredient()); - } - - public static void addIngredientProperties(Item item, IngredientProperty ingredientProperty) { - ingredientProperties.put(item, ingredientProperty); - } - - public static boolean isPotionIngredient(ItemStack ingredient) { - if (ingredient == null) { - return false; - } - - IngredientProperty property = ingredientProperties.get(ingredient.getItem()); - if (property != null) { - return property.isIngredient(ingredient); - } else { - return ingredient != null ? ingredient.getItem().isPotionIngredient(ingredient) : false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a09ec0f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a09ec0f7c42100141fce95f06aba7e85 deleted file mode 100644 index 2d984a6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a09ec0f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,201 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a1c47fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a1c47fe5c42100141fce95f06aba7e85 deleted file mode 100644 index 832a5c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/a1c47fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRhino; -import projectzulu.common.mobs.models.ModelRhino; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/b192f4fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/b192f4fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 82c558d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/b192f4fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.spike.BlockSpikes; -import projectzulu.common.blocks.spike.RenderSpike; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/e26ee09ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/e26ee09ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e2a86a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/e26ee09ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,158 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.util.DamageSource; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public abstract class EntityMaster extends EntityGenericAnimal { - - List followerList = new ArrayList(); - int numberOfFollowers = 9; - - boolean spawnFollowers = true; - - /* Represents the increments between each slave-Piece, used to determine number of locations needed to track */ - int distanceIncrements = 10; - float distancePerIncrement; - - boolean isPositionListSetup = false; - LinkedList positionList = new LinkedList(); - - public EntityMaster(World par1World) { - super(par1World); - - distancePerIncrement = width / distanceIncrements; - while (followerList.size() < numberOfFollowers) { - followerList.add(null); - } - } - - @Override - public boolean canBePushed() { - return false; - } - - /* Handling of Child Entities Position Must be Handled on Server and Client Side */ - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - if (!isPositionListSetup) { - double xzOffset = 0; - while (positionList.size() < numberOfFollowers * distanceIncrements + 1) { - positionList.add(Vec3.createVectorHelper(posX + xzOffset, posY, posZ)); - xzOffset += distancePerIncrement; - } - isPositionListSetup = true; - } - - /* Calculate Position Array, used to set the target position for Followers */ - double minDistanceToIterateList = distancePerIncrement; - while (calcDistance(posX, posZ, positionList.getFirst().xCoord, positionList.getFirst().zCoord) > minDistanceToIterateList) { - - double xDist = posX - positionList.getFirst().xCoord; - double zDist = posZ - positionList.getFirst().zCoord; - - double scaleFactor = (minDistanceToIterateList / calcDistance(posX, posZ, positionList.getFirst().xCoord, - positionList.getFirst().zCoord)); - double actualXCoord = positionList.getFirst().xCoord + xDist * scaleFactor; - double actualZCoord = positionList.getFirst().zCoord + zDist * scaleFactor; - - positionList.addFirst(Vec3.createVectorHelper(actualXCoord, posY, actualZCoord)); - positionList.removeLast(); - } - - /* - * Store the Values Gotten from positionList.get from previous iteration Used to Calculate TargetRotation - */ - double prevX = posX; - double prevZ = posZ; - for (int i = 0; i < followerList.size(); i++) { - - if (followerList.get(i) != null) { - EntityFollower entityFollower = followerList.get(i); - - /* Get Position From Position List */ - double setXAround = positionList.get((i + 1) * distanceIncrements).xCoord; - double setZAround = positionList.get((i + 1) * distanceIncrements).zCoord; - double setYAround = positionList.get((i + 1) * distanceIncrements).yCoord; - entityFollower.setTargetPosition(Vec3.createVectorHelper(setXAround, posY, setZAround)); - - entityFollower - .setTargetRotation((float) (Math.atan2(setXAround - prevX, prevZ - setZAround) * (180.0 / Math.PI))); - prevX = setXAround; - prevZ = setZAround; - - /* Check if Prev Point is Dead, is so, I should probably be killed to */ - if (i > 0 && followerList.get(i - 1) != null) { - if (followerList.get(i - 1).isDead) { - entityFollower.shouldBeDying = true; - } - } - } - } - } - - /* Creation of Child Entities should only be Done on Server */ - @Override - public void updateAITick() { - - /* Count Number of Followers, used to determine if more followers should be spawned */ - int currentNumOfFollowers = 0; - for (int i = 0; i < followerList.size(); i++) { - /* Spawn new Followers if Neccesary */ - if (followerList.get(i) == null || (followerList.get(i).isDead && spawnFollowers)) { - followerList.set(i, new EntityFollower(worldObj, posX, posY, posZ, this, i)); - worldObj.spawnEntityInWorld(followerList.get(i)); - } - EntityFollower entityFollower = followerList.get(i); - - /* Count Number of Followers, used to determine if more followers should be spawned */ - if (!entityFollower.isDead) { - currentNumOfFollowers += 1; - } - } - - /* Check if We should Spawn More Followers */ - spawnFollowers = currentNumOfFollowers < numberOfFollowers ? true : false; - super.updateAITick(); - } - - /** - * Code to Assign body to Head, called by Body client Side to establish link - */ - public boolean linkFollowerWithMaster(EntityFollower entityFollower, int followerIndex) { - if (followerList.get(followerIndex) != null && !followerList.get(followerIndex).isDead) { - return false; - } - followerList.set(followerIndex, entityFollower); - return true; - } - - /* Shares Damage with Followers */ - public boolean attackEntityFromChild(EntityFollower var1, DamageSource var2, float var3) { - if (super.attackEntityFrom(var2, var3)) { - for (int i = 0; i < followerList.size(); i++) { - EntityFollower entityFollower = followerList.get(i); - if (entityFollower != null) { - entityFollower.hurtChildFromMaster(var2, var3); - } - } - return true; - } - return false; - } - - @Override - protected boolean canDespawn() { - return true; - } - - private double calcDistance(double x1, double z1, double x2, double z2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (z2 - z1) * (z2 - z1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/f0aecff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/f0aecff6c42100141fce95f06aba7e85 deleted file mode 100644 index 11c36e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/f0aecff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,132 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/f147709ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/f147709ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b3f016f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3b/f147709ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.nbt.NBTBase; - -import org.lwjgl.util.Point; - -public class GUIEditNodeTextField extends GuiTextField { - private NBTNode selectedNode = null; - - public GUIEditNodeTextField(FontRenderer par1FontRenderer, int xPos, int yPos, int width, int height) { - super(par1FontRenderer, xPos, yPos, width, height); - } - - public GUIEditNodeTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(30000); - } - - public GUIEditNodeTextField(GUIEditNodeTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - - this.selectedNode = oldTextFields.selectedNode; - setText(oldTextFields.getText()); - setupTextField(30000); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } - - public boolean isEnabled() { - return selectedNode != null; - } - - public void setSelectedNode(NBTNode selectedNode) { - this.selectedNode = selectedNode; - setText(selectedNode.getValue()); - } - - public boolean saveAndClear(NBTTree nodeTree) { - NBTBase newNBT = selectedNode.createNBTFromString(getText()); - if (newNBT != null) { - if (selectedNode.getParent() != null) { - selectedNode.getParent().replaceChild(selectedNode, - new NBTNode(newNBT, selectedNode.getParent(), selectedNode.getTagName())); - } else { - // Properties name is arbitrary, the top compound in entity NBT is/was typically called properties - selectedNode = new NBTNode(newNBT, null, "Properties"); - } - clear(); - return true; - } - return false; - } - - public void clear() { - selectedNode = null; - setText(""); - } - - @Override - public boolean textboxKeyTyped(char keyChar, int keyID) { - if (selectedNode != null) { - return super.textboxKeyTyped(keyChar, keyID); - } - return false; - } - - @Override - public void mouseClicked(int par1, int par2, int par3) { - if (selectedNode != null) { - super.mouseClicked(par1, par2, par3); - } - } - - @Override - public void drawTextBox() { - super.drawTextBox(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/00a6cbf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/00a6cbf8c42100141fce95f06aba7e85 deleted file mode 100644 index 2033f95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/00a6cbf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityOstrich; -import com.ngb.projectzulu.common.mobs.models.ModelOstrich; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/105bf6f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/105bf6f4c42100141fce95f06aba7e85 deleted file mode 100644 index 537c72a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/105bf6f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionSlowFall extends PotionZulu { - - public PotionSlowFall(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(0, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - amplifier = amplifier > 10 ? 10 : amplifier < 0 ? 0 : amplifier; - if (par1EntityLiving.fallDistance > (10 - amplifier) * 2) { - par1EntityLiving.fallDistance = (10 - amplifier) * 2; - } - par1EntityLiving.motionY = Math.max(par1EntityLiving.motionY, -1.2f + (amplifier + 1f) * (0.1f)); - super.performEffect(par1EntityLiving, amplifier); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 4 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/106dcefdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/106dcefdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 32ce0ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/106dcefdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/11042bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/11042bf9c42100141fce95f06aba7e85 deleted file mode 100644 index 0d1d5f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/11042bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,217 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; - -public abstract class EntityGenericCreature extends EntityAerial { - private PathEntity pathToEntity; - - public boolean hasPath() { - return this.pathToEntity != null; - } - - /** The Entity this EntityCreature is set to attack. */ - protected Entity entityToAttack; - - public Entity getEntityToAttack() { - return this.entityToAttack; - } - - public void setTarget(Entity par1Entity) { - this.entityToAttack = par1Entity; - } - - private float maximumHomeDistance = -1.0F; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); - private boolean field_110180_bt; - // Cooldown instituted on the entity when it attempts to find a path but fails. - private int leashPathCooldown = 0; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0f); - - /** - * returns true if a creature has attacked recently only used for creepers and skeletons - */ - /* Do I need this? */ - // protected boolean hasAttacked = false; - - /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick = 0; - - public int getFleeTick() { - return fleeingTick; - } - - public void setFleeTick(int fleeingTick) { - this.fleeingTick = fleeingTick; - } - - /* Entity State Variables */ - protected int animTime = 0; - - public int getAnimTime() { - return animTime; - } - - public void setAnimTime(int animTime) { - this.animTime = animTime; - } - - protected int angerLevel = 0; - - public int getAngerLevel() { - return angerLevel; - } - - public void setAngerLevel(int angerLevel) { - this.angerLevel = angerLevel; - } - - protected EntityStates entityState = EntityStates.idle; - - public EntityStates getEntityState() { - return entityState; - } - - public EntityGenericCreature(World par1World) { - super(par1World); - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - attackTime = Math.max(attackTime - 1, 0); - fleeingTick = Math.max(fleeingTick - 1, 0); - angerLevel = Math.max(angerLevel - 1, 0); - } - - @Override - public void onUpdate() { - super.onUpdate(); - leashPathCooldown = Math.max(leashPathCooldown - 1, 0); - } - - @Override - protected void updateLeashedState() { - super.updateLeashedState(); - - if (this.getLeashed() && this.getLeashedToEntity() != null - && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity entity = this.getLeashedToEntity(); - this.setHomeArea((int) entity.posX, (int) entity.posY, (int) entity.posZ, 5); - float f = this.getDistanceToEntity(entity); - - if (this instanceof EntityGenericTameable && ((EntityGenericTameable) this).isSitting()) { - if (f > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/510ed7ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/510ed7ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 42bbbb8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/510ed7ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemStructurePlacer; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/615fdba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/615fdba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 30f2faf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/615fdba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,182 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityBear; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/6167459ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/6167459ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8f0ac59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/6167459ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraft.world.biome.BiomeGenBase; - -public class SpawnEntry { - public final BiomeGenBase biome; - public final int spawnRate; - public final int minInChunk; - public final int maxInChunk; - public SpawnEntry(BiomeGenBase biome, int spawnRate, int minInChunk, int maxInChunk) { - this.biome = biome; - this.spawnRate = spawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/616d9801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/616d9801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8cf2954..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/616d9801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/617ecae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/617ecae4c42100141fce95f06aba7e85 deleted file mode 100644 index 45bcc09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/617ecae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,144 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90bb91f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90bb91f6c42100141fce95f06aba7e85 deleted file mode 100644 index 8a0e161..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/90bb91f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/a1e473f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/a1e473f4c42100141fce95f06aba7e85 deleted file mode 100644 index a1970c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/a1e473f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/b00887a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/b00887a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43f0275..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/b00887a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/c0ebbcfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/c0ebbcfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 42374e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/c0ebbcfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/c1dabb9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/c1dabb9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c230cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/c1dabb9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.world.terrain; - -import net.minecraft.util.WeightedRandom; - -public class EntityEntry extends WeightedRandom.Item { - - public final String entityname; - - public EntityEntry(String entityname, int spawnWeight) { - super(spawnWeight); - if (entityname == null || entityname.trim() == "") { - throw new IllegalArgumentException("Entity Name Cannot be " + entityname == null ? "null" : "blank"); - } - this.entityname = entityname.trim(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/f19d2fe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/f19d2fe4c42100141fce95f06aba7e85 deleted file mode 100644 index e708c5e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3c/f19d2fe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/11b141f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/11b141f4c42100141fce95f06aba7e85 deleted file mode 100644 index 922f40b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/11b141f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomMid extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomMid(boolean inverted) { - super(inverted); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (inverted) { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(piecePos.posX + 1) == 0) { - return true; - } - } else { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(cellSize - 1 - piecePos.posX + 1) == 0) { - return true; - } - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randomMid"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/32e3f0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/32e3f0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1dc8c3e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/32e3f0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,502 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/42603fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/42603fe5c42100141fce95f06aba7e85 deleted file mode 100644 index a45a598..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/42603fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,155 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/503d5b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/503d5b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 88f0be9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/503d5b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,439 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/60e4b1fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/60e4b1fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e40e5ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/60e4b1fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/71be2ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/71be2ee5c42100141fce95f06aba7e85 deleted file mode 100644 index e2a86a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/71be2ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,158 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.util.DamageSource; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public abstract class EntityMaster extends EntityGenericAnimal { - - List followerList = new ArrayList(); - int numberOfFollowers = 9; - - boolean spawnFollowers = true; - - /* Represents the increments between each slave-Piece, used to determine number of locations needed to track */ - int distanceIncrements = 10; - float distancePerIncrement; - - boolean isPositionListSetup = false; - LinkedList positionList = new LinkedList(); - - public EntityMaster(World par1World) { - super(par1World); - - distancePerIncrement = width / distanceIncrements; - while (followerList.size() < numberOfFollowers) { - followerList.add(null); - } - } - - @Override - public boolean canBePushed() { - return false; - } - - /* Handling of Child Entities Position Must be Handled on Server and Client Side */ - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - if (!isPositionListSetup) { - double xzOffset = 0; - while (positionList.size() < numberOfFollowers * distanceIncrements + 1) { - positionList.add(Vec3.createVectorHelper(posX + xzOffset, posY, posZ)); - xzOffset += distancePerIncrement; - } - isPositionListSetup = true; - } - - /* Calculate Position Array, used to set the target position for Followers */ - double minDistanceToIterateList = distancePerIncrement; - while (calcDistance(posX, posZ, positionList.getFirst().xCoord, positionList.getFirst().zCoord) > minDistanceToIterateList) { - - double xDist = posX - positionList.getFirst().xCoord; - double zDist = posZ - positionList.getFirst().zCoord; - - double scaleFactor = (minDistanceToIterateList / calcDistance(posX, posZ, positionList.getFirst().xCoord, - positionList.getFirst().zCoord)); - double actualXCoord = positionList.getFirst().xCoord + xDist * scaleFactor; - double actualZCoord = positionList.getFirst().zCoord + zDist * scaleFactor; - - positionList.addFirst(Vec3.createVectorHelper(actualXCoord, posY, actualZCoord)); - positionList.removeLast(); - } - - /* - * Store the Values Gotten from positionList.get from previous iteration Used to Calculate TargetRotation - */ - double prevX = posX; - double prevZ = posZ; - for (int i = 0; i < followerList.size(); i++) { - - if (followerList.get(i) != null) { - EntityFollower entityFollower = followerList.get(i); - - /* Get Position From Position List */ - double setXAround = positionList.get((i + 1) * distanceIncrements).xCoord; - double setZAround = positionList.get((i + 1) * distanceIncrements).zCoord; - double setYAround = positionList.get((i + 1) * distanceIncrements).yCoord; - entityFollower.setTargetPosition(Vec3.createVectorHelper(setXAround, posY, setZAround)); - - entityFollower - .setTargetRotation((float) (Math.atan2(setXAround - prevX, prevZ - setZAround) * (180.0 / Math.PI))); - prevX = setXAround; - prevZ = setZAround; - - /* Check if Prev Point is Dead, is so, I should probably be killed to */ - if (i > 0 && followerList.get(i - 1) != null) { - if (followerList.get(i - 1).isDead) { - entityFollower.shouldBeDying = true; - } - } - } - } - } - - /* Creation of Child Entities should only be Done on Server */ - @Override - public void updateAITick() { - - /* Count Number of Followers, used to determine if more followers should be spawned */ - int currentNumOfFollowers = 0; - for (int i = 0; i < followerList.size(); i++) { - /* Spawn new Followers if Neccesary */ - if (followerList.get(i) == null || (followerList.get(i).isDead && spawnFollowers)) { - followerList.set(i, new EntityFollower(worldObj, posX, posY, posZ, this, i)); - worldObj.spawnEntityInWorld(followerList.get(i)); - } - EntityFollower entityFollower = followerList.get(i); - - /* Count Number of Followers, used to determine if more followers should be spawned */ - if (!entityFollower.isDead) { - currentNumOfFollowers += 1; - } - } - - /* Check if We should Spawn More Followers */ - spawnFollowers = currentNumOfFollowers < numberOfFollowers ? true : false; - super.updateAITick(); - } - - /** - * Code to Assign body to Head, called by Body client Side to establish link - */ - public boolean linkFollowerWithMaster(EntityFollower entityFollower, int followerIndex) { - if (followerList.get(followerIndex) != null && !followerList.get(followerIndex).isDead) { - return false; - } - followerList.set(followerIndex, entityFollower); - return true; - } - - /* Shares Damage with Followers */ - public boolean attackEntityFromChild(EntityFollower var1, DamageSource var2, float var3) { - if (super.attackEntityFrom(var2, var3)) { - for (int i = 0; i < followerList.size(); i++) { - EntityFollower entityFollower = followerList.get(i); - if (entityFollower != null) { - entityFollower.hurtChildFromMaster(var2, var3); - } - } - return true; - } - return false; - } - - @Override - protected boolean canDespawn() { - return true; - } - - private double calcDistance(double x1, double z1, double x2, double z2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (z2 - z1) * (z2 - z1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/81df2efac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/81df2efac42100141fce95f06aba7e85 deleted file mode 100644 index 48ac080..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/81df2efac42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBirdHead extends ModelBase{ - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - private ModelRenderer BODY; - private ModelRenderer WINGLEFROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer TAILROT; - - public ModelBirdHead(){ - textureWidth = 32; - textureHeight = 32; - setTextureOffset("BODY.Body", 0, 0); - setTextureOffset("WINGLEFROT.winglef", 22, 0); - setTextureOffset("WINGRIGROT.wingrig", 13, 0); - setTextureOffset("TAILROT.tail", 14, 8); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - - BODY = new ModelRenderer(this, "BODY"); - BODY.setRotationPoint(0F, 21F, 0F); - setRotation(BODY, 0F, 0F, 0F); - BODY.mirror = true; - BODY.addBox("Body", -1F, -1F, -2F, 2, 2, 4); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-1F, -0.7F, 0F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGLEFROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(1F, -0.7F, 0F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGRIGROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -0.2F, 1F); - setRotation(TAILROT, 0.3346145F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.4666667F, 0F, 0F, 1, 0, 3); - BODY.addChild(TAILROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1.2F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - BODY.addChild(HEADROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 1.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 0); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODY.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 1.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 0); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODY.addChild(LEGRIGTOPROT); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - // super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - // float field_78145_g = 8.0F; - // float field_78151_h = 4.0F; - // - // if (this.isChild){ - // float var8 = 2.0F; - // GL11.glPushMatrix(); - // GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - // GL11.glPopMatrix(); - // GL11.glPushMatrix(); - // GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - // GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - // Body.render(f5); - // Body.render(f5); - // wingrig.render(f5); - // winglef.render(f5); - // tail.render(f5); - // LEGRIGTOPROT.render(f5); - // LEGLEFTOPROT.render(f5); - // GL11.glPopMatrix(); - // }else{ -// Body.render(f5); -// wingrig.render(f5); -// winglef.render(f5); -// tail.render(f5); -// LEGRIGTOPROT.render(f5); -// LEGLEFTOPROT.render(f5); -// HEADROT.render(f5); - BODY.render(f5); - // } - // - } - - public void renderHead(float f5){ - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODY.rotateAngleY = f3 / (180F / (float)Math.PI); - -// Body.rotateAngleY = f3 / (180F / (float)Math.PI); -// wingrig.rotateAngleY = f3 / (180F / (float)Math.PI); -// winglef.rotateAngleY = f3 / (180F / (float)Math.PI); -// tail.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGRIGTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGLEFTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/90e04501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/90e04501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4b704b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/90e04501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,182 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityBear; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/919351e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/919351e6c42100141fce95f06aba7e85 deleted file mode 100644 index ca7a128..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/919351e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a temperature Item - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempItem { - - /** - * Factor that adds to the current Player Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public Float getPlayerTempContributionFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public Float getLocationTemperatureFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate when the Item is in hand - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/92cfbcffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/92cfbcffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a062a66..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/92cfbcffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCreeperBlossom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CreeperBlossomDeclaration extends BlockDeclaration { - - public CreeperBlossomDeclaration() { - super("CreeperBlossom"); - } - - @Override - protected boolean createBlock() { - BlockList.creeperBlossom = Optional.of(new BlockCreeperBlossom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.creeperBlossom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/c150e0f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/c150e0f6c42100141fce95f06aba7e85 deleted file mode 100644 index a79120a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/c150e0f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/e1233ff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/e1233ff5c42100141fce95f06aba7e85 deleted file mode 100644 index a75ded1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/e1233ff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,222 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import com.ngb.projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/f06894e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/f06894e6c42100141fce95f06aba7e85 deleted file mode 100644 index 561ba75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/f06894e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeDiagonal extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeDiagonal(boolean inverted) { - super(inverted); - } - - /** - * BPOasisEdgeDiagonal G GG GGG - */ - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ - (!inverted ? piecePos.posX : cellSize - 1 - piecePos.posX) >= 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "diagonal"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/f0da6d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/f0da6d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75a70a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3d/f0da6d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; - -public class SlotBrewingStandSinglePotion extends Slot { - /** The player that has this container open. */ - private EntityPlayer player; - - public SlotBrewingStandSinglePotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, - int par5) { - super(par2IInventory, par3, par4, par5); - this.player = par1EntityPlayer; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return canHoldPotion(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 1; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack itemStack) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack)) { - this.player.addStat(AchievementList.potion, 1); - } - - super.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - /** - * Returns true if this itemstack can be filled with a potion - */ - public static boolean canHoldPotion(ItemStack itemStack) { - return itemStack != null - && (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack) || itemStack.getItem() == Items.potionitem - && itemStack.getItemDamage() == 0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/019ca19fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/019ca19fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43afe26..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/019ca19fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/1057369fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/1057369fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41f8886..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/1057369fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,140 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBeaver extends ModelBase { - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer HEADROT; - ModelRenderer TAILROT; - - public ModelBeaver() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - setTextureOffset("TAILROT.tail1", 0, 0); - setTextureOffset("TAILROT.tail2", 0, 3); - setTextureOffset("TAILROT.tail3", 0, 5); - setTextureOffset("TAILROT.tail4", 12, 0); - setTextureOffset("TAILROT.tail5", 12, 5); - - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -4F, -10F, 9, 8, 10); - body.setRotationPoint(0F, 18F, 7F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 8, 10); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - leg4.setRotationPoint(3.5F, 22F, 6F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 10); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - leg3.setRotationPoint(-3.5F, 22F, 6F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 10); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - leg1.setRotationPoint(-3.5F, 22F, -2F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 8, 10); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - leg2.setRotationPoint(3.5F, 22F, -2F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 18F, -3F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 1F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 3F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 3F, -5F, 1, 1, 1); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 7F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail1", -1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addBox("tail2", -2F, -0.5F, 2F, 4, 1, 1); - TAILROT.addBox("tail3", -2.5F, -0.5F, 3F, 5, 1, 1); - TAILROT.addBox("tail4", -3F, -0.5F, 4F, 6, 1, 4); - TAILROT.addBox("tail5", -2.5F, -0.5F, 8F, 5, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - HEADROT.render(f5); - TAILROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - TAILROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/10f05df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/10f05df8c42100141fce95f06aba7e85 deleted file mode 100644 index 921714c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/10f05df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionDigslowdown extends SubItemPotionHalfPower { - - public SubItemPotionDigslowdown(Item itemID, int subID) { - super(itemID, subID, "Fatique"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/202623f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/202623f7c42100141fce95f06aba7e85 deleted file mode 100644 index a39b802..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/202623f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/2088eff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/2088eff5c42100141fce95f06aba7e85 deleted file mode 100644 index c178d4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/2088eff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,309 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/222ee7e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/222ee7e4c42100141fce95f06aba7e85 deleted file mode 100644 index cb76d8d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/222ee7e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/703cee35c5ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/703cee35c5ab00141ee9bf3050c1025b new file mode 100644 index 0000000..775e13b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/703cee35c5ab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + boolean bugRelease = true; + boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/71b1d3f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/71b1d3f7c42100141fce95f06aba7e85 deleted file mode 100644 index e0bf2f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/71b1d3f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/80133701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/80133701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8b31b64..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/80133701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityOstrich; -import projectzulu.common.mobs.models.ModelOstrich; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/80f62c00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/80f62c00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index fd0b56c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/80f62c00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/90ac5bf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/90ac5bf5c42100141fce95f06aba7e85 deleted file mode 100644 index 9451fa1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/90ac5bf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,140 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBeaver extends ModelBase { - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer HEADROT; - ModelRenderer TAILROT; - - public ModelBeaver() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - setTextureOffset("TAILROT.tail1", 0, 0); - setTextureOffset("TAILROT.tail2", 0, 3); - setTextureOffset("TAILROT.tail3", 0, 5); - setTextureOffset("TAILROT.tail4", 12, 0); - setTextureOffset("TAILROT.tail5", 12, 5); - - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -4F, -10F, 9, 8, 10); - body.setRotationPoint(0F, 18F, 7F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 8, 10); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - leg4.setRotationPoint(3.5F, 22F, 6F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 10); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - leg3.setRotationPoint(-3.5F, 22F, 6F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 10); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - leg1.setRotationPoint(-3.5F, 22F, -2F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 8, 10); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - leg2.setRotationPoint(3.5F, 22F, -2F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 18F, -3F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 1F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 3F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 3F, -5F, 1, 1, 1); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 7F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail1", -1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addBox("tail2", -2F, -0.5F, 2F, 4, 1, 1); - TAILROT.addBox("tail3", -2.5F, -0.5F, 3F, 5, 1, 1); - TAILROT.addBox("tail4", -3F, -0.5F, 4F, 6, 1, 4); - TAILROT.addBox("tail5", -2.5F, -0.5F, 8F, 5, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - HEADROT.render(f5); - TAILROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - TAILROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/d0b6a937bfab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/d0b6a937bfab00141ee9bf3050c1025b new file mode 100644 index 0000000..c4506e7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/d0b6a937bfab00141ee9bf3050c1025b @@ -0,0 +1,294 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + boolean bugRelease = true; + boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/d10380a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/d10380a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 673132a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/d10380a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/e074f3f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/e074f3f4c42100141fce95f06aba7e85 deleted file mode 100644 index 766a15c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/e074f3f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/e0e731e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/e0e731e4c42100141fce95f06aba7e85 deleted file mode 100644 index 30b6bc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3e/e0e731e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/01943efec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/01943efec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 01d1ae2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/01943efec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/20670effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/20670effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e6e39b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/20670effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/32a785f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/32a785f9c42100141fce95f06aba7e85 deleted file mode 100644 index 08dd4d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/32a785f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import com.ngb.projectzulu.common.dungeon.BlockLimitedMobSpawner; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/501549a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/501549a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index df7e593..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/501549a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/606cd8f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/606cd8f7c42100141fce95f06aba7e85 deleted file mode 100644 index e4043cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/606cd8f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,230 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/701a70a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/701a70a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2d22fcb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/701a70a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/811b9aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/811b9aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9affe18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/811b9aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,95 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY % 2 == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "cemeterytomb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/818f6f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/818f6f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7179139..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/818f6f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,147 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ContainerBrewingStandSingle extends Container { - - private TileEntityBrewingBase tileBrewingStand; - - /** Instance of Slot. */ - private final Slot theSlot; - private int brewTime = 0; - public final int potionSlots; - - public ContainerBrewingStandSingle(InventoryPlayer par1InventoryPlayer, TileEntityBrewingBase brewingStand) { - this.tileBrewingStand = brewingStand; - potionSlots = tileBrewingStand.getSizeInventory() - 1; - int slotID = 0; - if (potionSlots >= 1) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 79, - 53)); - } - - if (potionSlots >= 3) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 56, - 46)); - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, - 102, 46)); - } - this.theSlot = this.addSlotToContainer(new SlotBrewingStandSingleIngredient(this, brewingStand, slotID++, 79, - 17)); - int i; - - /* Add Inventory Slots */ - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - /* Add Hot Bar Slots */ - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - - /** - * Looks for changes made in the container, sends them to every listener. - */ - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.brewTime != this.tileBrewingStand.getBrewTime()) { - icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - } - this.brewTime = this.tileBrewingStand.getBrewTime(); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - if (par1 == 0) { - this.tileBrewingStand.setBrewTime(par2); - } - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - int potionMin = 0; - int potionMax = potionSlots + 1; // 4; - int hotBarMin = potionSlots + 1 + 3 * 9; // 31; - int hotBarMax = potionSlots + 1 + 3 * 9 + 9; // 40; - int inventMin = potionSlots + 1; // 4; - int inventMax = potionSlots + 1 + 3 * 9;// 31; - - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - if ((par2 < 0 || par2 > potionMax)) { - if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) { - if (!this.mergeItemStack(itemstack1, potionMax - 1, potionMax, false)) { - return null; - } - } else if (SlotBrewingStandSinglePotion.canHoldPotion(itemstack)) { - if (!this.mergeItemStack(itemstack1, potionMin, potionMax - 1, false)) { - return null; - } - } else if (par2 >= inventMin && par2 < inventMax) { - if (!this.mergeItemStack(itemstack1, hotBarMin, hotBarMax, false)) { - return null; - } - } else if (par2 >= hotBarMin && par2 < hotBarMax) { - if (!this.mergeItemStack(itemstack1, inventMin, inventMax, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, false)) { - return null; - } - } else { - if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, true)) { - return null; - } - slot.onSlotChange(itemstack1, itemstack); - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - return itemstack; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/90bdcaa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/90bdcaa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 16d70e4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/90bdcaa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMimic; -import projectzulu.common.mobs.models.ModelMimic; -import projectzulu.common.mobs.renders.RenderMimic; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MimicDeclaration extends EggableDeclaration { - - public MimicDeclaration() { - super("Mimic", 11, EntityMimic.class, null); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - shouldDespawn = false; - - eggColor1 = (171 << 16) + (121 << 8) + 45; - eggColor2 = (143 << 16) + (105 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 5); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/b2fc1ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/b2fc1ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 0ae9abc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/b2fc1ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MimicWithMeta; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c0c8b2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c0c8b2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c5217a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c0c8b2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.models.ModelFollower; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c0e2f000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c0e2f000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 93c0b8f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c0e2f000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c150559fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c150559fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 650c119..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/c150559fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelPolarBear extends ModelBear { - - public ModelPolarBear() { - super(12); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 2 * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e00c14a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e00c14a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c228621..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e00c14a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,332 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e1b296e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e1b296e6c42100141fce95f06aba7e85 deleted file mode 100644 index b025cfc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/e1b296e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f056a69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f056a69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f091dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/3f/f056a69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/001c65f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/001c65f8c42100141fce95f06aba7e85 deleted file mode 100644 index 68e1c16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/001c65f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/00f58a00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/00f58a00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6524af5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/00f58a00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/014403a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/014403a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c8a3230..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/014403a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/022b9f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/022b9f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index abd0d74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/022b9f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/101dadf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/101dadf4c42100141fce95f06aba7e85 deleted file mode 100644 index fa03d2f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/101dadf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,245 +0,0 @@ -//package com.ngb.projectzulu.common.temperature; -// -//import java.util.EnumSet; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.client.renderer.Tessellator; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.src.ModLoader; -//import net.minecraft.util.MathHelper; -// -//import org.lwjgl.opengl.GL11; -// -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class DisplayTemperatureTicker implements ITickHandler{ -// -// protected float zLevel = 10.0F; -// public static long inGameTicks = 0; -// private float playerTemp = 0; -// private float enviroTemp = 0; -// @Override -// public void tickStart(EnumSet type, Object... tickData) {} -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// -// /* Handle Display of Temperature on Client, TickType = Render*/ -// if(ModLoader.getMinecraftInstance().thePlayer != null){ -// -// Minecraft mc = ModLoader.getMinecraftInstance(); -// EntityPlayer player = ModLoader.getMinecraftInstance().thePlayer; -// -// FontRenderer var2 = mc.fontRenderer; -// ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); -// String textureLocation = "/mods/icons/temperature_icon.png"; -// int scalewidth = var3.getScaledWidth(); -// int scaleHeight = var3.getScaledHeight(); -// -// if( TemperatureTicker.getPlayerTemperature(player) != null && inGameTicks % 80 == 0){ -// playerTemp = TemperatureTicker.getPlayerTemperature(player); -// } -// if(TemperatureTicker.getPlayerLocTemperature(player) != null && inGameTicks % 80 == 0){ -// enviroTemp = TemperatureTicker.getPlayerLocTemperature(player); -// } -// int playerTempIconValue = (int) mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120); -// int playerTempHumanReadable = 80 - playerTempIconValue; -// int verticalOffsetFromTopY = 120; -// int horizontalOffsetFromRightX = 0; -// int iconXCoord = 0; -// int iconYCoord = 0; -// -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture( textureLocation )); -// -// scalewidth = 0; -// scaleHeight = scaleHeight/2; -// horizontalOffsetFromRightX = -(26+10); -// verticalOffsetFromTopY -= 50; -// if( (120 - playerTempIconValue) < 20){ -// /* Draw Very Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 150; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// -// }else if( (120 - playerTempIconValue) < 30 ){ -// /* Draw Medium Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 125; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur2.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// }else if ( (120 - playerTempIconValue) < 40 ){ -// /* Draw Little Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 100; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 100 ){ -// /* Draw High Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 50; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 90 ){ -// /* Draw Medium Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 25; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 80 ){ -// /* Draw Little Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 0; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else{ -// /* Draw Frame */ -// iconXCoord = 0; -// iconYCoord = 0; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-12), iconXCoord, iconYCoord, 15, 105); -// -// /* Draw Red Inside */ -// iconXCoord = 200; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// } -// -// /* Draw Marker */ -// iconXCoord = 30; -// iconYCoord = 94; -// int playerLocTemp = MathHelper.floor_float((mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120)) ); -// playerLocTemp = playerLocTemp > 116 ? 116 : playerLocTemp < 14 ? 14 : playerLocTemp; -// -// this.drawTexturedModalRect(scalewidth-(14+horizontalOffsetFromRightX+0), scaleHeight-(8+verticalOffsetFromTopY-playerLocTemp+4), iconXCoord, iconYCoord, 4, 8); -// scalewidth = var3.getScaledWidth(); -// horizontalOffsetFromRightX = 0; -// -// -// -// -// /* Write Temp String TO Top Of Screen, Mostly For Debugging For Now*/ -// byte var8 = 12; -// String var9 = "Current Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120))); -// String var10 = "Max Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120))); -// -//// var2.drawStringWithShadow(var10, scalewidth / 2 - var2.getStringWidth(var10) / 2, var8 - 10, 16711935); -//// var2.drawStringWithShadow(var9, scalewidth / 2 - var2.getStringWidth(var9) / 2, var8 + 10, 16711935); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// -// inGameTicks++; -// } -// -// } -// -// private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6){ -// float var7 = 0.00390625F; -// float var8 = 0.00390625F; -// -// Tessellator var9 = Tessellator.instance; -// var9.startDrawingQuads(); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); -// var9.draw(); -// } -// -// private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of( TickType.RENDER); } -// -// @Override -// public String getLabel() { -// return null; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/503438e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/503438e5c42100141fce95f06aba7e85 deleted file mode 100644 index 109e51f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/503438e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/60f463e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/60f463e4c42100141fce95f06aba7e85 deleted file mode 100644 index a02d752..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/60f463e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/6132aaa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/6132aaa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ef93884..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/6132aaa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,25 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public interface EntityDeclaration { - public abstract boolean shouldExist(); - - /** - * Returns the Entities Unique Identifier. Typically the Entity name, i.e. "Alligator" or "Red Finch" - */ - public abstract String getIdentifier(); - public abstract void loadCreaturesFromConfig(Configuration config); - public abstract void loadBiomesFromConfig(Configuration config); - public abstract void loadCustomMobData(File configDirectory); - public abstract void registerEntity(); - public abstract void registerEgg(); - public abstract void addSpawn(); - - @SideOnly(Side.CLIENT) - public abstract void registerModelAndRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/82a6f4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/82a6f4e5c42100141fce95f06aba7e85 deleted file mode 100644 index 7d78a1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/82a6f4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionInvisibility extends SubItemPotionGeneric { - - public SubItemPotionInvisibility(Item itemID, int subID) { - super(itemID, subID, "potion.invisibility"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.invisibility); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/d0d12fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/d0d12fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6d85e37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/d0d12fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/d19d9fe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/d19d9fe4c42100141fce95f06aba7e85 deleted file mode 100644 index 9b941a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/d19d9fe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,330 +0,0 @@ -package projectzulu.common.core; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - - -public class ObfuscationHelper { - - /** - * Helper used to See if we are unObfuscated by checking for a known non-Obfuscated name - * return true if unObfuscated (eclipse), false if obfuscated (Minecraft) - * @param list - */ - public static boolean isUnObfuscated(Field[] fieldList, String desired){ - for (int i = 0; i < fieldList.length; i++) { - if(fieldList[i].getName().equals(desired)){ - return true; - } - } - return false; - } - - public static boolean isUnObfuscated(Class regularClass, String regularClassName){ - return regularClass.getSimpleName().equals(regularClassName); - } - - public static Object invokeMethod(String eclipseName, String seargeName, Class containingClass, - Object containterInstance, Object... args) { - try { - Method method; - method = getIntanceOfMethod(eclipseName, seargeName, containterInstance); - if (method == null) { - throw new NoSuchMethodException(); - } - method.setAccessible(true); - return method.invoke(containterInstance, args); - } catch (NoSuchMethodException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (InvocationTargetException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } - return null; - } - - private static Method getIntanceOfMethod(String eclipseName, String seargeName, Object containterInstance, Class... topClassToLook) { - Class classToSearch = containterInstance.getClass(); - while (classToSearch.getSuperclass() != null) { - for (Method method : classToSearch.getDeclaredMethods()) { - if (eclipseName.equalsIgnoreCase(method.getName()) || seargeName.equalsIgnoreCase(method.getName())) { - return method; - } - } - classToSearch = classToSearch.getSuperclass(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get Static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Class containingClass, Class type){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(null)); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Object containterInstance, Class type){ - return getFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Get Non-Static Field - */ - public static T getFieldFromReflection(String srgName, String sourceName, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(srgName, containterInstance.getClass(), containterInstance, type); - } catch (NoSuchFieldException e) { - return getFieldFromReflection(sourceName, containterInstance.getClass(), containterInstance, type); - } - } - - public static T getFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(fieldName, containingClass, containterInstance, type); - } catch (NoSuchFieldException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", - fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Object containterInstance, Class type) - throws NoSuchFieldException { - return getCatchableFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, Class type) - throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(containterInstance)); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value) throws NoSuchFieldException{ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - - public static Class getDeclaredClass(String className, Class containingClass){ - for (Class declaredClass : containingClass.getDeclaredClasses()) { - if(declaredClass.getSimpleName().equals(className)){ - return declaredClass; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/e00fcce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/e00fcce5c42100141fce95f06aba7e85 deleted file mode 100644 index 0619536..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/e00fcce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotBrewingStandSingleIngredient extends Slot { - /** The brewing stand this slot belongs to. */ - final ContainerBrewingStandSingle brewingStand; - - public SlotBrewingStandSingleIngredient(ContainerBrewingStandSingle par1ContainerBrewingStand, - IInventory par2IInventory, int par3, int par4, int par5) { - super(par2IInventory, par3, par4, par5); - this.brewingStand = par1ContainerBrewingStand; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - if (par1ItemStack == null) { - return false; - } - - return PotionIngredients.isPotionIngredient(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 64; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/e0503f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/e0503f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c68292..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/e0503f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRhino; -import projectzulu.common.mobs.models.ModelRhino; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/f033fdffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/f033fdffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c0ba51c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4/f033fdffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.blocks.util.StringHelper; -import projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/11f734fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/11f734fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89bba5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/11f734fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/202bbaf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/202bbaf6c42100141fce95f06aba7e85 deleted file mode 100644 index 3749e28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/202bbaf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/20b3b6e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/20b3b6e5c42100141fce95f06aba7e85 deleted file mode 100644 index 702d02f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/20b3b6e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/22628af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/22628af9c42100141fce95f06aba7e85 deleted file mode 100644 index ccd9a52..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/22628af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,129 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData() - .func_150283_g(nodeList.get(clickedIndex).getData().getId()), nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/500ed7ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/500ed7ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 82c558d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/500ed7ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.spike.BlockSpikes; -import projectzulu.common.blocks.spike.RenderSpike; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/708b72a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/708b72a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1967446..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/708b72a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/714f0b9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/714f0b9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a27ea4c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/714f0b9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPolarBear; -import projectzulu.common.mobs.models.ModelPolarBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/71bd3aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/71bd3aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b67eb8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/71bd3aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionBlindness extends SubItemPotionGeneric { - - public SubItemPotionBlindness(Item itemID, int subID) { - super(itemID, subID, "potion.blindness"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 2, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.blindness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/91e32bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/91e32bf8c42100141fce95f06aba7e85 deleted file mode 100644 index f98875d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/91e32bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b01a90a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b01a90a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0f74ce8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b01a90a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class NightBloomFeature extends BiomeFeature { - private int density = 2; - - public NightBloomFeature() { - super("Night Bloom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.nightBloom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 2; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0cc1bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0cc1bfac42100141fce95f06aba7e85 deleted file mode 100644 index 40bc684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/b0cc1bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemAloeVeraSeeds; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c0350fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c0350fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7adaaf1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/c0350fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/d12e78f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/d12e78f8c42100141fce95f06aba7e85 deleted file mode 100644 index 93c45b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/d12e78f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingTriple extends TileEntityBrewingBase { - - public TileEntityBrewingTriple() { - brewingItemStacks = new ItemStack[4]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/e05a6d00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/e05a6d00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9229b3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/e05a6d00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/f092b6f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/f092b6f4c42100141fce95f06aba7e85 deleted file mode 100644 index e848a4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/f092b6f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "com.ngb.projectzulu.common.ClientProxyProjectZulu", serverSide = "com.ngb.projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/f18d01fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/f18d01fac42100141fce95f06aba7e85 deleted file mode 100644 index 58754a4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/40/f18d01fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeSapling; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/000ad8fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/000ad8fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8384e93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/000ad8fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCoconut; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/00e0fdf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/00e0fdf5c42100141fce95f06aba7e85 deleted file mode 100644 index 3626cd1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/00e0fdf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,121 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/102244f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/102244f4c42100141fce95f06aba7e85 deleted file mode 100644 index ddfe4d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/102244f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeDiagonal extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeDiagonal(boolean inverted) { - super(inverted); - } - - /** - * BPOasisEdgeDiagonal G GG GGG - */ - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ - (!inverted ? piecePos.posX : cellSize - 1 - piecePos.posX) >= 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "diagonal"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/310b92fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/310b92fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1bb5af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/310b92fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/3187afe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/3187afe5c42100141fce95f06aba7e85 deleted file mode 100644 index 8106577..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/3187afe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,524 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/3213f59fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/3213f59fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 49280ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/3213f59fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world2; - -import org.apache.commons.lang3.tuple.Pair; - -/** - * For usage see: {@link Pair} - */ -public class BoundaryPair { - private final K lower; - private final V upper; - - public static BoundaryPair createPair(K lower, V upper) { - return new BoundaryPair(lower, upper); - } - - public BoundaryPair(K lower, V upper) { - this.lower = lower; - this.upper = upper; - } - - public K getLowerLimit() { - return lower; - } - - public V getUpperLimit() { - return upper; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/415ab4a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/415ab4a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 625408c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/415ab4a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/91e56bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/91e56bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6096b28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/91e56bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c08c65f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c08c65f4c42100141fce95f06aba7e85 deleted file mode 100644 index 2235a79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/c08c65f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,240 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/e032cfe7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/e032cfe7c42100141fce95f06aba7e85 deleted file mode 100644 index 73512bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/e032cfe7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,570 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - //int var4 = this.worldObj.getEntitiesWithinAABB( - // var13.getClass(), - // AxisAlignedBB - // .getAABBPool() - // .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - // zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - // yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - // .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - // spawnRangeHorizontal * 2)).size(); - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getBoundingBox(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/e1f8469fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/e1f8469fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6dbc811..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/e1f8469fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,262 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/f2ea23ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/f2ea23ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 181fe64..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/41/f2ea23ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/01925c00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/01925c00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6ed23bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/01925c00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/10e454e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/10e454e5c42100141fce95f06aba7e85 deleted file mode 100644 index 8144c51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/10e454e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,188 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/401ac1f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/401ac1f4c42100141fce95f06aba7e85 deleted file mode 100644 index 90999ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/401ac1f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/621767e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/621767e6c42100141fce95f06aba7e85 deleted file mode 100644 index 775491d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/621767e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.BPScatteredTombstonesAndFlowers; -import projectzulu.common.world2.blueprints.BlueprintCemetaryEdge; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain2; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb2; - -public class ArchitectCemetary extends ArchitectBase { - BlueprintSet edge = new BPSetGenericEdge(new BlueprintCemetaryEdge()); - - public ArchitectCemetary(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPScatteredTombstonesAndFlowers())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb2(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemetaryFountain(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintCemetaryFountain2())); - stockpile.addBlueprintSet(edge); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/71d4da9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/71d4da9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8fcf322..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/71d4da9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,147 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a05aeff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a05aeff8c42100141fce95f06aba7e85 deleted file mode 100644 index a46572b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a05aeff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,42 +0,0 @@ -//package com.ngb.projectzulu.common.mobs.entityai; -// -//import net.minecraft.command.IEntitySelector; -//import net.minecraft.entity.EntityLiving; -//import com.ngb.projectzulu.common.mobs.EntityGenericCreature; -//import com.ngb.projectzulu.common.mobs.EntityStates; -// -//public class EntityZuluAINearestRevengeTarget extends EntityAINearestAttackableTarget{ -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5){ -// super(par1EntityLiving, par2Class, par3, par4, par5); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5, boolean par6){ -// super(par1EntityLiving, par2Class, par3, par4, par5, par6); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ -// super(par1, par2, par3, par4, par5, par6, par7IEntitySelector); -// } -// -// /** -// * Returns whether the EntityAIBase should begin execution. -// */ -// public boolean shouldExecute() { -// /* getAITarget acts as Tempory target timer, as it only lasts a few seconds, Reminder: getAttackTarget is the persistent form */ -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.shouldExecute(); -// } -// return false; -// } -// -// @Override -// public boolean continueExecuting() { -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.continueExecuting(); -// } -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a05ffba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a05ffba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0dd1ef4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a05ffba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; - -public class NBTTree { - private NBTNode root; - - public NBTTree(NBTBase rootData, String rootName) { - root = new NBTNode(rootData, null, rootName); - } - - public NBTNode getRootNode() { - return root; - } - - public boolean addNode(NBTBase data, NBTNode parent, String tagName) { - return parent.addChild(data, tagName); - } - - public void removeChildNode(NBTNode nodeToRemove, NBTNode parentNode) { - parentNode.removeChild(nodeToRemove); - } - - public NBTTagCompound toNBTTagCompound() { - NBTTagCompound nbtTagCompound = new NBTTagCompound(); - root.writeNodeandChildrenToNBT(nbtTagCompound); - return (NBTTagCompound) nbtTagCompound.getTag("Properties"); - } - - public ArrayList toArrayList() { - ArrayList nodeList = new ArrayList(); - root.writeNodeandChildrenToArrayList(nodeList); - return nodeList; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a08054f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a08054f5c42100141fce95f06aba7e85 deleted file mode 100644 index 3660cda..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a08054f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelCrocodile extends ModelBase { - ModelRenderer MOUTHBOTROT; - ModelRenderer MOUTHTOPROT; - ModelRenderer BODY1ROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - private ModelRenderer BODY2ROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer BODY3ROT; - private ModelRenderer BODY4ROT; - private ModelRenderer BODY5ROT; - private ModelRenderer BODY6ROT; - private ModelRenderer TAIL1ROT; - private ModelRenderer TAIL2ROT; - private ModelRenderer TAIL3ROT; - private ModelRenderer TAILROT4; - private ModelRenderer TAILROT5; - private ModelRenderer TAILROT6; - private ModelRenderer TAILROT7; - private ModelRenderer TAILROT8; - private ModelRenderer TAILROT9; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - - public ModelCrocodile() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("BODY1ROT.Body1", 62, 0); - setTextureOffset("BODY1ROT.bodydeclef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig1", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig1", 0, 0); - setTextureOffset("BODY1ROT.Shape1", 0, 0); - setTextureOffset("BODY1ROT.bodydeclef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig2", 0, 0); - setTextureOffset("BODY2ROT.Body2", 62, 0); - setTextureOffset("BODY2ROT.bodydeclef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydeclef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig4", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig4", 0, 0); - setTextureOffset("LEG2TOPROT.leg2top", 20, 12); - setTextureOffset("LEG2TOPROT.leg2deco", 16, 8); - setTextureOffset("LEG2BOTROT.leg2bot", 16, 20); - setTextureOffset("LEG1TOPROT.leg1top", 0, 12); - setTextureOffset("LEG1TOPROT.leg1deco", 0, 8); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 20); - setTextureOffset("BODY3ROT.Body3", 62, 0); - setTextureOffset("BODY3ROT.bodydeclef5", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef5", 0, 0); - setTextureOffset("BODY3ROT.bodydeclef6", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef6", 0, 0); - setTextureOffset("BODY4ROT.Body4", 62, 0); - setTextureOffset("BODY4ROT.bodydecinrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinrig8", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef8", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef8", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig8", 0, 0); - setTextureOffset("BODY5ROT.Body5", 62, 0); - setTextureOffset("BODY5ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig10", 0, 0); - setTextureOffset("BODY6ROT.Body6", 62, 0); - setTextureOffset("BODY6ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig10", 0, 0); - setTextureOffset("TAIL1ROT.tail1", 62, 12); - setTextureOffset("TAIL1ROT.bodydecinlef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecinrig11", 0, 0); - setTextureOffset("TAIL1ROT.bodydeclef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecrig11", 0, 0); - setTextureOffset("TAIL2ROT.tail2", 62, 22); - setTextureOffset("TAIL2ROT.bodydeclef12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinlef12", 0, 0); - setTextureOffset("TAIL3ROT.tail3", 62, 31); - setTextureOffset("TAIL3ROT.bodydecrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinlef13", 0, 0); - setTextureOffset("TAIL3ROT.bodydeclef13", 0, 0); - setTextureOffset("TAILROT4.tail4", 62, 40); - setTextureOffset("TAILROT4.bodydecrig14", 0, 0); - setTextureOffset("TAILROT4.bodydecinlef14", 0, 0); - setTextureOffset("TAILROT4.bodydeclef14", 0, 0); - setTextureOffset("TAILROT5.tail5", 62, 48); - setTextureOffset("TAILROT5.bodydeclef15", 0, 0); - setTextureOffset("TAILROT5.bodydecrig16", 0, 0); - setTextureOffset("TAILROT5.bodydecrig15", 0, 0); - setTextureOffset("TAILROT5.bodydeclef16", 0, 0); - setTextureOffset("TAILROT6.tail6", 84, 49); - setTextureOffset("TAILROT6.bodydeclef17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig18", 0, 0); - setTextureOffset("TAILROT6.bodydeclef18", 0, 0); - setTextureOffset("TAILROT7.tail7", 90, 44); - setTextureOffset("TAILROT7.bodydecrig19", 0, 0); - setTextureOffset("TAILROT7.bodydeclef19", 0, 0); - setTextureOffset("TAILROT8.tail8", 94, 40); - setTextureOffset("TAILROT8.bodydecrig20", 0, 0); - setTextureOffset("TAILROT8.bodydeclef20", 0, 0); - setTextureOffset("TAILROT9.tail9", 98, 37); - setTextureOffset("LEG4TOPROT.leg4top", 20, 12); - setTextureOffset("LEG4TOPROT.leg4deco", 16, 8); - setTextureOffset("LEG4BOTROT.leg4bot", 16, 20); - setTextureOffset("LEG3TOPROT.leg3top", 0, 12); - setTextureOffset("LEG3TOPROT.leg3deco", 0, 8); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 20); - - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 17F, -7F); - setRotation(BODY1ROT, 0F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("Body1", -7F, -4F, 0F, 14, 8, 4); - BODY1ROT.addBox("bodydeclef1", -5.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef1", -2F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig1", 1F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig1", 4.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("Shape1", 0F, 0F, 0F, 1, 1, 1); - BODY1ROT.addBox("bodydeclef2", -5.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef2", -2F, -5F, 2.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig2", 4.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig2", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("Body2", -7F, -4F, 0F, 14, 8, 4); - BODY2ROT.addBox("bodydeclef3", -5.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef3", -2F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig3", 4.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig3", 1F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydeclef4", -5.5F, -5F, 3F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef4", -2F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig4", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig4", 4.5F, -5F, 3F, 1, 1, 1); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(7F, 1F, 2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", 0F, -2F, -2F, 6, 4, 4); - LEG2TOPROT.addBox("leg2deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2F, 0F, -2F, 4, 4, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY2ROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-8F, 1F, 2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -5F, -2F, -2F, 6, 4, 4); - LEG1TOPROT.addBox("leg1deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -2F, 0F, -2F, 4, 4, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY2ROT.addChild(LEG1TOPROT); - BODY3ROT = new ModelRenderer(this, "BODY3ROT"); - BODY3ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY3ROT, 0F, 0F, 0F); - BODY3ROT.mirror = true; - BODY3ROT.addBox("Body3", -7F, -4F, 0F, 14, 8, 4); - BODY3ROT.addBox("bodydeclef5", -5.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig5", 4.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig5", 1F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef5", -2F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydeclef6", -5.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig6", 4.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig6", 1F, -5F, 2.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef6", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT = new ModelRenderer(this, "BODY4ROT"); - BODY4ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY4ROT, 0F, 0F, 0F); - BODY4ROT.mirror = true; - BODY4ROT.addBox("Body4", -7F, -4F, 0F, 14, 8, 4); - BODY4ROT.addBox("bodydecinrig7", 1F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef7", -2F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig7", 4.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef7", -5.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydecinrig8", 1F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef8", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef8", -5.5F, -5F, 3F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig8", 4.5F, -5F, 3F, 1, 1, 1); - BODY5ROT = new ModelRenderer(this, "BODY5ROT"); - BODY5ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY5ROT, 0F, 0F, 0F); - BODY5ROT.mirror = true; - BODY5ROT.addBox("Body5", -7F, -4F, 0F, 14, 8, 4); - BODY5ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - BODY6ROT = new ModelRenderer(this, "BODY6ROT"); - BODY6ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY6ROT, 0F, 0F, 0F); - BODY6ROT.mirror = true; - BODY6ROT.addBox("Body6", -7F, -4F, 0F, 14, 8, 4); - BODY6ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - TAIL1ROT = new ModelRenderer(this, "TAIL1ROT"); - TAIL1ROT.setRotationPoint(0F, 0F, 4F); - setRotation(TAIL1ROT, 0F, 0F, 0F); - TAIL1ROT.mirror = true; - TAIL1ROT.addBox("tail1", -6F, -3.5F, 0F, 12, 7, 3); - TAIL1ROT.addBox("bodydecinlef11", -2F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydecinrig11", 1F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydeclef11", -5F, -4.5F, 1F, 1, 1, 1); - TAIL1ROT.addBox("bodydecrig11", 4F, -4.5F, 1F, 1, 1, 1); - TAIL2ROT = new ModelRenderer(this, "TAIL2ROT"); - TAIL2ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL2ROT, 0F, 0F, 0F); - TAIL2ROT.mirror = true; - TAIL2ROT.addBox("tail2", -5.5F, -2.5F, 0F, 11, 6, 3); - TAIL2ROT.addBox("bodydeclef12", -4.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecrig12", 3.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinrig12", 1F, -3.5F, 0.5F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinlef12", -2F, -3.5F, 0.5F, 1, 1, 1); - TAIL3ROT = new ModelRenderer(this, "TAIL3ROT"); - TAIL3ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL3ROT, 0F, 0F, 0F); - TAIL3ROT.mirror = true; - TAIL3ROT.addBox("tail3", -4.5F, -1.5F, 0F, 9, 5, 4); - TAIL3ROT.addBox("bodydecrig13", 2.5F, -2.5F, 1.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinrig13", 0.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinlef13", -1.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydeclef13", -4F, -2.5F, 1.5F, 1, 1, 1); - TAILROT4 = new ModelRenderer(this, "TAILROT4"); - TAILROT4.setRotationPoint(0F, 1.5F, 4F); - setRotation(TAILROT4, 0F, 0F, 0F); - TAILROT4.mirror = true; - TAILROT4.addBox("tail4", -4F, -2F, 0F, 8, 4, 4); - TAILROT4.addBox("bodydecrig14", 2F, -3F, 1.5F, 1, 1, 1); - TAILROT4.addBox("bodydecinlef14", -0.5F, -3F, 0.5F, 1, 1, 1); - TAILROT4.addBox("bodydeclef14", -3F, -3F, 1.5F, 1, 1, 1); - TAILROT5 = new ModelRenderer(this, "TAILROT5"); - TAILROT5.setRotationPoint(0F, 0.5F, 4F); - setRotation(TAILROT5, 0F, 0F, 0F); - TAILROT5.mirror = true; - TAILROT5.addBox("tail5", -3F, -1.5F, 0F, 6, 3, 5); - TAILROT5.addBox("bodydeclef15", -2F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig16", 1F, -2.5F, 3.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig15", 1F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydeclef16", -2F, -2.5F, 3.5F, 1, 1, 1); - TAILROT6 = new ModelRenderer(this, "TAILROT6"); - TAILROT6.setRotationPoint(0F, 0.5F, 5F); - setRotation(TAILROT6, 0F, 0F, 0F); - TAILROT6.mirror = true; - TAILROT6.addBox("tail6", -2.5F, -1F, 0F, 5, 2, 5); - TAILROT6.addBox("bodydeclef17", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig17", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig18", 0.5F, -2F, 3F, 1, 1, 1); - TAILROT6.addBox("bodydeclef18", -1.5F, -2F, 3F, 1, 1, 1); - TAILROT7 = new ModelRenderer(this, "TAILROT7"); - TAILROT7.setRotationPoint(0F, 0F, 5F); - setRotation(TAILROT7, 0F, 0F, 0F); - TAILROT7.mirror = true; - TAILROT7.addBox("tail7", -2F, -1F, 0F, 4, 2, 3); - TAILROT7.addBox("bodydecrig19", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT7.addBox("bodydeclef19", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT8 = new ModelRenderer(this, "TAILROT8"); - TAILROT8.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT8, 0F, 0F, 0F); - TAILROT8.mirror = true; - TAILROT8.addBox("tail8", -1.5F, -1F, 0F, 3, 2, 2); - TAILROT8.addBox("bodydecrig20", 0.5F, -2F, 0.5F, 1, 1, 1); - TAILROT8.addBox("bodydeclef20", -1.5F, -2F, 0.5F, 1, 1, 1); - TAILROT9 = new ModelRenderer(this, "TAILROT9"); - TAILROT9.setRotationPoint(0F, 0F, 2F); - setRotation(TAILROT9, 0F, 0F, 0F); - TAILROT9.mirror = true; - TAILROT9.addBox("tail9", -1F, -1F, 0F, 2, 2, 1); - TAILROT8.addChild(TAILROT9); - TAILROT7.addChild(TAILROT8); - TAILROT6.addChild(TAILROT7); - TAILROT5.addChild(TAILROT6); - TAILROT4.addChild(TAILROT5); - TAIL3ROT.addChild(TAILROT4); - TAIL2ROT.addChild(TAIL3ROT); - TAIL1ROT.addChild(TAIL2ROT); - BODY6ROT.addChild(TAIL1ROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(7F, 1F, 0F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", 0F, -2F, -2F, 6, 4, 4); - LEG4TOPROT.addBox("leg4deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -2F, 0F, -2F, 4, 4, 4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODY6ROT.addChild(LEG4TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-8F, 1F, 0F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -5F, -2F, -2F, 6, 4, 4); - LEG3TOPROT.addBox("leg3deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -2F, 0F, -2F, 4, 4, 4); - LEG3TOPROT.addChild(LEG3BOTROT); - BODY6ROT.addChild(LEG3TOPROT); - BODY5ROT.addChild(BODY6ROT); - BODY4ROT.addChild(BODY5ROT); - BODY3ROT.addChild(BODY4ROT); - BODY2ROT.addChild(BODY3ROT); - BODY1ROT.addChild(BODY2ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 6.0F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.7F / var8, 1.7F / var8, 1.7F / var8); - GL11.glTranslatef(0.0f, field_78145_g * f5, field_78151_h * f5); - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODY1ROT.render(f5); - GL11.glPopMatrix(); - } else { - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - BODY1ROT.render(f5); - - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG2TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG1TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODY1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 0 / 4 * (float) Math.PI) * 0.1F * par3; - BODY2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; - BODY3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 2 / 4 * (float) Math.PI) * 0.1F * par3; - BODY4ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 3 / 4 * (float) Math.PI) * 0.1F * par3; - BODY5ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 4 / 4 * (float) Math.PI) * 0.1F * par3; - BODY6ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 5 / 4 * (float) Math.PI) * 0.1F * par3; - - TAIL1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 6 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 7 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 8 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT4.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 9 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT5.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 10 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT6.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 11 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT7.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 12 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT8.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 13 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT9.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 14 / 4 * (float) Math.PI) * 0.1F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - MOUTHTOPROT.rotateAngleX = -Math.abs(MathHelper.cos(f * 0.6662F) * f1) + Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - MOUTHTOPROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - - MOUTHBOTROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - MOUTHBOTROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a0d088f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a0d088f8c42100141fce95f06aba7e85 deleted file mode 100644 index 24101a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a0d088f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a1b2919ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a1b2919ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d6627a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/a1b2919ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/b1e47b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/b1e47b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 01ae497..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/b1e47b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/c266edfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/c266edfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43dc3dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/c266edfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockQuickSand; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f1a6392bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f1a6392bc52100141fce95f06aba7e85 deleted file mode 100644 index 7efa47e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/42/f1a6392bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/00fc8ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/00fc8ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 3d0d6dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/00fc8ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.core; - -public class DefaultProps { - - /* ModIDs, Dependencies, and Version */ - public static final String DesiredBefore = "after:ExtrabiomesXL@"; - public static final String VERSION_STRING = "1.1.7.3"; - public static final String CoreModId = "ProjectZulu|Core"; - public static final String BlocksModId = "ProjectZulu|Block"; - public static final String MobsModId = "ProjectZulu|Mob"; - public static final String WorldModId = "ProjectZulu|World"; - public static final String DungeonModId = "ProjectZulu|Dungeon"; - public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; - - /* Packet Channels */ - public static final String defaultChannel = "Channel_Zulu"; - - /* Module Directory Keys */ - public static final String coreKey = "projectzulucore"; - public static final String mobKey = "projectzulumob"; - public static final String blockKey = "projectzulublock"; - public static final String worldKey = "projectzuluworld"; - public static final String dungeonKey = "projectzuludungeon"; - - /* Module Resource Directories */ - public static final String coreDiretory = "/mods/" + coreKey + "/"; - public static final String mobDiretory = "/mods/" + mobKey + "/"; - public static final String blockDiretory = "/mods/" + blockKey + "/"; - public static final String worldDiretory = "/mods/" + worldKey + "/"; - public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; - public static final String entitySoundDir = "mob/"; - public static final String entitySounds = entitySoundDir.replace("/", "."); - - /* Common Resource Sub-Directories */ - public static final String itemSubDir = "textures/blocks/"; - public static final String blockSubDir = "textures/blocks/"; -// public static final String blockSpriteSheet = blockDiretory + "blocks_projectzulu.png"; // TODO: Delete -// public static final String itemSpriteSheet = blockDiretory + "items_projectzulu.png"; // TODO: Delete - - /* Config Directories */ - public static final String configDirectory = "/Project Zulu/"; - public static final String customResourcesDirectory = "CustomResources/"; - public static final String streamingResourcesDirectory = "streaming/"; - public static final String soundResourcesDirectory = "sound/"; - public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; - public static final String moduleConfigFile = "ProjectZuluModules.cfg"; - public static final String tempConfigFile = "tempSettingsConfig.cfg"; - public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; - public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/2142b4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/2142b4e5c42100141fce95f06aba7e85 deleted file mode 100644 index 3fcd3c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/2142b4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/40fe72e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/40fe72e6c42100141fce95f06aba7e85 deleted file mode 100644 index a91b1ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/40fe72e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthRandomWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if ((piecePos.posY == 0)) {// || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/41330ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/41330ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 6400d8d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/41330ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelArmadilloHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADPIECE; - - public ModelArmadilloHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADPIECE.Ear2", 17, 0); - setTextureOffset("HEADPIECE.Ear1", 17, 0); - setTextureOffset("HEADPIECE.nose", 12, 9); - setTextureOffset("HEADPIECE.chin", 0, 8); - setTextureOffset("HEADPIECE.head", 0, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - HEADPIECE.setRotationPoint(0F, 0F, 2.5F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - HEADPIECE.addBox("Ear2", -4F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("Ear1", 2F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("nose", -0.5F, 1.5F, -7F, 1, 1, 2); - HEADPIECE.addBox("chin", -1.5F, -0.5F, -5.5F, 3, 3, 3); - HEADPIECE.addBox("head", -2.5F, -2.5F, -2.5F, 5, 5, 3); - CENTERROT.addChild(HEADPIECE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/42b252a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/42b252a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75a5a2a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/42b252a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import net.minecraft.potion.Potion; - -public class ZuluPotionHelper{ - public static void setVanillaPotionProperties() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ - Potion potionToEdit = Potion.potionTypes[Potion.blindness.getId()]; - Method[] potionMethods = potionToEdit.getClass().getDeclaredMethods(); - int doubleCounter = 0; - for (int i = 0; i < potionMethods.length; i++) { - /* Look for setEffectiveness : It has 1 Parameter and it is a double : No other method fits that criteria */ - if(potionMethods[i].getParameterTypes().length == 1 && (potionMethods[i].getParameterTypes())[0].toString().equals("double")){ - potionMethods[i].setAccessible(true); - potionMethods[i].invoke(potionToEdit, 0.03D); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/511549a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/511549a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ab5091a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/511549a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSlowdown extends SubItemPotionGeneric { - - public SubItemPotionMoveSlowdown(Item itemID, int subID) { - super(itemID, subID, "potion.moveSlowdown"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/60bfe39dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/60bfe39dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a18dc98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/60bfe39dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCampfire; -import projectzulu.common.blocks.ItemCampFire; -import projectzulu.common.blocks.RenderCampFire; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/71b29301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/71b29301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 969d594..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/71b29301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/8090c8c0fa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/8090c8c0fa2000141769cb1ed0c338cd deleted file mode 100644 index d83f864..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/8090c8c0fa2000141769cb1ed0c338cd +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.API; - -import net.minecraft.block.Block; - -import com.google.common.base.Optional; - -public enum BlockList { - instance; - public static Optional palmHoloTree = Optional.absent(); // Not Used? - - public static Optional aloeVera = Optional.absent(); - public static Optional wateredDirt = Optional.absent(); - public static Optional tumbleweed = Optional.absent(); - public static Optional jasper = Optional.absent(); - - public static Optional palmTreeLog = Optional.absent(); - public static Optional palmTreePlank = Optional.absent(); - public static Optional palmTreeSlab = Optional.absent(); - public static Optional palmTreeDoubleSlab = Optional.absent(); - public static Optional palmTreeStairs = Optional.absent(); - public static Optional palmTreeLeaves = Optional.absent(); - public static Optional palmTreeSapling = Optional.absent(); - public static Optional coconut = Optional.absent(); - - public static Optional nightBloom = Optional.absent(); - public static Optional creeperBlossom = Optional.absent(); - public static Optional quickSand = Optional.absent(); - - public static Optional spike = Optional.absent(); - public static Optional campfire = Optional.absent(); - public static Optional mobHeads = Optional.absent(); - public static Optional tombstone = Optional.absent(); - - public static Optional universalFlowerPot = Optional.absent(); - public static Optional customBrewingStand = Optional.absent(); - public static Optional limitedMobSpawner = Optional.absent(); - public static Optional brewingStandSingle = Optional.absent(); - public static Optional brewingStandTriple = Optional.absent(); - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/90019ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/90019ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 34926a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/90019ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerUniversalFlowerPot extends Container{ - protected TileEntityUniversalFlowerPot tileEntity; - - public ContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntityUniversalFlowerPot){ - this.tileEntity = tileEntityUniversalFlowerPot; - - // The Slot constructor takes the IInventory and the slot number in that it binds to - // and the x-y coordinates it resides on-screen - addSlotToContainer(new Slot(tileEntity, 0, 79, 17)); - - // Commonly used vanilla code that adds the player's inventory - bindPlayerInventory(inventoryPlayer); - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return tileEntity.isUseableByPlayer(player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { - ItemStack stack = null; - Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) - if (slotObject != null && slotObject.getHasStack()) { - ItemStack stackInSlot = slotObject.getStack(); - stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity - //this assumes only 1 slot, for inventories with > 1 slots, check out the Chest Container. - if (slot == 0) { - if (!mergeItemStack(stackInSlot, 1, inventorySlots.size(), true)) { - return null; - } - //places it into the tileEntity is possible since its in the player inventory - } else if (!mergeItemStack(stackInSlot, 0, 1, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slotObject.putStack(null); - } else { - slotObject.onSlotChanged(); - } - } - - return stack; - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/90ea02fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/90ea02fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index dd94442..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/90ea02fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/a05545ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/a05545ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c9c238..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/a05545ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/b004e4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/b004e4e5c42100141fce95f06aba7e85 deleted file mode 100644 index 8bfec01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/b004e4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.potion; - -/** - * Helper Classes to Parse Generic Potion properties form damage. - * - * Note the only damage values Guaranteed to work for any given SubItemPotion is subID and Splash. Any other bits are up - * to individual subItem to parse and may not conform to standard. - */ -public class PotionParser { - - public static int readID(int value) { - byte lowByte = (byte) (value & getLeastBitMask(4)); - return lowByte & 0xFF; - } - - public static int setID(int iD, int value) { - if (iD < 0 || iD > 15) { - iD = iD < 0 ? 0 : 15; - } - return setBitRange(value, iD, 0, 4); - } - - public static int readLevel(int value) { - byte lowByte = (byte) ((value >> 4) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setLevel(int level, int value) { - if (level < 0 || level > 3) { - level = level < 0 ? 0 : 3; - } - return setBitRange(value, level, 4, 2); - } - - public static int readPower(int value) { - byte lowByte = (byte) ((value >> 6) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setPower(int power, int value) { - if (power < 0 || power > 3) { - power = power < 0 ? 0 : 3; - } - return setBitRange(value, power, 6, 2); - } - - public static int readDuration(int value) { - byte lowByte = (byte) ((value >> 8) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setDuration(int duration, int value) { - if (duration < 0 || duration > 3) { - duration = duration < 0 ? 0 : 3; - } - return setBitRange(value, duration, 8, 2); - } - - public static int readContainer(int value) { - byte lowByte = (byte) ((value >> 10) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setContainer(int container, int value) { - if (container < 0 || container > 3) { - container = container < 0 ? 0 : 3; - } - return setBitRange(value, container, 10, 2); - } - - public static boolean isSplash(int value) { - return isBitSet(value, 14); - } - - public static int setSplash(int value) { - return setBit(value, 14); - } - - /** - * Sets Range of Bits in origValue to bits in ValueToSet starting from staringBitToSet for bitsToSet number of bits - * - * @param origValue - * @param valueToSet - * @param startingBitToSet - * @param bitsToSet - * @return - */ - private static int setBitRange(int origValue, int valueToSet, int startingBitToSet, int bitsToSet) { - for (int i = 0; i < bitsToSet; i++) { - if (isBitSet(origValue, startingBitToSet + i) == !isBitSet(valueToSet, i)) { - origValue = flipBit(origValue, startingBitToSet + i); - } - } - return origValue; - } - - private static boolean isBitSet(int value, int index) { - return (value & (1L << index)) != 0; - } - - private static int setBit(int value, int index) { - return value | (1 << index); - } - - private static int unSetBit(int value, int index) { - return value & ~(1 << index); - } - - private static int flipBit(int value, int index) { - return value ^ (1 << index); - } - - /** - * Returns a Mask to be & with a value to get the specified number of least significant bits - * - * @param value - * @param numBits Number of Least Significant bits desired - * @return - */ - private static int getLeastBitMask(int numBits) { - return ((1 << numBits) - 1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/b1c54ff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/b1c54ff5c42100141fce95f06aba7e85 deleted file mode 100644 index 7898ca2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/b1c54ff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,156 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityFinch; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/c02055e0622300141086b96048d117bc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/c02055e0622300141086b96048d117bc deleted file mode 100644 index f0cdb83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/c02055e0622300141086b96048d117bc +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/c10aa5e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/c10aa5e6c42100141fce95f06aba7e85 deleted file mode 100644 index cc7e747..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/c10aa5e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,66 +0,0 @@ -package projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/d12612a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/d12612a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9924c4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/d12612a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,12 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.util.ResourceLocation; - -public class RenderMimic extends RenderGenericLiving { - public static final ResourceLocation normalChest = new ResourceLocation("textures/entity/chest/normal.png"); - - public RenderMimic(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/f053dafdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/f053dafdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index de6f48b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/f053dafdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/f167a7fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/f167a7fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ce809d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/43/f167a7fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/0162faf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/0162faf9c42100141fce95f06aba7e85 deleted file mode 100644 index 9ebec94..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/0162faf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemFoodProjectZulu; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/10d2669ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/10d2669ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6a4f1f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/10d2669ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.world.World; - -public class TerrainFeatureHelper { - - /** - * Method to evaluate the terrain variation. Compares the height along each point of an X to the center. - * If greater than provided difference return false; - * @param world - * @param Xcoord - * @param Ycoord - * @param Zcoord - * @param maxDifference - * @param squareLength - * @return - */ - public static boolean doesTerrainFluctuate(World world, int Xcoord, int Ycoord, int Zcoord, int maxDifference, int squareLength){ - if( Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord+squareLength) - Ycoord) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord+squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference){ - return false; - } - - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/31f5e2ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/31f5e2ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0fc412b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/31f5e2ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/40f117f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/40f117f9c42100141fce95f06aba7e85 deleted file mode 100644 index 2c64906..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/40f117f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/61ec149fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/61ec149fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 864d693..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/61ec149fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGiraffe; -import projectzulu.common.mobs.models.ModelGiraffe; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a00abbf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a00abbf5c42100141fce95f06aba7e85 deleted file mode 100644 index c6ed032..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a00abbf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a02e7e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a02e7e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a68362..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a02e7e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a09ec49dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a09ec49dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f99f450..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a09ec49dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelElephantHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - - public ModelElephantHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); -// setTextureOffset("EARLEFROT.earlef", 55, 41); -// setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 12F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -6F, 8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); -// EARLEFROT = new ModelRenderer(this, "EARLEFROT"); -// EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); -// setRotation(EARLEFROT, 0F, 1.22173F, 0F); -// EARLEFROT.mirror = true; -// EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARLEFROT); -// EARRIGROT = new ModelRenderer(this, "EARRIGROT"); -// EARRIGROT.setRotationPoint(7F, -0.5F, -4F); -// setRotation(EARRIGROT, 0F, -1.22173F, 0F); -// EARRIGROT.mirror = true; -// EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - TRUNK1ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK2ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK3ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK4ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK5ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK6ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK7ROT.rotateAngleX = (float) (45*Math.PI/180); - -// switch ((int)skullState) { -// case 1: -// NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); -// break; -// -// default: -// NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); -// break; -// } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a23a19e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a23a19e5c42100141fce95f06aba7e85 deleted file mode 100644 index f69063e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/a23a19e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,143 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidBreedingItem() function - */ -public abstract class EntityGenericBreedable extends EntityGenericAgeable{ - - protected int loveTimer = 0; - public boolean isInLove(){return loveTimer > 0 ? true: false;} - public void resetInLove(){ loveTimer = 0; } - - /* How long an Entity should be in Love Mode when Fed */ - protected int loveCooldown = 600; - - public EntityGenericBreedable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* Breeding is all Done Server Side, and only while growingAge is 0 - * Thus on Client, we know that if growage is not 0 we are not breeding / in love anymore*/ - if (this.getGrowingAge() != 0) { - this.loveTimer = 0; - } - - /* Decrement loveTimer for the purpose of hearts */ - if(getEntityState() == EntityStates.inLove){ - loveTimer--; - if(loveTimer % 10 == 0){ - String var1 = "heart"; - double var2 = this.rand.nextGaussian() * 0.02D; - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var1, - this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, - this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), - this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); - } - } - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding - * This is overriden by each Entity if deviations from default are desired - */ - public boolean isValidBreedingItem(ItemStack itemStack){ - return false; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if (var2 != null && this.isValidBreedingItem(var2) && this.getGrowingAge() == 0) { - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - - this.loveTimer = loveCooldown; - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } - - return true; - } - else { - return super.interact(par1EntityPlayer); - } - } - - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityGenericBreedable targetEntity){ - /* If Passed Entity is Self or Different Type, return False */ - if(targetEntity == this || targetEntity.getClass() != this.getClass()){ - return false; - } - /* Otherwise, if Target is in Love, and Self is. Then let them mate */ - if(this.isInLove() && targetEntity.isInLove()){ - return true; - } - - return false; - } - - /** - * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal of their Type. - */ - public EntityGenericBreedable getBabyAnimalEntity(Entity par1EntityAnimal) { - Object object = null; - try { - Class thisClass = par1EntityAnimal.getClass(); - Constructor ctor= thisClass.getConstructor(World.class); - try { - object = ctor.newInstance(new Object[] { this.worldObj }); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - return (EntityGenericBreedable) object; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/b117c4fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/b117c4fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b5b957..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/b117c4fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,174 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/b1ef22a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/b1ef22a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9089f09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/b1ef22a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,349 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d072a7ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d072a7ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb281ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/d072a7ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/f0ebbeb2c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/f0ebbeb2c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 129b7d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/f0ebbeb2c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,235 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - //worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), tempE.posZ), - //worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ) - - Vec3.createVectorHelper((double)tempE.posX, (double) tempE.posY + tempE.getEyeHeight(),(double) tempE.posZ), - Vec3.createVectorHelper((double)this.posX, (double) this.posY,(double) this.posZ) - ) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/f0f791e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/f0f791e6c42100141fce95f06aba7e85 deleted file mode 100644 index 1cd0fef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/44/f0f791e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.api.BlockList; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/114df1ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/114df1ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9850c7a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/114df1ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class NightBloomFeature extends BiomeFeature { - private int density = 2; - - public NightBloomFeature() { - super("Night Bloom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.nightBloom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 2; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/119dcba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/119dcba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f66582..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/119dcba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.minecraftforge.common.config.Configuration; - -public class ProjectZuluLog { - - private static Logger myLog; - public static boolean isSetup; - - public enum LogType { - SPAWNING, DEBUG; - public boolean isEnabled = false; - } - - public static void configureLogging(File configDirectory) { - if (!isSetup) { - isSetup = true; - myLog = Logger.getLogger("ProjectZulu|Core"); - myLog.setParent(Logger.getLogger("ForgeModLoader")); - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - for (LogType type : LogType.values()) { - if (type == LogType.DEBUG) { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", false, - "Master Switch For All Debug Printing (Not Fully Implemented)").getBoolean(false); - } else { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", true, - "Enables " + type + " Logging").getBoolean(true); - } - } - config.save(); - - } - } - - public static void log(Level level, String format, Object... data) { - myLog.log(level, String.format(format, data)); - } - - public static void info(String format, Object... data) { - log(Level.INFO, format, data); - } - - public static void warning(String format, Object... data) { - log(Level.WARNING, format, data); - } - - public static void severe(String format, Object... data) { - log(Level.SEVERE, format, data); - } - - public static void debug(Level level, String format, Object... data) { - if (LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } - - public static void log(LogType type, Level level, String format, Object... data) { - if (type.isEnabled || LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/212bbaf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/212bbaf6c42100141fce95f06aba7e85 deleted file mode 100644 index b9ed54f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/212bbaf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.blocks.util.StringHelper; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/21b3b6e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/21b3b6e5c42100141fce95f06aba7e85 deleted file mode 100644 index 3d6219f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/21b3b6e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/307f4900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/307f4900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8249e3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/307f4900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/30d15f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/30d15f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c5fb7f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/30d15f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/320fa901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/320fa901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ea8d873..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/320fa901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/502eb4fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/502eb4fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f3cf49b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/502eb4fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6105799fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6105799fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index aded3cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/6105799fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingTriple extends TileEntityBrewingBase { - - public TileEntityBrewingTriple() { - brewingItemStacks = new ItemStack[4]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/81b794f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/81b794f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6d6d269..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/81b794f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; -import com.ngb.projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/92f2659fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/92f2659fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2424d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/92f2659fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/a02dbef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/a02dbef7c42100141fce95f06aba7e85 deleted file mode 100644 index 4569a3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/a02dbef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBearHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBearHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 20F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/b19feaf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/b19feaf8c42100141fce95f06aba7e85 deleted file mode 100644 index 576bac1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/b19feaf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBlackBear; -import com.ngb.projectzulu.common.mobs.models.ModelBlackBear; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d1861a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d1861a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e404ac4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d1861a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemWateredDirt extends ItemBlock { - - public ItemWateredDirt(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "soil_1"; - break; - } - case 1: { - name = "soil_2"; - break; - } - case 2: { - name = "soil_3"; - break; - } - case 3: { - name = "soil_4"; - break; - } - case 4: { - name = "sand_1"; - break; - } - case 5: { - name = "sand_2"; - break; - } - case 6: { - name = "sand_3"; - break; - } - case 7: { - name = "sand_4"; - break; - } - default: - name = "ore"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d18badf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d18badf7c42100141fce95f06aba7e85 deleted file mode 100644 index f24384b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d18badf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,52 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelPenguinHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelPenguinHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 24F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d1f7a7f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d1f7a7f5c42100141fce95f06aba7e85 deleted file mode 100644 index e62996f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/d1f7a7f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f04c6100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f04c6100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11bc37a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f04c6100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f0b3db9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f0b3db9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 285c0e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/45/f0b3db9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/1148009ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/1148009ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 132c1ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/1148009ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public ScaleArmorDeclaration(int renderIndex) { - super(new String[] { "ScaleHelmet", "ScaleChest", "ScaleLegs", "ScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.scaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.scaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.scaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.scaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.scaleArmorHead.get(); - break; - case 1: - item = ItemList.scaleArmorChest.get(); - break; - case 2: - item = ItemList.scaleArmorLeg.get(); - break; - case 3: - item = ItemList.scaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/2042b4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/2042b4e5c42100141fce95f06aba7e85 deleted file mode 100644 index 0155d5c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/2042b4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/4130569ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/4130569ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7839452..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/4130569ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60dbffe3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60dbffe3c42100141fce95f06aba7e85 deleted file mode 100644 index cbd8e09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/60dbffe3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/704a749fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/704a749fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0619536..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/704a749fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotBrewingStandSingleIngredient extends Slot { - /** The brewing stand this slot belongs to. */ - final ContainerBrewingStandSingle brewingStand; - - public SlotBrewingStandSingleIngredient(ContainerBrewingStandSingle par1ContainerBrewingStand, - IInventory par2IInventory, int par3, int par4, int par5) { - super(par2IInventory, par3, par4, par5); - this.brewingStand = par1ContainerBrewingStand; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - if (par1ItemStack == null) { - return false; - } - - return PotionIngredients.isPotionIngredient(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 64; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/70d6de5f052100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/70d6de5f052100141769cb1ed0c338cd deleted file mode 100644 index edb277b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/70d6de5f052100141769cb1ed0c338cd +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIWander extends EntityAIBase -{ - private EntityCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/807e5ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/807e5ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 9756b5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/807e5ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockTumbleweed; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class TumbleweedDeclaration extends BlockDeclaration { - - public TumbleweedDeclaration() { - super("Tumbleweed"); - } - - @Override - protected boolean createBlock() { - BlockList.tumbleweed = Optional.of((new BlockTumbleweed()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tumbleweed.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/80f78e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/80f78e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b532f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/80f78e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,164 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import projectzulu.common.blocks.FurPeltDeclaration; -import projectzulu.common.blocks.ItemBlockRecipeManager; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import projectzulu.common.blocks.terrain.AloeVeraFeature; -import projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import projectzulu.common.blocks.terrain.NightBloomFeature; -import projectzulu.common.blocks.terrain.PalmTreeFeature; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.PotionEvents; -import projectzulu.common.potion.EventHandleNullPotions; -import projectzulu.common.potion.PZExtraPotionDeclaration; -import projectzulu.common.potion.PZVanillaPotionDeclaration; -import projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/92652ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/92652ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bd660aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/92652ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionSlowFall extends PotionZulu { - - public PotionSlowFall(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(0, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - amplifier = amplifier > 10 ? 10 : amplifier < 0 ? 0 : amplifier; - if (par1EntityLiving.fallDistance > (10 - amplifier) * 2) { - par1EntityLiving.fallDistance = (10 - amplifier) * 2; - } - par1EntityLiving.motionY = Math.max(par1EntityLiving.motionY, -1.2f + (amplifier + 1f) * (0.1f)); - super.performEffect(par1EntityLiving, amplifier); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 4 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/b0353001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/b0353001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9d05a21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/b0353001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityLizardSpit; -import projectzulu.common.mobs.renders.RenderLizardSpit; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d0bb8000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d0bb8000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 74942ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/d0bb8000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,133 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/e00271f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/e00271f8c42100141fce95f06aba7e85 deleted file mode 100644 index ba2c45d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/e00271f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -public class PotionThorns extends PotionZulu { - - public PotionThorns(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/f015a89dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/f015a89dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1dde782..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/46/f015a89dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/3127c2a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/3127c2a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9eef49..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/3127c2a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,126 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.base.Optional; - -public class OptionalItemStack { - enum OptionalType { - BLOCK, ITEM, OREDIC; - } - - private OptionalType type = OptionalType.BLOCK; - private Optional itemBlock; - private int meta; - private int stackSize; - - public OptionalItemStack(Optional itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - - if (itemBlock.isPresent()) { - if (itemBlock.get() instanceof Item) { - type = OptionalType.ITEM; - } else if (itemBlock.get() instanceof Block) { - type = OptionalType.BLOCK; - } else if (itemBlock.get() instanceof String) { - type = OptionalType.OREDIC; - } - } else { - itemBlock = Optional.absent(); - } - } - - /* Item */ - public OptionalItemStack(Item itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.ITEM); - } - - /* Block */ - public OptionalItemStack(Block itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.BLOCK); - } - - /* Ore Dictionary String */ - public OptionalItemStack(String itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.OREDIC); - } - - /** Optional Parameter With Supplied Type */ - public OptionalItemStack(Optional itemBlock, OptionalType type) { - this(itemBlock, 1, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, OptionalType type) { - this(itemBlock, stackSize, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta, OptionalType type) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - this.type = type; - } - - public boolean isPresent() { - return itemBlock != null && itemBlock.isPresent(); - } - - public ItemStack createItemStack() { - switch (type) { - case BLOCK: - return new ItemStack((Block) (itemBlock.get()), stackSize, meta); - case ITEM: - return new ItemStack((Item) (itemBlock.get()), stackSize, meta); - default: - throw new IllegalStateException("Cannot create ItemStack for OptionalType"); - } - } - - public Object createRecipeObject() { - switch (type) { - case BLOCK: - case ITEM: - return createItemStack(); - case OREDIC: - return itemBlock.get(); - default: - throw new IllegalStateException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/404e519ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/404e519ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cb705d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/404e519ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.util.MathHelper; - -public class ModelHelper { - - /** - * Absolute Value alternative to {@link MathHelper#abs(float par0)} for Double values - */ - public static double abs(double value) { - if (value < 0) { - return 0f; - } else { - return value; - } - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value may be outside - * the range of values. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value will be clamped - * to the min.max values of the target range. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueWithClamp(float value, float set1min, float set1max, float set2min, float set2max) { - float value2 = (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - value2 = MathHelper.clamp_float(value2, set2min, set2max); - return value2; - } - - /** - * Vanilla Function used for Rotations - * - * @param par1 - * @param par2 - * @return - */ - // TODO: Rename To Something Decent, deobfuscate parameters - public static float func_78172_a(float par1, float par2) { - return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); - } - - /** - * Sets the RotationPoint of the provided Model using the value interpolated to the desired ranges foreach direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotationPoint(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotationPointX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotationPointY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotationPointZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } - - /** - * Sets the Rotation of the provided Model using the value interpolated to the desired ranges for each direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotation(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotateAngleX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotateAngleY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotateAngleZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/51d26be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/51d26be6c42100141fce95f06aba7e85 deleted file mode 100644 index 146cbb6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/51d26be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/61ddde9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/61ddde9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 30b6bc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/61ddde9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/7198cdffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/7198cdffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4e6504d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/7198cdffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/82158a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/82158a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 13a01bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/82158a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/914f9b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/914f9b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 897b6f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/914f9b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/91b1c1ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/91b1c1ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cecf04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/91b1c1ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/926095a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/926095a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c0b3479..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/926095a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,137 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.Blueprint; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BPSetCathedral implements BlueprintSet { - boolean isAssigned = false; - - Blueprint dome = new BPCathedralDome(); - Blueprint hallway = new BPCathedralHallway(); - Blueprint hallwayEnd = new BPCathedralHallwayEnd(); - Blueprint hallwayEnt = new BPCathedralHallwayEntrance(); - Blueprint entrance = new BPCathedralEntrance(); - Blueprint west_tower = new BPCathedralWestTower(); - Blueprint east_tower = new BPCathedralEastTower(); - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return !isAssigned; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.EastWall); - - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthWall); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 5, entrance.getIdentifier(),// entrance - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 5, entrance.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 5, west_tower.getIdentifier(), // west_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 5, west_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 6].getHeight()); - - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 5, east_tower.getIdentifier(), // east_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 5, east_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 6].getHeight()); - isAssigned = true; - return true; - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection) { - applyBlueprintToCell(cellList, xCell, zCell, subBuildingID, cellDirection, 0); - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection, int heightIncrease) { - cellList[xCell][zCell].setBuildingProperties(getIdentifier().concat("-").concat(subBuildingID), cellDirection); - cellList[xCell][zCell].rawState = -1; - cellList[xCell][zCell].setHeight(cellList[xCell][zCell].getHeight() + heightIncrease); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String childBuildingID = buildingID.split("-")[1]; - if (childBuildingID != null) { - if (childBuildingID.equals(dome.getIdentifier())) { - return dome.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallway.getIdentifier())) { - return hallway.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnd.getIdentifier())) { - return hallwayEnd.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnt.getIdentifier())) { - return hallwayEnt.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(entrance.getIdentifier())) { - return entrance.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(west_tower.getIdentifier())) { - return west_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(east_tower.getIdentifier())) { - return east_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - } - return null; - } - - @Override - public String getIdentifier() { - return "Cathedral"; - } - - @Override - public int getWeight() { - return 20; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/b01584f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/b01584f8c42100141fce95f06aba7e85 deleted file mode 100644 index 9991a12..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/b01584f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandSingle extends BlockBrewingStandBase { - - public BlockBrewingStandSingle(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new TileEntityBrewingSingle(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/b1a481f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/b1a481f8c42100141fce95f06aba7e85 deleted file mode 100644 index 8b16bdd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/b1a481f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,147 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ContainerBrewingStandSingle extends Container { - - private TileEntityBrewingBase tileBrewingStand; - - /** Instance of Slot. */ - private final Slot theSlot; - private int brewTime = 0; - public final int potionSlots; - - public ContainerBrewingStandSingle(InventoryPlayer par1InventoryPlayer, TileEntityBrewingBase brewingStand) { - this.tileBrewingStand = brewingStand; - potionSlots = tileBrewingStand.getSizeInventory() - 1; - int slotID = 0; - if (potionSlots >= 1) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 79, - 53)); - } - - if (potionSlots >= 3) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 56, - 46)); - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, - 102, 46)); - } - this.theSlot = this.addSlotToContainer(new SlotBrewingStandSingleIngredient(this, brewingStand, slotID++, 79, - 17)); - int i; - - /* Add Inventory Slots */ - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - /* Add Hot Bar Slots */ - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - - /** - * Looks for changes made in the container, sends them to every listener. - */ - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.brewTime != this.tileBrewingStand.getBrewTime()) { - icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - } - this.brewTime = this.tileBrewingStand.getBrewTime(); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - if (par1 == 0) { - this.tileBrewingStand.setBrewTime(par2); - } - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - int potionMin = 0; - int potionMax = potionSlots + 1; // 4; - int hotBarMin = potionSlots + 1 + 3 * 9; // 31; - int hotBarMax = potionSlots + 1 + 3 * 9 + 9; // 40; - int inventMin = potionSlots + 1; // 4; - int inventMax = potionSlots + 1 + 3 * 9;// 31; - - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - if ((par2 < 0 || par2 > potionMax)) { - if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) { - if (!this.mergeItemStack(itemstack1, potionMax - 1, potionMax, false)) { - return null; - } - } else if (SlotBrewingStandSinglePotion.canHoldPotion(itemstack)) { - if (!this.mergeItemStack(itemstack1, potionMin, potionMax - 1, false)) { - return null; - } - } else if (par2 >= inventMin && par2 < inventMax) { - if (!this.mergeItemStack(itemstack1, hotBarMin, hotBarMax, false)) { - return null; - } - } else if (par2 >= hotBarMin && par2 < hotBarMax) { - if (!this.mergeItemStack(itemstack1, inventMin, inventMax, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, false)) { - return null; - } - } else { - if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, true)) { - return null; - } - slot.onSlotChange(itemstack1, itemstack); - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - return itemstack; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/c160d601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/c160d601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 534f64b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/c160d601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.Random; - -import projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/c1d8dce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/c1d8dce5c42100141fce95f06aba7e85 deleted file mode 100644 index f7fe156..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/c1d8dce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class EntityPZPotion extends EntityPotion { - - private ItemStack potionStack; - - public EntityPZPotion(World par1World) { - super(par1World); - } - - public EntityPZPotion(World world, EntityLivingBase living, ItemStack itemStack) { - super(world, living, itemStack); - potionStack = itemStack; - } - - public EntityPZPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { - super(par1World, par2, par4, par6, par8ItemStack); - potionStack = par8ItemStack; - } - - @Override - public int getPotionDamage() { - return potionStack != null ? potionStack.getItemDamage() : 0; - } - - @Override - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { - if (!this.worldObj.isRemote && potionStack.getItem() != null && potionStack.getItem() instanceof ItemPotion) { - @SuppressWarnings("unchecked") - List effectList = ((ItemPotion) potionStack.getItem()).getEffects(potionStack); - - if (effectList != null && !effectList.isEmpty()) { - AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - @SuppressWarnings("unchecked") - List entityList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, - axisalignedbb); - - if (entityList != null && !entityList.isEmpty()) { - Iterator iterator = entityList.iterator(); - - while (iterator.hasNext()) { - EntityLivingBase entityliving = iterator.next(); - double squareDistance = this.getDistanceSqToEntity(entityliving); - - if (squareDistance < 16.0D) { - double distanceFactor = 1.0D - Math.sqrt(squareDistance) / 4.0D; - - if (entityliving == par1MovingObjectPosition.entityHit) { - distanceFactor = 1.0D; - } - - Iterator iterator1 = effectList.iterator(); - - while (iterator1.hasNext()) { - PotionEffect potioneffect = iterator1.next(); - int potionID = potioneffect.getPotionID(); - - if (Potion.potionTypes[potionID].isInstant()) { - Potion.potionTypes[potionID].affectEntity(this.getThrower(), entityliving, - potioneffect.getAmplifier(), distanceFactor); - } else { - int potionDuration = (int) (distanceFactor * potioneffect.getDuration() + 0.5D); - - if (potionDuration > 20) { - entityliving.addPotionEffect(new PotionEffect(potionID, potionDuration, - potioneffect.getAmplifier())); - } - } - } - } - } - } - } - - this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), - (int) Math.round(this.posZ), potionStack.getItemDamage()); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - if (par1NBTTagCompound.hasKey("Potion")) { - potionStack = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); - } - - if (potionStack == null) { - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - if (potionStack != null) { - par1NBTTagCompound.setTag("Potion", potionStack.writeToNBT(new NBTTagCompound())); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/f0b1fce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/f0b1fce4c42100141fce95f06aba7e85 deleted file mode 100644 index 07c0aa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/f0b1fce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/f26f0aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/f26f0aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b6d49d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/47/f26f0aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,17 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public enum PotionList { - INSTANCE; - public static Optional bubbling = Optional.absent(); - public static Optional incendiary = Optional.absent(); - public static Optional slowfall = Optional.absent(); - public static Optional cleansing = Optional.absent(); - public static Optional curse = Optional.absent(); - public static Optional thorn = Optional.absent(); - public static Optional heal2 = Optional.absent(); - public static Optional harm2 = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/204c407f092100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/204c407f092100141769cb1ed0c338cd deleted file mode 100644 index 276d1a4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/204c407f092100141769cb1ed0c338cd +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.EntityCreature; -import projectzulu.common.mobs.entityai.EntityAITarget; -//import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/3013f59fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/3013f59fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 370f9c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/3013f59fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/30f7c4fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/30f7c4fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2c8ae38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/30f7c4fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/405d12f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/405d12f7c42100141fce95f06aba7e85 deleted file mode 100644 index 5c32e13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/405d12f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,42 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockZuluStairs; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/41ad46fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/41ad46fac42100141fce95f06aba7e85 deleted file mode 100644 index 141d24e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/41ad46fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,380 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/51d9ddf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/51d9ddf9c42100141fce95f06aba7e85 deleted file mode 100644 index d0f71a6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/51d9ddf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,297 +0,0 @@ -package com.ngb.projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/601946a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/601946a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 117cbe3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/601946a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/619ea0f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/619ea0f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6aca324..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/619ea0f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,872 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityPelican; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/704895e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/704895e5c42100141fce95f06aba7e85 deleted file mode 100644 index db8b279..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/704895e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,178 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/70c098f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/70c098f6c42100141fce95f06aba7e85 deleted file mode 100644 index 238e105..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/70c098f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,111 +0,0 @@ -//package com.ngb.projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -//import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -//import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -//import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -//import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/72e5dbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/72e5dbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11e18ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/72e5dbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/802d2ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/802d2ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 14154b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/802d2ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/812ad7fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/812ad7fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1127336..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/812ad7fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGreenFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/8179c3e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/8179c3e4c42100141fce95f06aba7e85 deleted file mode 100644 index f92b50a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/8179c3e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; - -import org.lwjgl.util.Point; - -public class GuiSaveableTextField extends GuiTextField { - - public GuiSaveableTextField(FontRenderer fontRenderer, int xPos, int yPos, int width, int height) { - super(fontRenderer, xPos, yPos, width, height); - } - - public GuiSaveableTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(maxTextChars); - } - - public GuiSaveableTextField(GuiSaveableTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setText(oldTextFields.getText()); - setupTextField(maxTextChars); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/a10a309ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/a10a309ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1d2f276..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/a10a309ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,196 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.blocks.ModelTombstone; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c09eaeffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c09eaeffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 764b8e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/c09eaeffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockAloeVera; -import projectzulu.common.blocks.ItemAloeVera; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/d0909360c8ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/d0909360c8ab00141ee9bf3050c1025b new file mode 100644 index 0000000..e35c147 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/d0909360c8ab00141ee9bf3050c1025b @@ -0,0 +1,117 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + private Configuration config; + private boolean bugRelease = true; + private boolean stickSpawn = true; + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void preInit(FMLPreInitializationEvent event, File configDirectory) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + //displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + config.save(); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e1f1d0e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e1f1d0e5c42100141fce95f06aba7e85 deleted file mode 100644 index 27b395e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/48/e1f1d0e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,13 +0,0 @@ -package projectzulu.common.potion.effects; - -public class PotionBubbling extends PotionZulu { - - protected PotionBubbling(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - @Override - public boolean isInstant() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/0093be01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/0093be01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 467a0d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/0093be01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,220 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEnd implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - return getWallBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall); - } else { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/00e920a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/00e920a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 926f898..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/00e920a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/402d83a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/402d83a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5938363..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/402d83a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40a04ce8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40a04ce8c42100141fce95f06aba7e85 deleted file mode 100644 index 0650f49..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40a04ce8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityGenericCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityGenericCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, - //this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - Vec3.createVectorHelper((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40b5b0f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40b5b0f6c42100141fce95f06aba7e85 deleted file mode 100644 index 95a0081..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/40b5b0f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.core; - -public class DefaultProps { - - /* ModIDs, Dependencies, and Version */ - public static final String DesiredBefore = "after:ExtrabiomesXL@"; - public static final String VERSION_STRING = "1.1.7.3"; - public static final String CoreModId = "ProjectZulu|Core"; - public static final String BlocksModId = "ProjectZulu|Block"; - public static final String MobsModId = "ProjectZulu|Mob"; - public static final String WorldModId = "ProjectZulu|World"; - public static final String DungeonModId = "ProjectZulu|Dungeon"; - public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; - - /* Packet Channels */ - public static final String defaultChannel = "Channel_Zulu"; - - /* Module Directory Keys */ - public static final String coreKey = "projectzulucore"; - public static final String mobKey = "projectzulumob"; - public static final String blockKey = "projectzulublock"; - public static final String worldKey = "projectzuluworld"; - public static final String dungeonKey = "projectzuludungeon"; - - /* Module Resource Directories */ - public static final String coreDiretory = "/mods/" + coreKey + "/"; - public static final String mobDiretory = "/mods/" + mobKey + "/"; - public static final String blockDiretory = "/mods/" + blockKey + "/"; - public static final String worldDiretory = "/mods/" + worldKey + "/"; - public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; - public static final String entitySoundDir = "mob/"; - public static final String entitySounds = entitySoundDir.replace("/", "."); - - /* Common Resource Sub-Directories */ - public static final String itemSubDir = "textures/blocks/"; - public static final String blockSubDir = "textures/blocks/"; -// public static final String blockSpriteSheet = blockDiretory + "blocks_projectzulu.png"; // TODO: Delete -// public static final String itemSpriteSheet = blockDiretory + "items_projectzulu.png"; // TODO: Delete - - /* Config Directories */ - public static final String configDirectory = "/Project Zulu/"; - public static final String customResourcesDirectory = "CustomResources/"; - public static final String streamingResourcesDirectory = "streaming/"; - public static final String soundResourcesDirectory = "sound/"; - public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; - public static final String moduleConfigFile = "ProjectZuluModules.cfg"; - public static final String tempConfigFile = "tempSettingsConfig.cfg"; - public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; - public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/51fce4a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/51fce4a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1a9641a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/51fce4a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,156 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFinch; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/603cd4f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/603cd4f9c42100141fce95f06aba7e85 deleted file mode 100644 index 1a3d0c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/603cd4f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,196 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.blocks.ModelTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/816760f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/816760f5c42100141fce95f06aba7e85 deleted file mode 100644 index 6822b57..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/816760f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityTreeEnt; -import com.ngb.projectzulu.common.mobs.models.ModelTreeEnt; -import com.ngb.projectzulu.common.mobs.renders.RenderSnow; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/81fbc3ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/81fbc3ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9a2571..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/81fbc3ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockJasper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/9083d0f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/9083d0f4c42100141fce95f06aba7e85 deleted file mode 100644 index 155b406..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/9083d0f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionInvisibility extends SubItemPotionGeneric { - - public SubItemPotionInvisibility(Item itemID, int subID) { - super(itemID, subID, "potion.invisibility"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.invisibility); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/90f2659fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/90f2659fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d87c2ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/90f2659fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/b059b3ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/b059b3ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6333318..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/b059b3ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/f226a2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/f226a2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2503ef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/49/f226a2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,174 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/11cdcf9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/11cdcf9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2936a7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/11cdcf9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,309 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/219ef5a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/219ef5a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b566a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/219ef5a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,872 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/50de74f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/50de74f9c42100141fce95f06aba7e85 deleted file mode 100644 index 40ce1f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/50de74f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/70046af5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/70046af5c42100141fce95f06aba7e85 deleted file mode 100644 index 54cce7d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/70046af5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityPenguin; -import com.ngb.projectzulu.common.mobs.models.ModelPenguin; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PenguinDeclaration extends SpawnableDeclaration { - - public PenguinDeclaration() { - super("Penguin", 14, EntityPenguin.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (22 << 16) + (16 << 8) + 13; - eggColor2 = (235 << 16) + (235 << 8) + 235; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/905253e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/905253e4c42100141fce95f06aba7e85 deleted file mode 100644 index 132c1ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/905253e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public ScaleArmorDeclaration(int renderIndex) { - super(new String[] { "ScaleHelmet", "ScaleChest", "ScaleLegs", "ScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.scaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.scaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.scaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.scaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.scaleArmorHead.get(); - break; - case 1: - item = ItemList.scaleArmorChest.get(); - break; - case 2: - item = ItemList.scaleArmorLeg.get(); - break; - case 3: - item = ItemList.scaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/90652ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/90652ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7f31f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/90652ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,52 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHeal2 extends PotionZulu { - - public PotionHeal2(int par1, boolean par2) { - super(par1, par2, 16262179); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - par1EntityLiving.heal(amplifier * 3); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/907f84e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/907f84e5c42100141fce95f06aba7e85 deleted file mode 100644 index 8cc96e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/907f84e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityVulture; -import projectzulu.common.mobs.models.ModelVulture; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9163689fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9163689fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d108923..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/9163689fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.BossHealthDisplayTicker; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render bubbling = Optional.absent(); - public static Optional incendiary = Optional.absent(); - public static Optional slowfall = Optional.absent(); - public static Optional cleansing = Optional.absent(); - public static Optional curse = Optional.absent(); - public static Optional thorn = Optional.absent(); - public static Optional heal2 = Optional.absent(); - public static Optional harm2 = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/b103f7fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/b103f7fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e99f15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/b103f7fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.BlockTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/c067dae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/c067dae5c42100141fce95f06aba7e85 deleted file mode 100644 index bd660aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/c067dae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionSlowFall extends PotionZulu { - - public PotionSlowFall(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(0, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - amplifier = amplifier > 10 ? 10 : amplifier < 0 ? 0 : amplifier; - if (par1EntityLiving.fallDistance > (10 - amplifier) * 2) { - par1EntityLiving.fallDistance = (10 - amplifier) * 2; - } - par1EntityLiving.motionY = Math.max(par1EntityLiving.motionY, -1.2f + (amplifier + 1f) * (0.1f)); - super.performEffect(par1EntityLiving, amplifier); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 4 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/d1aeb49fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/d1aeb49fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 70f8fe6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/d1aeb49fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; - -public class ChestWithMeta extends BlockWithMeta { - - int lootChance; - int maxLoot; - TileEntityChest tileEntityChest; - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance) { - this(block, meta, tileEntityChest, lootChance, -1); - } - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance, int maxLoot) { - super(block, meta); - this.tileEntityChest = tileEntityChest; - this.lootChance = lootChance; - this.maxLoot = maxLoot; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntityChest); - int amountOfLoot = 0; - for (int slot = 0; slot < tileEntityChest.getSizeInventory(); slot++) { - if (lootChance - random.nextInt(100) >= 0) { - tileEntityChest.setInventorySlotContents(slot, ChestGenHooks.getOneItem(DUNGEON_CHEST, random)); - amountOfLoot++; - if (maxLoot > 0 && amountOfLoot >= maxLoot) { - break; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/f16567f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/f16567f8c42100141fce95f06aba7e85 deleted file mode 100644 index 763536f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4a/f16567f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionBlindness; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionBubbling; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionCleansing; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionCurse; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionJump; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionResistance; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionThorns; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/00f9d69ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/00f9d69ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b430b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/00f9d69ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/108b691df52000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/108b691df52000141769cb1ed0c338cd deleted file mode 100644 index 8bf0969..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/108b691df52000141769cb1ed0c338cd +++ /dev/null @@ -1,5 +0,0 @@ -package modExample; - -public class modExample { - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/214926f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/214926f9c42100141fce95f06aba7e85 deleted file mode 100644 index e205f8c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/214926f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityGreenFinch extends EntityFinch{ - - public EntityGreenFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/4144aef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/4144aef6c42100141fce95f06aba7e85 deleted file mode 100644 index 3c5827e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/4144aef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/726858ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/726858ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c01703d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/726858ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/72d9719fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/72d9719fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2978a2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/72d9719fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,184 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import projectzulu.common.core.RenderHelper; -import projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/8137d19fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/8137d19fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f64996f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/8137d19fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/9015f4f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/9015f4f8c42100141fce95f06aba7e85 deleted file mode 100644 index 71e6a1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/9015f4f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/906095a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/906095a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43559de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/906095a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,176 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90661da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90661da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f01f77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/90661da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/c1aab7a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/c1aab7a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2c00dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4b/c1aab7a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.models.ModelHauntedArmor; -import projectzulu.common.mobs.renders.RenderHauntedArmor; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/3004bf9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/3004bf9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2a28b51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/3004bf9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/300fa901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/300fa901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8c7e4d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/300fa901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/4147dbe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/4147dbe4c42100141fce95f06aba7e85 deleted file mode 100644 index 3cb2e80..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/4147dbe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/4154a401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/4154a401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2d714be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/4154a401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetDoorway; -import projectzulu.common.world2.blueprint.BPSetHallway; -import projectzulu.common.world2.blueprint.BPSetHallwaySpawner; -import projectzulu.common.world2.blueprint.BPSetPyramidEdge; -import projectzulu.common.world2.blueprint.BPSetStairs; -import projectzulu.common.world2.blueprint.BPSetTreasureDeadEnd; -import projectzulu.common.world2.blueprint.BPSetWall; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectPyramid extends ArchitectBase { - - public final BPSetStairs stairSet = new BPSetStairs(); - public final BPSetPyramidEdge edge = new BPSetPyramidEdge(); - public final BPSetDoorway door = new BPSetDoorway(); - - public ArchitectPyramid(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetWall()); - stockpile.addBlueprintSet(new BPSetTreasureDeadEnd()); - stockpile.addBlueprintSet(new BPSetHallway()); - stockpile.addBlueprintSet(new BPSetHallwaySpawner()); - stockpile.addBlueprintSet(stairSet); - stockpile.addBlueprintSet(edge); - stockpile.addBlueprintSet(door); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - /* If is Wall, use Wall Cell */ - BlueprintSet set; - if (door.isApplicable(cells, buildCoords, random)) { - set = door; - } else if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] bottomCells, MazeCell[][] topCells) { - for (int topX = 0; topX < topCells.length; topX++) { - for (int topZ = 0; topZ < topCells[0].length; topZ++) { - Point buildCoords = new Point(topX, topZ); - if (stairSet.attemptAssignBlueprint(bottomCells, topCells, buildCoords, random)) { - return; - } - } - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5027ddf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5027ddf7c42100141fce95f06aba7e85 deleted file mode 100644 index 4d6bb3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/5027ddf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public abstract class BaseModule implements Module { - - @Override - public void registration(ItemBlockManager manager) { - } - - @Override - public void registration(CustomEntityManager manager) { - } - - @Override - public void registration(FeatureGenerator manager) { - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - } - - @Override - public void init(FMLInitializationEvent event, File configDirectory) { - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - } - - @Override - public void serverStart(FMLServerStartedEvent event, File configDirectory) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/50aad1e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/50aad1e4c42100141fce95f06aba7e85 deleted file mode 100644 index d756151..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/50aad1e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/60749ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/60749ce5c42100141fce95f06aba7e85 deleted file mode 100644 index 5a34409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/60749ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,596 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/91ebefe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/91ebefe5c42100141fce95f06aba7e85 deleted file mode 100644 index dbe60f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/91ebefe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/b01c5bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/b01c5bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11c938a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/b01c5bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/b052e3e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/b052e3e3c42100141fce95f06aba7e85 deleted file mode 100644 index 2aa1c81..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/b052e3e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.block.Block; - -import com.google.common.base.Optional; - -public enum BlockList { - instance; - public static Optional palmHoloTree = Optional.absent(); // Not Used? - - public static Optional aloeVera = Optional.absent(); - public static Optional wateredDirt = Optional.absent(); - public static Optional tumbleweed = Optional.absent(); - public static Optional jasper = Optional.absent(); - - public static Optional palmTreeLog = Optional.absent(); - public static Optional palmTreePlank = Optional.absent(); - public static Optional palmTreeSlab = Optional.absent(); - public static Optional palmTreeDoubleSlab = Optional.absent(); - public static Optional palmTreeStairs = Optional.absent(); - public static Optional palmTreeLeaves = Optional.absent(); - public static Optional palmTreeSapling = Optional.absent(); - public static Optional coconut = Optional.absent(); - - public static Optional nightBloom = Optional.absent(); - public static Optional creeperBlossom = Optional.absent(); - public static Optional quickSand = Optional.absent(); - - public static Optional spike = Optional.absent(); - public static Optional campfire = Optional.absent(); - public static Optional mobHeads = Optional.absent(); - public static Optional tombstone = Optional.absent(); - - public static Optional universalFlowerPot = Optional.absent(); - public static Optional customBrewingStand = Optional.absent(); - public static Optional limitedMobSpawner = Optional.absent(); - public static Optional brewingStandSingle = Optional.absent(); - public static Optional brewingStandTriple = Optional.absent(); - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/e06ee09ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/e06ee09ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5ea5b20..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/e06ee09ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,353 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - 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(vec3, vec31); - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/e12a0bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/e12a0bfac42100141fce95f06aba7e85 deleted file mode 100644 index c98b349..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4c/e12a0bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/513600ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/513600ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f5d95e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/513600ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,222 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/51de61ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/51de61ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d4ec12f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/51de61ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,141 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/726deffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/726deffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d6345aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/726deffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityVulture; -import projectzulu.common.mobs.models.ModelVulture; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/90d035a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/90d035a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b1ed4fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/90d035a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c050559fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c050559fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4fc8215..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c050559fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,222 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelPenguin extends ModelBase { - private ModelRenderer BODYROT; - private ModelRenderer TAILROT; - private ModelRenderer HEADROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer WINGLEFROT; - private ModelRenderer LEGLEFROT; - private ModelRenderer FOOTLEFROT; - private ModelRenderer TOELEF2ROT; - private ModelRenderer TOELEF1ROT; - private ModelRenderer TOELEF3ROT; - private ModelRenderer LEGRIGROT; - private ModelRenderer FOOTRIGROT; - private ModelRenderer TOERIG2ROT; - private ModelRenderer TOERIG1ROT; - private ModelRenderer TOERIG3ROT; - - public ModelPenguin() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 13); - setTextureOffset("BODYROT.bodydec", 37, 0); - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - setTextureOffset("TAILROT.tail3", 50, 11); - setTextureOffset("TAILROT.tail2", 40, 11); - setTextureOffset("TAILROT.tail1", 30, 11); - setTextureOffset("WINGRIGROT.wingrig", 44, 15); - setTextureOffset("WINGLEFROT.winglef", 30, 15); - setTextureOffset("LEGLEFROT.leglef", 52, 0); - setTextureOffset("TOELEF2ROT.toelefbase2", 56, 7); - setTextureOffset("TOELEF2ROT.toelefclaw2", 60, 19); - setTextureOffset("TOELEF2ROT.toeleftop2", 58, 16); - setTextureOffset("TOELEF1ROT.toelefbase1", 56, 7); - setTextureOffset("TOELEF1ROT.toelefclaw1", 60, 19); - setTextureOffset("TOELEF1ROT.toeleftop1", 58, 16); - setTextureOffset("TOELEF3ROT.toelefbase3", 56, 7); - setTextureOffset("TOELEF3ROT.toelefclaw3", 60, 19); - setTextureOffset("TOELEF3ROT.toeleftop3", 58, 16); - setTextureOffset("LEGRIGROT.legrig", 52, 0); - setTextureOffset("TOERIG2ROT.toerigbase2", 56, 7); - setTextureOffset("TOERIG2ROT.toerigclaw2", 60, 19); - setTextureOffset("TOERIG2ROT.toerigtop2", 58, 16); - setTextureOffset("TOERIG1ROT.toerigbase1", 56, 7); - setTextureOffset("TOERIG1ROT.toerigclaw1", 60, 19); - setTextureOffset("TOERIG1ROT.toerigtop1", 58, 16); - setTextureOffset("TOERIG3ROT.toerigbase3", 56, 7); - setTextureOffset("TOERIG3ROT.toerigclaw3", 60, 19); - setTextureOffset("TOERIG3ROT.toerigtop3", 58, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -4.5F, -10F, -4F, 9, 13, 6); - BODYROT.addBox("bodydec", -3F, -7.5F, -5F, 6, 9, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -10F, -1.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tail3.mirror = true; - TAILROT.addBox("tail3", -1F, 1F, 2F, 2, 1, 3); - // tail3.mirror = false; - TAILROT.addBox("tail2", -1.5F, 0F, 0F, 3, 2, 2); - TAILROT.addBox("tail1", -2F, -1F, -1F, 4, 3, 1); - BODYROT.addChild(TAILROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(4.5F, -10F, -1F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGRIGROT); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-4.5F, -10F, -1F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGLEFROT); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-3F, 3F, -0.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("leglef", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTLEFROT = new ModelRenderer(this, "FOOTLEFROT"); - FOOTLEFROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTLEFROT, 0F, 0F, 0F); - FOOTLEFROT.mirror = true; - TOELEF2ROT = new ModelRenderer(this, "TOELEF2ROT"); - TOELEF2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOELEF2ROT, 0F, 0F, 0F); - TOELEF2ROT.mirror = true; - TOELEF2ROT.addBox("toelefbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF2ROT.addBox("toelefclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF2ROT.addBox("toeleftop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF2ROT); - TOELEF1ROT = new ModelRenderer(this, "TOELEF1ROT"); - TOELEF1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOELEF1ROT, 0F, 0F, 0F); - TOELEF1ROT.mirror = true; - TOELEF1ROT.addBox("toelefbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF1ROT.addBox("toelefclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF1ROT.addBox("toeleftop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF1ROT); - TOELEF3ROT = new ModelRenderer(this, "TOELEF3ROT"); - TOELEF3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOELEF3ROT, 0F, 0F, 0F); - TOELEF3ROT.mirror = true; - TOELEF3ROT.addBox("toelefbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF3ROT.addBox("toelefclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF3ROT.addBox("toeleftop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF3ROT); - LEGLEFROT.addChild(FOOTLEFROT); - BODYROT.addChild(LEGLEFROT); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(3F, 3F, -0.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("legrig", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTRIGROT = new ModelRenderer(this, "FOOTRIGROT"); - FOOTRIGROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTRIGROT, 0F, 0F, 0F); - FOOTRIGROT.mirror = true; - TOERIG2ROT = new ModelRenderer(this, "TOERIG2ROT"); - TOERIG2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOERIG2ROT, 0F, 0F, 0F); - TOERIG2ROT.mirror = true; - TOERIG2ROT.addBox("toerigbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG2ROT.addBox("toerigclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG2ROT.addBox("toerigtop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG2ROT); - TOERIG1ROT = new ModelRenderer(this, "TOERIG1ROT"); - TOERIG1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOERIG1ROT, 0F, 0F, 0F); - TOERIG1ROT.mirror = true; - TOERIG1ROT.addBox("toerigbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG1ROT.addBox("toerigclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG1ROT.addBox("toerigtop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG1ROT); - TOERIG3ROT = new ModelRenderer(this, "TOERIG3ROT"); - TOERIG3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOERIG3ROT, 0F, 0F, 0F); - TOERIG3ROT.mirror = true; - TOERIG3ROT.addBox("toerigbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG3ROT.addBox("toerigclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG3ROT.addBox("toerigtop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG3ROT); - LEGRIGROT.addChild(FOOTRIGROT); - BODYROT.addChild(LEGRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -20), +20) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGRIGROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODYROT.rotateAngleZ = MathHelper.cos(par2 * 0.6662F * 2f) * 0.1F * par3; - - TAILROT.rotateAngleX = (float) (-20 * Math.PI / 180 + (MathHelper.cos(par2 * 0.6662F * 2f) * 0.5F * par3)); - - WINGRIGROT.rotateAngleZ = -Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - WINGLEFROT.rotateAngleZ = Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - - TOELEF1ROT.rotateAngleY = (float) (10 * Math.PI / 180); - TOERIG3ROT.rotateAngleY = (float) (-10 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c1c8b2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c1c8b2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3581d16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4d/c1c8b2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.models.ModelFox; -import projectzulu.common.mobs.renders.RenderTameable; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/0044fa1c302000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/0044fa1c302000141dbfc2e92eb0e949 deleted file mode 100644 index 8d188a6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/0044fa1c302000141dbfc2e92eb0e949 +++ /dev/null @@ -1,5 +0,0 @@ -package SoulMod1; - -public class SoulMod1 { - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/00eaa09dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/00eaa09dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1a94b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/00eaa09dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,260 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/01ba98f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/01ba98f9c42100141fce95f06aba7e85 deleted file mode 100644 index 9ff4333..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/01ba98f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.blocks.GuiAnimalName; -import com.ngb.projectzulu.common.blocks.tombstone.GuiTombstone; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.blocks.universalpot.ContainerUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.GuiContainerUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import com.ngb.projectzulu.common.dungeon.GuiLimitedMobSpawner; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import com.ngb.projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingBase; -import cpw.mods.fml.common.network.IGuiHandler; - -public class ZuluGuiHandler implements IGuiHandler { - - @Override - public Object getServerGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - - TileEntity tileEntityServer; - switch (GuiID.getGuiIDByID(guiID)) { - case FlowerPot: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityUniversalFlowerPot) { - return new ContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityServer); - } - case BrewingStand: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityBrewingBase) { - return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - default: - break; - } - return null; - - } - - @Override - public Object getClientGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tileEntityClient; - switch (GuiID.getGuiIDByID(guiID)) { - case Tombstone: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityTombstone) { - return new GuiTombstone((TileEntityTombstone) tileEntityClient); - } - break; - case FlowerPot: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityUniversalFlowerPot) { - return new GuiContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityClient); - } - break; - case AnimalName: - return new GuiAnimalName(world, player, x); - case MobSpawner: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityLimitedMobSpawner) { - return new GuiLimitedMobSpawner((TileEntityLimitedMobSpawner) tileEntityClient); - } - case BrewingStand: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityBrewingBase) { - return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - } - - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/101bc6d0c72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/101bc6d0c72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e40e5ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/101bc6d0c72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/109346f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/109346f4c42100141fce95f06aba7e85 deleted file mode 100644 index 978c409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/109346f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/204926f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/204926f9c42100141fce95f06aba7e85 deleted file mode 100644 index 291471d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/204926f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/31c59ef4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/31c59ef4c42100141fce95f06aba7e85 deleted file mode 100644 index db71e6b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/31c59ef4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/40c5a601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/40c5a601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7e8f393..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/40c5a601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50bc48a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50bc48a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 73512bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50bc48a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,570 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - //int var4 = this.worldObj.getEntitiesWithinAABB( - // var13.getClass(), - // AxisAlignedBB - // .getAABBPool() - // .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - // zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - // yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - // .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - // spawnRangeHorizontal * 2)).size(); - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getBoundingBox(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50d509312724001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50d509312724001415179d45b0e27e9a deleted file mode 100644 index 756be3c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/50d509312724001415179d45b0e27e9a +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString(event.source.toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/52a53ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/52a53ae5c42100141fce95f06aba7e85 deleted file mode 100644 index b199ab3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/52a53ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/60580bf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/60580bf7c42100141fce95f06aba7e85 deleted file mode 100644 index df0c39d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/60580bf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemScale; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/61235dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/61235dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 670c03c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/61235dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/701837f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/701837f6c42100141fce95f06aba7e85 deleted file mode 100644 index 9777abb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/701837f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/70cfcef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/70cfcef7c42100141fce95f06aba7e85 deleted file mode 100644 index 16345e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/70cfcef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,203 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/80f4f3e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/80f4f3e3c42100141fce95f06aba7e85 deleted file mode 100644 index 9e6f0b3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/80f4f3e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0532b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0532b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b4642f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b0532b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseGrey; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b09a579fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b09a579fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 56ac669..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/b09a579fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,169 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c0cd2df9eeac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c0cd2df9eeac0014196dc3517d78505a new file mode 100644 index 0000000..b3734db --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c0cd2df9eeac0014196dc3517d78505a @@ -0,0 +1,334 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelCamel extends ModelBase +{ + float heightToRaise = 33f; + float renderScale = 1.0f; + //fields + //fields + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer HEADbump; + ModelRenderer HEAD; + ModelRenderer neckTop; + ModelRenderer neckBase; + ModelRenderer humpMain; + ModelRenderer humpMain2; + ModelRenderer saddleBase; + ModelRenderer saddleHorn1; + ModelRenderer saddleHorn2; + ModelRenderer Body; + ModelRenderer hip1; + ModelRenderer Leg1toProt; + ModelRenderer Leg1BotRot; + ModelRenderer hip2; + ModelRenderer Leg2toProt; + ModelRenderer Leg2BotRot; + ModelRenderer hip3; + ModelRenderer Leg3toProt; + ModelRenderer Leg3BotRot; + ModelRenderer hip4; + ModelRenderer Leg4toProt; + ModelRenderer Leg4BotRot; + ModelRenderer tail; + + public ModelCamel() + { + textureWidth = 128; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -3F, -4F, 5, 4, 7); + HEAD.setRotationPoint(0F, 3F - heightToRaise, -15F); + HEAD.setTextureSize(128, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.2268928F, 0F, 0F); + HEADbump = new ModelRenderer(this, 105, 42); + HEADbump.addBox(-2F, -2F, -3F, 3, 2, 6); + //HEADbump.setRotationPoint(1F, 1.5F, -15.5F); + HEADbump.setRotationPoint(1F, -1.5F, -0.5F); + HEADbump.setTextureSize(128, 64); + HEADbump.mirror = true; + setRotation(HEADbump, 0.296706F, 0F, 0F); + HEAD.addChild(HEADbump); + earLeft = new ModelRenderer(this, 60, 6); + earLeft.addBox(0F, -3F, -1F, 1, 4, 1); + //earLeft.setRotationPoint(1.5F, 1F, -13F); + earLeft.setRotationPoint(1.5F, -1.0F, 2.5F); + earLeft.setTextureSize(128, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, 0.5235988F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 60, 1); + earRight.addBox(-1F, -3F, -1F, 1, 4, 1); + //earRight.setRotationPoint(-0.5F, 1F, -13F); + earRight.setRotationPoint(-0.5F, -1.0F, 2.5F); + earRight.setTextureSize(128, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, -0.5235988F); + HEAD.addChild(earRight); + + neckTop = new ModelRenderer(this, 29, 1); + neckTop.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + neckTop.setRotationPoint(0.5F, 1.8F - heightToRaise , -14F); + neckTop.setTextureSize(128, 64); + neckTop.mirror = true; + setRotation(neckTop, 0.6457718F, 0F, 0F); + neckBase = new ModelRenderer(this, 43, 1); + neckBase.addBox(-1.5F, 0F, -1.5F, 3, 6, 4); + neckBase.setRotationPoint(0.5F, 6F - heightToRaise, -11.5F); + neckBase.setTextureSize(128, 64); + neckBase.mirror = true; + setRotation(neckBase, 1.117011F, 0F, 0F); + humpMain = new ModelRenderer(this, 1, 41); + humpMain.addBox(-3.5F, -2F, -2F, 8, 4, 9); + humpMain.setRotationPoint(0F, 3F - heightToRaise, -0.5F); + humpMain.setTextureSize(128, 64); + humpMain.mirror = true; + setRotation(humpMain, 0F, 0F, 0F); + humpMain2 = new ModelRenderer(this, 37, 42); + humpMain2.addBox(-3F, -2F, -2F, 7, 4, 7); + humpMain2.setRotationPoint(0F, 0.75F - heightToRaise, 0.5F); + humpMain2.setTextureSize(128, 64); + humpMain2.mirror = true; + setRotation(humpMain2, 0F, 0F, 0F); + saddleBase = new ModelRenderer(this, 68, 52); + saddleBase.addBox(-3.5F, -2F, -2F, 6, 1, 5); + saddleBase.setRotationPoint(1F, 4F - heightToRaise, -5F); + saddleBase.setTextureSize(128, 64); + saddleBase.mirror = true; + setRotation(saddleBase, 0F, 0F, 0F); + saddleHorn1 = new ModelRenderer(this, 67, 1); + saddleHorn1.addBox(-1F, -3F, -1F, 1, 5, 1); + saddleHorn1.setRotationPoint(1F, 1F - heightToRaise, -6F); + saddleHorn1.setTextureSize(128, 64); + saddleHorn1.mirror = true; + setRotation(saddleHorn1, 0.3346075F, 0F, 0F); + saddleHorn2 = new ModelRenderer(this, 73, 5); + saddleHorn2.addBox(-2F, -1F, -1F, 4, 1, 1); + saddleHorn2.setRotationPoint(0.5F, 0F - heightToRaise, -7F); + saddleHorn2.setTextureSize(128, 64); + saddleHorn2.mirror = true; + setRotation(saddleHorn2, 0F, 0F, 0F); + Body = new ModelRenderer(this, 1, 14); + Body.addBox(-3.5F, -2F, -10F, 9, 9, 16); + Body.setRotationPoint(-0.5F, 5F - heightToRaise, 3F); + Body.setTextureSize(128, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + hip1 = new ModelRenderer(this, 68, 42); + hip1.addBox(-1F, -3F, -1F, 4, 4, 4); + hip1.setRotationPoint(-4F, 12F - heightToRaise, -5.5F); + hip1.setTextureSize(128, 64); + hip1.mirror = true; + setRotation(hip1, 0.0698132F, 0F, 0F); + Leg1toProt = new ModelRenderer(this, 65, 13); + Leg1toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg1toProt.setRotationPoint(-3F, 12F, -4.5F); + Leg1toProt.setRotationPoint(1F, 0F, 0.5F); + Leg1toProt.setTextureSize(128, 64); + Leg1toProt.mirror = true; + setRotation(Leg1toProt, 0.0698132F, 0F, 0F); + hip1.addChild(Leg1toProt); + Leg1BotRot = new ModelRenderer(this, 65, 25); + Leg1BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg1BotRot.setRotationPoint(-3F, 17F, -4F); + Leg1BotRot.setRotationPoint(0F, 6F, 0F); + Leg1BotRot.setTextureSize(128, 64); + Leg1BotRot.mirror = true; + setRotation(Leg1BotRot, -0.0698132F, 0F, 0F); + Leg1toProt.addChild(Leg1BotRot); + hip2 = new ModelRenderer(this, 68, 42); + hip2.addBox(-1F, -1F, -1F, 4, 4, 4); + hip2.setRotationPoint(3F, 10F - heightToRaise, -5.5F); + hip2.setTextureSize(128, 64); + hip2.mirror = true; + setRotation(hip2, 0.0698132F, 0F, 0F); + Leg2toProt = new ModelRenderer(this, 52, 13); + Leg2toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg2toProt.setRotationPoint(4F, 11F, -4.5F); + Leg2toProt.setRotationPoint(1F, 2F, 0.5F); + Leg2toProt.setTextureSize(128, 64); + Leg2toProt.mirror = true; + setRotation(Leg2toProt, 0.0698132F, 0F, 0F); + hip2.addChild(Leg2toProt); + Leg2BotRot = new ModelRenderer(this, 52, 25); + Leg2BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg2BotRot.setRotationPoint(4F, 17F, -4F); + Leg2BotRot.setRotationPoint(0F, 6F, 0F); + Leg2BotRot.setTextureSize(128, 64); + Leg2BotRot.mirror = true; + setRotation(Leg2BotRot, -0.0698132F, 0F, 0F); + Leg2toProt.addChild(Leg2BotRot); + hip3 = new ModelRenderer(this, 87, 42); + hip3.addBox(-1F, -1F, -1F, 4, 5, 4); + hip3.setRotationPoint(-4F, 9F - heightToRaise, 5F); + hip3.setTextureSize(128, 64); + hip3.mirror = true; + setRotation(hip3, 0.0698132F, 0F, 0F); + Leg3toProt = new ModelRenderer(this, 95, 13); + Leg3toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg3toProt.setRotationPoint(-3F, 12F, 6F); + Leg3toProt.setRotationPoint(1F, 2F, 1F); + Leg3toProt.setTextureSize(128, 64); + Leg3toProt.mirror = true; + setRotation(Leg3toProt, 0.0872665F, 0F, 0F); + hip3.addChild(Leg3toProt); + Leg3BotRot = new ModelRenderer(this, 95, 25); + Leg3BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg3BotRot.setRotationPoint(-3F, 17F, 6.5F); + Leg3BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg3BotRot.setTextureSize(128, 64); + Leg3BotRot.mirror = true; + setRotation(Leg3BotRot, -0.0698132F, 0F, 0F); + Leg3toProt.addChild(Leg3BotRot); + + hip4 = new ModelRenderer(this, 87, 42); + hip4.addBox(-1F, -1F, -1F, 4, 5, 4); + hip4.setRotationPoint(3F, 9F - heightToRaise, 5F); + hip4.setTextureSize(128, 64); + hip4.mirror = true; + setRotation(hip4, 0.0698132F, 0F, 0F); + Leg4toProt = new ModelRenderer(this, 81, 13); + Leg4toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg4toProt.setRotationPoint(4F, 12F, 6F); + Leg4toProt.setRotationPoint(1F, 2F, 1F); + Leg4toProt.setTextureSize(128, 64); + Leg4toProt.mirror = true; + setRotation(Leg4toProt, 0.0872665F, 0F, 0F); + hip4.addChild(Leg4toProt); + Leg4BotRot = new ModelRenderer(this, 81, 25); + Leg4BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg4BotRot.setRotationPoint(4F, 17F, 6.5F); + Leg4BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg4BotRot.setTextureSize(128, 64); + Leg4BotRot.mirror = true; + setRotation(Leg4BotRot, -0.0698132F, 0F, 0F); + Leg4toProt.addChild(Leg4BotRot); + tail = new ModelRenderer(this, 109, 13); + tail.addBox(-1F, -1F, 0F, 2, 7, 2); + tail.setRotationPoint(0F, 7F - heightToRaise, 7.6F); + tail.setTextureSize(128, 64); + tail.mirror = true; + setRotation(tail, 0.5585054F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + //Leg1toProt.render(f5); + //Leg1BotRot.render(f5); + hip2.render(renderScale * f5); + //Leg2toProt.render(f5); + //Leg2BotRot.render(f5); + hip3.render(renderScale * f5); + //Leg3toProt.render(f5); + //Leg3BotRot.render(f5); + hip4.render(renderScale * f5); + //Leg4toProt.render(f5); + //Leg4BotRot.render(f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + hip2.render(renderScale * f5); + hip3.render(renderScale * f5); + hip4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Tail Rotation */ + //NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 + //* MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + /* Tail Rotation */ + tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + /* Leg Animation */ + hip1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + hip2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + Leg1BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg2BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + hip3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + hip4.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + Leg3BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg4BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleX = f3 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + } + + } diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c0dabb9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c0dabb9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 09163c3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c0dabb9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c1ebbcfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c1ebbcfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b28f9b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/c1ebbcfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityCreature theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) this.targetEntity.posX, (double) this.targetEntity.posY, (double) this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/d1d9acf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/d1d9acf5c42100141fce95f06aba7e85 deleted file mode 100644 index 5cccb14..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/d1d9acf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityGenericAnimal theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityGenericAnimal par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, - //this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); - Vec3.createVectorHelper((double)this.targetEntity.posX, (double)this.targetEntity.posY, (double)this.targetEntity.posZ)); - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/e204b1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/e204b1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 464c195..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4e/e204b1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/209ef5a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/209ef5a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f342ebb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/209ef5a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,326 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/5154fbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/5154fbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa8e756..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/5154fbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,262 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/6162ae9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/6162ae9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 07c0aa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/6162ae9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/91d62ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/91d62ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 826e268..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/91d62ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/92019ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/92019ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3023684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/92019ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderUniversalFlowerPot implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - // TODO: Render Universal Pot - renderer.renderStandardBlock(par1Block, par2, par3, par4); - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - IIcon var8 = par1Block.getBlockTextureFromSide(0); - float var9 = (var7 >> 16 & 255) / 255.0F; - float var10 = (var7 >> 8 & 255) / 255.0F; - float var11 = (var7 & 255) / 255.0F; - float var12; - float var14; - - if (EntityRenderer.anaglyphEnable) { - var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; - var9 = var12; - var10 = var13; - var11 = var14; - } - - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); - var12 = 0.1865F; - renderer.renderFaceXPos(par1Block, par2 - 0.5F + var12, par3, par4, var8); - renderer.renderFaceXNeg(par1Block, par2 + 0.5F - var12, par3, par4, var8); - renderer.renderFaceZPos(par1Block, par2, par3, par4 - 0.5F + var12, var8); - renderer.renderFaceZNeg(par1Block, par2, par3, par4 + 0.5F - var12, var8); - renderer.renderFaceYNeg(Blocks.dirt, par2, par3 - 0.35F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - renderer.renderFaceYPos(Blocks.dirt, par2, par3 - 0.5F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a07bbdf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a07bbdf5c42100141fce95f06aba7e85 deleted file mode 100644 index 3126af9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/a07bbdf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -public enum EntityStates { - /* Primary States : Practically used by Everything */ - idle(0), - looking(1), - attacking(2), - - /* Secondary States : Common */ - fleeing(7), - following(6), - inLove(8), - sitting(9), - - /* Tertiary States : Used Rarely */ - stayStill(11), - posture(5), - inCover(10), - unknown(-1); - - public final int index; - public int index() { return index; } - - EntityStates(int index) { - this.index = index; - } - - /* Return unknown if State Cannot be Found */ - public static EntityStates getEntityByIndex(int index){ - for (EntityStates entityState : EntityStates.values()) { - if(entityState.index == index){ - return entityState; - } - } - return unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b0681af6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b0681af6c42100141fce95f06aba7e85 deleted file mode 100644 index 822a258..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/b0681af6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/c050e0f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/c050e0f6c42100141fce95f06aba7e85 deleted file mode 100644 index d0f71a6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/c050e0f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,297 +0,0 @@ -package com.ngb.projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d015189ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d015189ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fd1d328..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d015189ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d0618f00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d0618f00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f581ba7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/d0618f00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0786800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0786800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 24e3c7a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e0786800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e1916ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e1916ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 766a15c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e1916ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e1f3af9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e1f3af9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2320610..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/e1f3af9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,543 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.src.BiomeGenBase; -//import net.minecraft.src.Block; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.EntityPlayer; -//import net.minecraft.src.EntityPlayerMP; -//import net.minecraft.src.Material; -//import net.minecraft.src.NBTTagCompound; -//import net.minecraft.src.Potion; -//import net.minecraft.src.PotionEffect; -//import net.minecraft.src.World; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class TemperatureTickerAttempt2 implements ITickHandler, IPlayerTracker{ -// -// public static final int tempDataWatcher = 18; -// -// /* Player Tempurature HashMaps */ -// private static float playerTemperature = 0; -//// private static Map temperatureMap = new HashMap(); -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// private static Map playerLocTempMap = new HashMap(); -// -//// private static Map playerOuterTempModifierMap = new HashMap(); -// -//// private static float[] blockTempMod = new float[4096]; -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private static float defaultTemperature = 0; -// -// private short DirtyFlag = 0; -// public TemperatureTickerAttempt2(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( lastWorldNameMap.containsKey( player.getEntityName() ) ){ -//// playerTemperature = temperatureMap.get( player.getEntityName() ); -// playerTemperature = getTempFromDataWatcher(player, tempDataWatcher); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -//// System.out.println("Should be Reading :".concat(worldName).concat(lastWorldName) ); -// -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// -//// System.out.println( "SETUP" ); -// -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// -//// /* Read From File */ -//// if ( HasPendingRead() ){ -//// readNBTFromFile(player); -//// ClearPendingRead(); -////// System.out.println( "READ" ); -//// } -// -// } -// -// /* Get Outside Temperature */ -// Float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// Float unTouchedPlayerLocationTemperature = playerLocationTemperature; -// Float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -//// playerLocationTemperature -= 0.1f*Math.abs(worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature()); -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -//// playerLocationTemperature += item.getAddToPlayTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -//// playerTemperature += item.getAddToLocTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// useFastHeatTransfer = currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 100 - (int)playerTemperatureDegrees)); -// -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Set Temperature To Datawatcher on Server Side */ -// if(player instanceof EntityPlayerMP){ -// updateTempInDataWatcher(player, tempDataWatcher, playerTemperature); -// } -// -// /* Save Temperature To Map*/ -//// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -//// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -//// if(player instanceof EntityPlayerMP){ -//// -//// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -//// DataOutputStream data = new DataOutputStream(bytes); -////// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -//// try { -//// data.writeFloat(playerTemperature); -//// } catch (Exception e) { -//// e.printStackTrace(); -//// } -//// -//// Packet250CustomPayload packet = new Packet250CustomPayload(); -//// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -//// packet.data = bytes.toByteArray(); -//// packet.length = packet.data.length; -//// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -////// System.out.println( player.getEntityName().concat("Sent Packet ")); -//// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// try -// { -// -////// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// // File file = new File(ModLoader.getMinecraftInstance().getMinecraftDir() + "/saves/" + ModLoader.getMinecraftInstance().theWorld.saveHandler.getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// if(!file.exists()) -//// { -//// file.createNewFile(); -//// } -//// FileOutputStream fileoutputstream = new FileOutputStream(file); -//// NBTTagCompound nbttagcompound = new NBTTagCompound(); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), getTempFromDataWatcher(player, tempDataWatcher) ); -// -//// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), playerTemperature); -// -//// CompressedStreamTools.writeCompressed(nbttagcompound, fileoutputstream); -//// fileoutputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// try -// { -//// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// -//// if(!file.exists()) -//// { -//// return; -//// } -//// FileInputStream fileinputstream = new FileInputStream(file); -//// NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// if (nbttagcompound.hasKey( player.getEntityName().concat("zulu_temperature_a") )){ -// updateTempInDataWatcher(player, tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -// -//// player.getDataWatcher().updateObject(tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -//// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") ); -// } -// -//// fileinputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -//// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -//// -//// /* Get Relevent Data From DataStream */ -//// float tempTemp = playerTemperature; -//// try { -//// tempTemp = data.readFloat(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// } -//// -//// /* Make Sure Player Exists, then Assign data to map */ -//// if(temperatureMap.containsKey(sender.getEntityName())){ -//// temperatureMap.put(sender.getEntityName(), tempTemp); -////// System.out.println( sender.getEntityName().concat("Received Packet ")); -//// -//// } -//// -//// -//// } -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -//// temperatureMap.put(player.getEntityName(), 0.0f); -// -// lastWorldNameMap.put(player.getEntityName(), ""); -// player.getDataWatcher().addObject(tempDataWatcher, (int)playerTemperature); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -//// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// -// } -// -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell) && !player.worldObj.isRemote){ -// player.getDataWatcher().updateObject(tempDataWatcher, defaultTemperature); -//// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -//// System.out.println("Player Respawned"); -// -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) getTempFromDataWatcher(player, tempDataWatcher); -//// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static void updateTempInDataWatcher(EntityPlayer player, int index, float value){ -// player.getDataWatcher().updateObject(index, (int)value); -// } -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static Float getTempFromDataWatcher(EntityPlayer player, int index){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) player.getDataWatcher().getWatchableObjectInt(index); -// } -// return 0f; -// } -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f02900f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f02900f6c42100141fce95f06aba7e85 deleted file mode 100644 index 545bb6d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f02900f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f0a4ffffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f0a4ffffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b17f47f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f0a4ffffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f0ca60e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f0ca60e5c42100141fce95f06aba7e85 deleted file mode 100644 index 38dbb9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/4f/f0ca60e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCentipede; -import projectzulu.common.mobs.models.ModelCentipede; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/003957b1302000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/003957b1302000141dbfc2e92eb0e949 deleted file mode 100644 index 1b3ffe5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/003957b1302000141dbfc2e92eb0e949 +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.examplemod; - -import net.minecraft.init.Blocks; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulMod1.MODID, version = SoulMod1.VERSION) -public class SoulMod1 -{ - public static final String MODID = "SoulMod1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - // some example code - System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/41b252a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/41b252a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ea3f172..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/41b252a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWeakness extends SubItemPotionHalfPower { - - public SubItemPotionWeakness(Item itemID, int subID) { - super(itemID, subID, "Weakness"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.weakness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/52b64fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/52b64fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 84d336c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/52b64fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/62f63ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/62f63ef8c42100141fce95f06aba7e85 deleted file mode 100644 index fa03d2f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/62f63ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,245 +0,0 @@ -//package com.ngb.projectzulu.common.temperature; -// -//import java.util.EnumSet; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.client.renderer.Tessellator; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.src.ModLoader; -//import net.minecraft.util.MathHelper; -// -//import org.lwjgl.opengl.GL11; -// -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class DisplayTemperatureTicker implements ITickHandler{ -// -// protected float zLevel = 10.0F; -// public static long inGameTicks = 0; -// private float playerTemp = 0; -// private float enviroTemp = 0; -// @Override -// public void tickStart(EnumSet type, Object... tickData) {} -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// -// /* Handle Display of Temperature on Client, TickType = Render*/ -// if(ModLoader.getMinecraftInstance().thePlayer != null){ -// -// Minecraft mc = ModLoader.getMinecraftInstance(); -// EntityPlayer player = ModLoader.getMinecraftInstance().thePlayer; -// -// FontRenderer var2 = mc.fontRenderer; -// ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); -// String textureLocation = "/mods/icons/temperature_icon.png"; -// int scalewidth = var3.getScaledWidth(); -// int scaleHeight = var3.getScaledHeight(); -// -// if( TemperatureTicker.getPlayerTemperature(player) != null && inGameTicks % 80 == 0){ -// playerTemp = TemperatureTicker.getPlayerTemperature(player); -// } -// if(TemperatureTicker.getPlayerLocTemperature(player) != null && inGameTicks % 80 == 0){ -// enviroTemp = TemperatureTicker.getPlayerLocTemperature(player); -// } -// int playerTempIconValue = (int) mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120); -// int playerTempHumanReadable = 80 - playerTempIconValue; -// int verticalOffsetFromTopY = 120; -// int horizontalOffsetFromRightX = 0; -// int iconXCoord = 0; -// int iconYCoord = 0; -// -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture( textureLocation )); -// -// scalewidth = 0; -// scaleHeight = scaleHeight/2; -// horizontalOffsetFromRightX = -(26+10); -// verticalOffsetFromTopY -= 50; -// if( (120 - playerTempIconValue) < 20){ -// /* Draw Very Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 150; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// -// }else if( (120 - playerTempIconValue) < 30 ){ -// /* Draw Medium Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 125; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur2.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// }else if ( (120 - playerTempIconValue) < 40 ){ -// /* Draw Little Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 100; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 100 ){ -// /* Draw High Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 50; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 90 ){ -// /* Draw Medium Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 25; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 80 ){ -// /* Draw Little Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 0; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else{ -// /* Draw Frame */ -// iconXCoord = 0; -// iconYCoord = 0; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-12), iconXCoord, iconYCoord, 15, 105); -// -// /* Draw Red Inside */ -// iconXCoord = 200; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// } -// -// /* Draw Marker */ -// iconXCoord = 30; -// iconYCoord = 94; -// int playerLocTemp = MathHelper.floor_float((mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120)) ); -// playerLocTemp = playerLocTemp > 116 ? 116 : playerLocTemp < 14 ? 14 : playerLocTemp; -// -// this.drawTexturedModalRect(scalewidth-(14+horizontalOffsetFromRightX+0), scaleHeight-(8+verticalOffsetFromTopY-playerLocTemp+4), iconXCoord, iconYCoord, 4, 8); -// scalewidth = var3.getScaledWidth(); -// horizontalOffsetFromRightX = 0; -// -// -// -// -// /* Write Temp String TO Top Of Screen, Mostly For Debugging For Now*/ -// byte var8 = 12; -// String var9 = "Current Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120))); -// String var10 = "Max Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120))); -// -//// var2.drawStringWithShadow(var10, scalewidth / 2 - var2.getStringWidth(var10) / 2, var8 - 10, 16711935); -//// var2.drawStringWithShadow(var9, scalewidth / 2 - var2.getStringWidth(var9) / 2, var8 + 10, 16711935); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// -// inGameTicks++; -// } -// -// } -// -// private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6){ -// float var7 = 0.00390625F; -// float var8 = 0.00390625F; -// -// Tessellator var9 = Tessellator.instance; -// var9.startDrawingQuads(); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); -// var9.draw(); -// } -// -// private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of( TickType.RENDER); } -// -// @Override -// public String getLabel() { -// return null; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/8117f7e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/8117f7e5c42100141fce95f06aba7e85 deleted file mode 100644 index ab5091a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/8117f7e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSlowdown extends SubItemPotionGeneric { - - public SubItemPotionMoveSlowdown(Item itemID, int subID) { - super(itemID, subID, "potion.moveSlowdown"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/81d3cbf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/81d3cbf5c42100141fce95f06aba7e85 deleted file mode 100644 index d6d5f84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/81d3cbf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,152 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.client.model.ModelRenderer; -/** - * Used for Models that need to Track their Rotation - * i.e. Rotate based on their previous rotation angle - * See {@link #ModelArmadillo} - */ -public class EntityModelRotation { - public float rotateAngleX = 0; - public float rotateAngleY = 0; - public float rotateAngleZ = 0; - - public float rotationPointX; - public float rotationPointY; - public float rotationPointZ; - - public Boolean isSetup = false; - public String assignedPiece = "nothing"; - - private int xAngleDirec = 1; - private int yAngleDirec = 1; - public int zAngleDirec = 1; - - public EntityModelRotation() {} - - public void setup(ModelRenderer modelRenderer){ - rotateAngleX = modelRenderer.rotateAngleX; - rotateAngleY = modelRenderer.rotateAngleY; - rotateAngleZ = modelRenderer.rotateAngleZ; - rotationPointX = modelRenderer.rotationPointX; - rotationPointY = modelRenderer.rotationPointY; - rotationPointZ = modelRenderer.rotationPointZ; - - isSetup = true; - assignedPiece = modelRenderer.boxName; - } - - public float rotateX(float increment, float min, float max){ - rotateAngleX = clamp(rotateAngleX+increment, min, max); - return rotateAngleX; - } - - public float rotateY(float increment, float min, float max){ - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - public float rotateZ(float increment, float min, float max){ - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - - /** - * rotateZ Angle. - * par4 = 0 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min - */ - public float rotateZ(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleZ; - - case 2: - if(rotateAngleZ+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = max; - return rotateAngleZ; - } - - if(rotateAngleZ+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = min; - return rotateAngleZ; - } - - rotateAngleZ = rotateAngleZ+increment*zAngleDirec; - return rotateAngleZ; - - default: - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - } - - /* - * rotateY Angle. - * par4 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min (Uses Cosine) - */ - public float rotateY(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleY; - - case 2: - if(rotateAngleY+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = max; - return rotateAngleY; - } - - if(rotateAngleY+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = min; - return rotateAngleY; - } - - rotateAngleY = rotateAngleY+increment*zAngleDirec; - return rotateAngleY; - - default: - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - } - - - - private float clamp(float number, float min, float max){ - return Math.max(Math.min(number, max), min); - } - private float loop(float number, float min, float max){ - if(number>max){ - return min+number-max; - } - if(number entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/b07ce7f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/b07ce7f6c42100141fce95f06aba7e85 deleted file mode 100644 index 348457f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/b07ce7f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.item.ItemSlab; -import net.minecraft.item.ItemStack; - -public class ItemZuluSlab extends ItemSlab { - - private static BlockSlab halfBlock; - private static BlockSlab doubleSlab; - private final boolean isFullBlock; - - /** - * Setup the half/double Slab instances required by ItemSlab This is a workaround as Forge does not allow Blocks to - * registered with an instance of an itemClass but an Item.class which only allow itemID constructor - */ - public static void initialise(BlockSlab halfBlock, BlockSlab doubleSlab) { - ItemZuluSlab.halfBlock = halfBlock; - ItemZuluSlab.doubleSlab = doubleSlab; - } - - public ItemZuluSlab(Block block) { - super(block, (BlockSlab) halfBlock, (BlockSlab) doubleSlab, block == doubleSlab); - isFullBlock = block == doubleSlab; - } - - /** - * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have - * different names based on their damage or NBT. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) { - return isFullBlock ? doubleSlab.func_150002_b(par1ItemStack.getItemDamage()) : super - .getUnlocalizedName(par1ItemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/d0244e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/d0244e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 19b2f62..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/d0244e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,222 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f0c6e736052100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f0c6e736052100141769cb1ed0c338cd deleted file mode 100644 index f77957a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5/f0c6e736052100141769cb1ed0c338cd +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entityai.RandomPositionGenerator; -//import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityGenericCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/01ae8fe6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/01ae8fe6c42100141fce95f06aba7e85 deleted file mode 100644 index e570fa0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/01ae8fe6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,117 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY == cellHeight - 2) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (piecePos.posY % 2 == 1) { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - private boolean isCorner(ChunkCoordinates piecePos, int cellSize) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) - && (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1)) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "cemeterytomb2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/310ee9f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/310ee9f7c42100141fce95f06aba7e85 deleted file mode 100644 index 206726f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/310ee9f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import com.ngb.projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/31d281f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/31d281f5c42100141fce95f06aba7e85 deleted file mode 100644 index 5af076d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/31d281f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EggableDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityHauntedArmor; -import com.ngb.projectzulu.common.mobs.models.ModelHauntedArmor; -import com.ngb.projectzulu.common.mobs.renders.RenderHauntedArmor; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/40603fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/40603fe5c42100141fce95f06aba7e85 deleted file mode 100644 index 0e304de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/40603fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,99 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/50094000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/50094000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb9d7af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/50094000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.dungeon.BlockLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/52c066ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/52c066ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d7f1c40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/52c066ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,176 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/81c137a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/81c137a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 09736a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/81c137a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - - - -public class ModelTreeEntHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer NOSEROT; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer BACKTREESTEM6; - - public ModelTreeEntHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("BODYROT.mosscb2", 0, 28); - setTextureOffset("BODYROT.mosscb", 0, 20); - setTextureOffset("HEADROT.head", 88, 0); - setTextureOffset("HEADROT.brow5", 98, 18); - setTextureOffset("HEADROT.brow4", 98, 18); - setTextureOffset("HEADROT.brow3", 98, 18); - setTextureOffset("HEADROT.brow2", 106, 17); - setTextureOffset("HEADROT.brow1", 106, 13); - setTextureOffset("NOSEROT.nose1", 90, 16); - setTextureOffset("NOSEROT.nose2", 94, 20); - setTextureOffset("NOSEROT.nose3", 90, 22); - setTextureOffset("BACKTREESTEM5.backtreestem5", 32, 28); - setTextureOffset("BACKTREESTEM5.backtreesleaves5", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreesleaves6", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreestem6", 32, 28); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 24F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 0F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("mosscb2", -3.5F, -3F, 1F, 7, 3, 4); - BODYROT.addBox("mosscb", -4.5F, -3F, -3F, 9, 3, 4); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2.5F, -9F, -2.5F, 5, 12, 4); - HEADROT.addBox("brow5", 1.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow4", -0.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow3", -2.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow2", -2.5F, -3.5F, -3.5F, 5, 3, 1); - HEADROT.addBox("brow1", -2.5F, -7.5F, -3.5F, 5, 2, 1); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - NOSEROT.addBox("nose1", -0.5F, 0F, -2.5F, 1, 1, 2); - NOSEROT.addBox("nose2", -0.5F, 1F, -2.5F, 1, 1, 1); - NOSEROT.addBox("nose3", -1F, 2F, -3F, 2, 2, 2); - HEADROT.addChild(NOSEROT); - BODYROT.addChild(HEADROT); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BACKTREESTEM5.setRotationPoint(3F, -3F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - BACKTREESTEM5.addBox("backtreestem5", -0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addBox("backtreesleaves5", -3F, -7F, -3F, 6, 3, 6); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BACKTREESTEM6.setRotationPoint(-3F, -3F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - BACKTREESTEM6.addBox("backtreesleaves6", -3F, -7F, -3F, 6, 3, 6); - BACKTREESTEM6.addBox("backtreestem6", -0.5F, -4F, -0.5F, 1, 4, 1); - BODYROT.addChild(BACKTREESTEM6); - CENTERROT.addChild(BODYROT); - } - - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BACKTREESTEM5.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM5.rotateAngleZ = (float)(+20*Math.PI/180f); - - BACKTREESTEM6.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM6.rotateAngleZ = (float)(-20*Math.PI/180f); - - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/a0f822fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/a0f822fac42100141fce95f06aba7e85 deleted file mode 100644 index 6d98677..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/a0f822fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityMobHeads extends TileEntity { - - /* Passed in From Item Damage */ - private int skullType; - private int rotation; - private String ExtraType = ""; - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("SkullType", (byte) (this.skullType & 255)); - par1NBTTagCompound.setByte("Rot", (byte) (this.rotation & 255)); - par1NBTTagCompound.setString("ExtraType", this.ExtraType); - - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - skullType = par1NBTTagCompound.getByte("SkullType"); - rotation = par1NBTTagCompound.getByte("Rot"); - - if (par1NBTTagCompound.hasKey("ExtraType")) { - this.ExtraType = par1NBTTagCompound.getString("ExtraType"); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - NBTTagCompound tag = packet.func_148857_g(); - skullType = tag.getByte("SkullType"); - rotation = tag.getByte("Rot"); - } - - public void setSkullType(int par1, String par2Str) { - skullType = par1; - ExtraType = par2Str; - } - - public int getSkullType() { - return skullType; - } - - public void setRotation(int par1) { - rotation = par1; - } - - @SideOnly(Side.CLIENT) - public int getRotation() { - return rotation; - } - - @SideOnly(Side.CLIENT) - public String getExtraType() { - return ExtraType; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/a14622f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/a14622f8c42100141fce95f06aba7e85 deleted file mode 100644 index f18147e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/a14622f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b1097be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b1097be5c42100141fce95f06aba7e85 deleted file mode 100644 index 5528428..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b1097be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.models.ModelPelican; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b19029a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b19029a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5cfabb3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b19029a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBeaverHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBeaverHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 0F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 2F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 2F, -5F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b1d1b2f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b1d1b2f9c42100141fce95f06aba7e85 deleted file mode 100644 index 034866f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/b1d1b2f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/d047dcf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/d047dcf8c42100141fce95f06aba7e85 deleted file mode 100644 index 5af076d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/d047dcf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EggableDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityHauntedArmor; -import com.ngb.projectzulu.common.mobs.models.ModelHauntedArmor; -import com.ngb.projectzulu.common.mobs.renders.RenderHauntedArmor; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/d0550e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/d0550e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index deffdd6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/d0550e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,81 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBrownBear; -import projectzulu.common.mobs.models.ModelBrownBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/e018c649bfab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/e018c649bfab00141ee9bf3050c1025b new file mode 100644 index 0000000..ff0c8aa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/e018c649bfab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + boolean bugRelease = true; + boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/e0780af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/e0780af8c42100141fce95f06aba7e85 deleted file mode 100644 index 11ecf91..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/e0780af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/f1a996ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/f1a996ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d8a80cb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/50/f1a996ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/00de7900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/00de7900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3bc18ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/00de7900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,165 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/02d3fcf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/02d3fcf9c42100141fce95f06aba7e85 deleted file mode 100644 index 88dfd23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/02d3fcf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/204ebdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/204ebdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 69f849c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/204ebdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,132 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBoar extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEGROT1; - private ModelRenderer LEGROT2; - private ModelRenderer LEGROT3; - private ModelRenderer LEGROT4; - - public ModelBoar() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - setTextureOffset("BODYROT.body", 12, 8); - setTextureOffset("LEGROT1.leg1", 0, 13); - setTextureOffset("LEGROT2.leg2", 0, 13); - setTextureOffset("LEGROT3.leg3", 0, 13); - setTextureOffset("LEGROT4.leg4", 0, 13); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 14F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 14.5F, -4F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -4.5F, 0F, 10, 8, 16); - LEGROT1 = new ModelRenderer(this, "LEGROT1"); - LEGROT1.setRotationPoint(-3F, 3.5F, 14F); - setRotation(LEGROT1, 0F, 0F, 0F); - LEGROT1.mirror = true; - LEGROT1.addBox("leg1", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT1); - LEGROT2 = new ModelRenderer(this, "LEGROT2"); - LEGROT2.setRotationPoint(3F, 3.5F, 14F); - setRotation(LEGROT2, 0F, 0F, 0F); - LEGROT2.mirror = true; - LEGROT2.addBox("leg2", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT2); - LEGROT3 = new ModelRenderer(this, "LEGROT3"); - LEGROT3.setRotationPoint(-3F, 3.5F, 2F); - setRotation(LEGROT3, 0F, 0F, 0F); - LEGROT3.mirror = true; - LEGROT3.addBox("leg3", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT3); - LEGROT4 = new ModelRenderer(this, "LEGROT4"); - LEGROT4.setRotationPoint(3F, 3.5F, 2F); - setRotation(LEGROT4, 0F, 0F, 0F); - LEGROT4.mirror = true; - LEGROT4.addBox("leg4", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT4); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_x = 0.0f; - float field_78145_g = 2.2F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGROT1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/21bde4e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/21bde4e4c42100141fce95f06aba7e85 deleted file mode 100644 index 9f68851..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/21bde4e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/21f174ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/21f174ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 36a64df..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/21f174ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/311029fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/311029fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ec5dde2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/311029fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/405abbfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/405abbfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7379320..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/405abbfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,260 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/40b31175342000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/40b31175342000141dbfc2e92eb0e949 deleted file mode 100644 index 60a71c3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/40b31175342000141dbfc2e92eb0e949 +++ /dev/null @@ -1,33 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void preinit(FMLPreInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone }); - - GameRegistry.addRecipe(new ItemStack(Items.dye, 2, 15), new Object[]{ - "AB ", - "AAC", - "A ", - 'A', Blocks.cobblestone, 'B', Blocks.dirt, 'C', new ItemStack(Items.dye, 1, 1) - }); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/51224a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/51224a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c218251..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/51224a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; - -public interface ItemBlockDeclaration { - - public enum Type { - Block, Item; - } - - public abstract Type getType(); - - public abstract int getRegisterPass(); - - /** - * Loads ands saves the ItemBlock from the configuration filed. - * - * Called twice. Once for ItemBlocks already in the Config and again for new Items. Pass is indicated by readOnly - * boolean. - * - * @param config Configuration file to read save from - * @param readOnly Boolean indicating this is the pass for ItemBlock already in the Configuration file - */ - public abstract void createWithConfig(Configuration config, boolean readOnly); - - /** - * Registers the Created Block with the Environment - * - * i.e GameRegistry - */ - public abstract void register(Side side); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/51540ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/51540ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 1a58fa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/51540ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/6064bf28cbab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/6064bf28cbab00141ee9bf3050c1025b new file mode 100644 index 0000000..bd09f64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/6064bf28cbab00141ee9bf3050c1025b @@ -0,0 +1,299 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate = 5; + private int stickSpawnRate = 5; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(101); + + if (stickDrop <= stickSpawnRate) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(101) <= bugReleaseRate) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/61853cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/61853cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 2cbf3b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/61853cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a temperature Item - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempItem { - - /** - * Factor that adds to the current Player Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public Float getPlayerTempContributionFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public Float getLocationTemperatureFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate when the Item is in hand - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/702378bbc4ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/702378bbc4ab00141ee9bf3050c1025b new file mode 100644 index 0000000..59ba73a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/702378bbc4ab00141ee9bf3050c1025b @@ -0,0 +1,99 @@ +package com.stek101.projectzulu.common.mobs; + +import java.io.File; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.config.Configuration; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; + +public class BossHealthDisplayTicker { + + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + public static EntityGenericAnimal targetBoss; + protected Minecraft mc = Minecraft.getMinecraft(); + protected float zLevel = 0.0F; + static EntityPlayer player; + private Configuration config; + private boolean displayBossHealth = true; + private boolean bugRelease = true; + + // public BossHealthDisplayTicker (EntityGenericAnimal mobEntity) { + // this.targetBoss = mobEntity; + // } + + public static void registerEntity(EntityGenericAnimal newTicker) { + targetBoss = newTicker; + } + + public static boolean validTargetPresent(EntityGenericAnimal targetBoss) { + if (Minecraft.getMinecraft().thePlayer != null){ + //return targetBoss != null && !targetBoss.isDead && targetBoss.canEntityBeSeen(Minecraft.getMinecraft().thePlayer); + return targetBoss != null && !targetBoss.isDead && Minecraft.getMinecraft().thePlayer.canEntityBeSeen(targetBoss) + && (targetBoss.getDistanceToEntity(Minecraft.getMinecraft().thePlayer) < 16.0f); + } + else + return false; + } + + @SubscribeEvent + public void TickEvent(RenderTickEvent event) { + + if (event.phase == Phase.END && displayBossHealth) { + if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { + renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health"); + } + + } + } + + public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { + + FontRenderer fontRenderer = mc.fontRenderer; + + /* Draw Title */ + ScaledResolution var3 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + int screenWidth = var3.getScaledWidth(); + byte healthBarHeight = 12; + fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) + / 2, healthBarHeight - 10, 16711935); + + /* Draw Health Bar */ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(icons).getGlTextureId()); + short fullHealthBarWidth = 182; + int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; + int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); + + this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); + if (currHealthBarWidth > 0) { + this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); + var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); + var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); + var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); + var9.draw(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/705935f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/705935f8c42100141fce95f06aba7e85 deleted file mode 100644 index d751cc8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/705935f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/71eb5fe6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/71eb5fe6c42100141fce95f06aba7e85 deleted file mode 100644 index 1c230cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/71eb5fe6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.world.terrain; - -import net.minecraft.util.WeightedRandom; - -public class EntityEntry extends WeightedRandom.Item { - - public final String entityname; - - public EntityEntry(String entityname, int spawnWeight) { - super(spawnWeight); - if (entityname == null || entityname.trim() == "") { - throw new IllegalArgumentException("Entity Name Cannot be " + entityname == null ? "null" : "blank"); - } - this.entityname = entityname.trim(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/8183f1e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/8183f1e3c42100141fce95f06aba7e85 deleted file mode 100644 index 38cb32d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/8183f1e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,230 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/90e57bbe642300141cbf9363b5b13b15 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/90e57bbe642300141cbf9363b5b13b15 deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/90e57bbe642300141cbf9363b5b13b15 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a019f1f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a019f1f6c42100141fce95f06aba7e85 deleted file mode 100644 index 7638201..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a019f1f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a01c1ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a01c1ee5c42100141fce95f06aba7e85 deleted file mode 100644 index 2936a7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a01c1ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,309 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a0e455f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a0e455f9c42100141fce95f06aba7e85 deleted file mode 100644 index 228cf5a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a0e455f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a1ad85f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a1ad85f6c42100141fce95f06aba7e85 deleted file mode 100644 index 3df5e4c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/a1ad85f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,172 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.EnumSet; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; - -public class RenderHelper { - - public static enum Surface { - TOP(0), BOTTOM(1), - - /* +x is RIGHT */ - RIGHT(2), LEFT(3), - - /* +z is FRONT */ - FRONT(4), BACK(5); - public final int index; - - Surface(int index) { - this.index = index; - } - } - - public static boolean renderRotated2D(IIcon icon, float iconScale, RenderBlocks renderer, double posX, double posY, - double posZ, double xWidth, double yHeight, double angle) { - - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double minU = icon.getMinU(); - double maxU = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / iconScale; - double minV = icon.getMinV(); - double maxV = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / iconScale; - - double yMin = posY; - - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, maxU, minV); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle) { - renderRotatedRectangle(icon, iconScale, renderer, posX, posY, posZ, xWidth, yHeight, zWidth, angle, - EnumSet.allOf(Surface.class)); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle, - EnumSet sidesToDraw) { - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double deltaU = icon.getMaxU() - icon.getMinU(); - double deltaV = icon.getMaxV() - icon.getMinV(); - double minU = icon.getMinU() + deltaU / 2 * (1 - 1 / iconScale); - double maxU = icon.getMaxU() - deltaU / 2 * (1 - 1 / iconScale); - double minV = icon.getMinV() + deltaV / 2 * (1 - 1 / iconScale); - double maxV = icon.getMaxV() - deltaV / 2 * (1 - 1 / iconScale); - - double yMin = posY; - - double intermedVarZ = -zWidth / 2; - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = -zWidth / 2; - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = -xWidth / 2; - double point3X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point3Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = +xWidth / 2; - double point4X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point4Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - for (Surface surface : sidesToDraw) { - switch (surface) { - case RIGHT: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case LEFT: - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - break; - case BACK: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case FRONT: - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - break; - case TOP: - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - break; - case BOTTOM: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - } - - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b0c9de55c72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b0c9de55c72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cece5f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/b0c9de55c72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,150 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - player.posY + player.getEyeHeight(), player.posZ), - worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - entity.posZ)) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e0163ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e0163ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 19dc8d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e0163ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e061e6fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e061e6fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index fba617d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e061e6fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockNightBloom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e16676a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e16676a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2039367..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/e16676a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericLimited; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/f01b12a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/f01b12a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b78e77b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/51/f01b12a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/023ca0fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/023ca0fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 25e44db..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/023ca0fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/404c72e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/404c72e4c42100141fce95f06aba7e85 deleted file mode 100644 index 572819d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/404c72e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,605 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCampFire implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - RenderItem itemRenderer = new RenderItem(); - - ItemStack itemStackToRender = new ItemStack(block, 1, metadata); - - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 1.5f; - GL11.glPushMatrix(); - - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef((float) (90f * Math.PI / 180f), 1, 0, 0); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - /** - * Render Campfire Stones - */ - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case WoodFire: - case StoneFire: - /* Render If Should and Render Campfire Fire */ - renderBlockFire(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - break; - case Stone: - case Wood: - break; - } - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case Wood: - case WoodFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.35, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.24, var20, var15 + 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.24, var20, var15 - 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.21, var20, var15 + 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.21, var20, var15 - 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - break; - case Stone: - case StoneFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Stones */ - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 + 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 - 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - break; - } - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle2Sides(Block par1Block, int index1, int index2, int par2, double par3, - double par5, double par7, RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - double var13 = var10.getMinU(); - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2.01f; - double var17 = var10.getMinV(); - double var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) / 2.01f; - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 0.99f / 4f; - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 2.99f / 4f; - var17 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 0.99f / 4f; - var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 2.99f / 4f; - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle(Block par1Block, int var10, int par2, double par3, double par5, double par7, - RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 3, 2); - double var13 = icon.getMinU(); - double var15 = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / 2.01f; - double var17 = icon.getMinV(); - double var19 = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / 2.01f; - - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - return true; - } - - /** - * Renders a fire block at the given coordinates - */ - public boolean renderBlockFire(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - Tessellator var5 = Tessellator.instance; - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.fire, 0, 0); - double var9 = icon.getMinU(); - double var11 = icon.getMaxU(); - double var13 = icon.getMinV(); - double var15 = icon.getMaxV(); - - float var17 = 1.4F; - double var20; - double var22; - double var24; - double var26; - double var28; - double var30; - double var32; - - if (!World.doesBlockHaveSolidTopSurface(blockAccess, par2, par3 - 1, par4) - && !Blocks.fire.canCatchFire(blockAccess, par2, par3 - 1, par4, ForgeDirection.UP)) { - float var36 = 0.2F; - float var19 = 0.0625F; - - if ((par2 + par3 + par4 & 1) == 1) { - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - } - - if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { - var20 = var11; - var11 = var9; - var9 = var20; - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 - 1, par3, par4, ForgeDirection.EAST)) { - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 + 1, par3, par4, ForgeDirection.WEST)) { - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - var20 = par2 + 0.5D + 0.5D; // 1 - var22 = par2 + 0.5D - 0.5D; // 0 - var24 = par4 + 0.5D + 0.5D; - var26 = par4 + 0.5D - 0.5D; - - var28 = par2 + 0.5D - 0.5D; - var30 = par2 + 0.5D + 0.5D; - var32 = par4 + 0.5D - 0.5D; - double var34 = par4 + 0.5D + 0.5D; - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - ++par3; - var17 = -0.2F; - - if ((par2 + par3 + par4 & 1) == 0) { - var5.addVertexWithUV(var28, par3 + var17, par4 + 0, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 1, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 1, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(var30, par3 + var17, par4 + 1, var11, var13); - var5.addVertexWithUV(var22, par3 + 0, par4 + 1, var11, var15); - var5.addVertexWithUV(var22, par3 + 0, par4 + 0, var9, var15); - var5.addVertexWithUV(var30, par3 + var17, par4 + 0, var9, var13); - } else { - var5.addVertexWithUV(par2 + 0, par3 + var17, var34, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0, var26, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0, var26, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17, var34, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 1, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17, var32, var9, var13); - } - } - } else { - double var18 = par2 + 0.5D + 0.2D; - var20 = par2 + 0.5D - 0.2D; // - var22 = par4 + 0.5D + 0.2D; - var24 = par4 + 0.5D - 0.2D; - var26 = par2 + 0.5D - 0.3D; - var28 = par2 + 0.5D + 0.3D; - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - - var18 = par2 + 0.5D - 0.3D; // - var20 = par2 + 0.5D + 0.3D; // / - var22 = par4 + 0.5D - 0.3D; - var24 = par4 + 0.5D + 0.3D; - var26 = par2 + 0.5D - 0.3D; // - var28 = par2 + 0.5D + 0.3D; // / - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - } - - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/40e7ed9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/40e7ed9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1cd0fef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/40e7ed9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.api.BlockList; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/416c48f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/416c48f8c42100141fce95f06aba7e85 deleted file mode 100644 index 8067cb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/416c48f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWeakness extends SubItemPotionHalfPower { - - public SubItemPotionWeakness(Item itemID, int subID) { - super(itemID, subID, "Weakness"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.weakness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/417154a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/417154a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cadc94..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/417154a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.heads.BlockMobHeads; -import projectzulu.common.blocks.heads.ItemMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/50436ee6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/50436ee6c42100141fce95f06aba7e85 deleted file mode 100644 index 5e7b1fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/50436ee6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public interface Blueprint { - - /** - * - * @param pieceLoc X,Y,Z Coordinate of Piece within Cell - * @param cellSize - * @param maxHeight - * @param xIndex - * @param zIndex - * @param random - * @param cellIndexDirection - * @return - */ - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection); - - /** - * Used to Search Architect list for a specific Building Type - * - * Type insensitive. Should be unique. - */ - public abstract String getIdentifier(); - - public abstract int getWeight(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/6099f6fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/6099f6fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f68f96..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/6099f6fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,156 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFinch; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/60a843a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/60a843a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e708c5e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/60a843a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/611edd9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/611edd9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8578e9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/611edd9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/9186e3fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/9186e3fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9ad5b1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/9186e3fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMammoth; -import projectzulu.common.mobs.models.ModelMammoth; -import projectzulu.common.mobs.renders.RenderMammoth; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c13f40e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c13f40e4c42100141fce95f06aba7e85 deleted file mode 100644 index 84d336c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/c13f40e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GoldScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GoldScaleArmorDeclaration(int renderIndex) { - super(new String[] { "GoldScaleHelmet", "GoldScaleChest", "GoldScaleLegs", "GoldScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.goldScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.goldScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.goldScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.goldScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.goldScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.goldScaleArmorHead.get(); - break; - case 1: - item = ItemList.goldScaleArmorChest.get(); - break; - case 2: - item = ItemList.goldScaleArmorLeg.get(); - break; - case 3: - item = ItemList.goldScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d09714a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d09714a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d108923..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/52/d09714a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.BossHealthDisplayTicker; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/40ba47f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/40ba47f6c42100141fce95f06aba7e85 deleted file mode 100644 index e317e16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/40ba47f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.EnumSet; -import java.util.HashMap; - -/** - * Represent the readable Tags for OptionalSettings - */ -public enum Key { - /* Category Tags */ - spawn("spawn", KeyParserSpawn.class), despawn("despawn", KeyParserDespawn.class), - - /* Properties */ - sky("sky", KeyParserSky.class), block("block", KeyParserBlock.class), blockFoot("blockFoot", - KeyParserBlockFoot.class), light("light", KeyParserLight.class), entityCap("cap", KeyParserEntityCap.class), spawnRange( - "spawnRange", KeyParserSpawnRange.class), maxSpawnRange("maxSpawnRange", KeyParserMaxSpawnRange.class), despawnAge( - "despawnAge", KeyParserDespawnAge.class), spawnRate("spawnRate", KeyParserSpawnRate.class), blockRange( - "blockRange", KeyParserBlockRange.class), material("material", null), minSpawnHeight("minSpawnHeight", - KeyParserMinHeight.class), maxSpawnHeight("maxSpawnHeight", KeyParserMaxHeight.class), normal("normal", - KeyParserNormalCube.class), liquid("liquid", KeyParserLiquid.class), opaque("opaque", - KeyParserOpaqueBlock.class), solidSide("solidSide", KeyParserSolidSide.class), difficulty("difficulty", - KeyParserDifficulty.class), torchLight("torchLight", KeyParserTorchLight.class), ground("ground", - KeyParserGround.class), top("top", KeyParserTop.class), fill("fill", KeyParserFill.class), modspawn( - "modSpawn", KeyParserModSpawn.class), origin("origin", KeyParserOrigin.class), players("players", - KeyParserPlayers.class), entities("entities", KeyParserEntities.class), random("random", - KeyParserRandom.class), writenbt("writenbt", KeyParserWriteNBT.class), - - /* Sub Tags */ - blockRangeX("blockRangeX", null), blockRangeY("blockRangeY", null), blockRangeZ("blockRangeZ", null), - - /**/ - UNKNOWN("", null); - - public final String key; - private static final HashMap lookupEnum = new HashMap(); - static { - for (Key key : EnumSet.allOf(Key.class)) - lookupEnum.put(key.key.toUpperCase(), key); - } - - public KeyParser keyParser; - - Key(String key, Class keyParserClass) { - this.key = key; - if (keyParserClass != null) { - try { - keyParser = keyParserClass.getConstructor(new Class[] { Key.class }).newInstance(new Object[] { this }); - } catch (Exception exception) { - exception.printStackTrace(); - return; - } - } - } - - /** - * Gets the Key associated with the String. Is not case Sensitive - * - * @param string - * @return - */ - public static Key getKeybyString(String string) { - Key value = lookupEnum.get(string.toUpperCase()); - if (value != null) { - return value; - } else { - return UNKNOWN; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/410a9af4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/410a9af4c42100141fce95f06aba7e85 deleted file mode 100644 index d751cc8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/410a9af4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/4112e6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/4112e6f5c42100141fce95f06aba7e85 deleted file mode 100644 index 66af19b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/4112e6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/502ce99fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/502ce99fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2d2cce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/502ce99fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,107 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/60e4aaa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/60e4aaa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43a02d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/60e4aaa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCemetary; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/611767e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/611767e6c42100141fce95f06aba7e85 deleted file mode 100644 index cdc1250..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/611767e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprint.cathedral.BPSetCathedral; - -public class ArchitectCathedral extends ArchitectBase { - - public ArchitectCathedral(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetCathedral()); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - set = stockpile.getRandomApplicable(cells, buildCoords); - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/71f755ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/71f755ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 78034fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/71f755ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/80ee68a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/80ee68a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b693589..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/80ee68a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityGreenFinch extends EntityFinch{ - - public EntityGreenFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/a14b2ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/a14b2ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f99f450..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/a14b2ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelElephantHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - - public ModelElephantHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); -// setTextureOffset("EARLEFROT.earlef", 55, 41); -// setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 12F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -6F, 8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); -// EARLEFROT = new ModelRenderer(this, "EARLEFROT"); -// EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); -// setRotation(EARLEFROT, 0F, 1.22173F, 0F); -// EARLEFROT.mirror = true; -// EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARLEFROT); -// EARRIGROT = new ModelRenderer(this, "EARRIGROT"); -// EARRIGROT.setRotationPoint(7F, -0.5F, -4F); -// setRotation(EARRIGROT, 0F, -1.22173F, 0F); -// EARRIGROT.mirror = true; -// EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - TRUNK1ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK2ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK3ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK4ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK5ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK6ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK7ROT.rotateAngleX = (float) (45*Math.PI/180); - -// switch ((int)skullState) { -// case 1: -// NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); -// break; -// -// default: -// NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); -// break; -// } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/b0cb1701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/b0cb1701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8d0efb5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/b0cb1701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityElephant; -import projectzulu.common.mobs.models.ModelElephant; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/b1de289ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/b1de289ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fbfa0a4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/b1de289ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c1be84a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c1be84a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 765b683..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/c1be84a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/f1fe03fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/f1fe03fac42100141fce95f06aba7e85 deleted file mode 100644 index 1ca0885..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/f1fe03fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeLeaves; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/f2f970a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/f2f970a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1e1c78c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/53/f2f970a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/201ddbb9cb2100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/201ddbb9cb2100141a6cb1c64d7b6ba1 deleted file mode 100644 index a13a899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/201ddbb9cb2100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/20bde4e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/20bde4e4c42100141fce95f06aba7e85 deleted file mode 100644 index 926f898..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/20bde4e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/20f174ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/20f174ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8dd52fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/20f174ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.BlockWithPalmTree; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/214ebdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/214ebdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 2f7c1a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/214ebdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBlackBear extends ModelBear { - - public ModelBlackBear() { - super(0); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.0f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/40d04da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/40d04da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43afe26..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/40d04da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/52f241fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/52f241fac42100141fce95f06aba7e85 deleted file mode 100644 index e0bf2f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/52f241fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/608a48a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/608a48a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9536a7d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/608a48a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCoconut; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/6205799fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/6205799fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 27b395e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/6205799fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,13 +0,0 @@ -package projectzulu.common.potion.effects; - -public class PotionBubbling extends PotionZulu { - - protected PotionBubbling(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - @Override - public boolean isInstant() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/91104affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/91104affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 02993e4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/91104affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b066b0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b066b0e4c42100141fce95f06aba7e85 deleted file mode 100644 index 1133821..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/b066b0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -/** - * Terrain Feature that is Restricted by Biome - */ -public abstract class BiomeFeature extends BaseFeature { - - /** List of Biome Package Names that this Feature can Spawn in */ - protected ArrayList biomesToSpawn = new ArrayList(); - - public BiomeFeature(String featureName, Size size) { - super(featureName, size); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - return biomesToSpawn.contains(getBiomePackageName(world.getBiomeGenForCoords(genBlockCoords.posX, - genBlockCoords.posZ))); - } - return false; - } - - protected abstract Collection getDefaultBiomeList(); - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - Collection defaultBiomesToSpawn = getDefaultBiomeList(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - if (config.getFeatureProperty(this, "GeneratingBiomes", - getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i]), - defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName)).getBoolean(false)) { - biomesToSpawn.add(getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i])); - } - } - } - - private String getBiomePackageName(BiomeGenBase biome) { - return biome.getClass().getName() + "." + biome.biomeName; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/c0411f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/c0411f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5f13576..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/c0411f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelTombstone extends ModelBase -{ - //fields - ModelRenderer baserig; - ModelRenderer body4; - ModelRenderer topcenter; - ModelRenderer baselef; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - private ModelRenderer CENTERROT; - private ModelRenderer TOPLEFROT; - private ModelRenderer TOPRIGROT; - - public ModelTombstone(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TOPLEFROT.topleft", 0, 17); - setTextureOffset("TOPRIGROT.topright", 0, 17); - - body4 = new ModelRenderer(this, 28, 15); - body4.addBox(0F, -18F, -4.5F, 9, 8, 9); - body4.setRotationPoint(0F, 28F, 0F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - topcenter = new ModelRenderer(this, 28, 16); - topcenter.addBox(-4.5F, -4F, -4.5F, 9, 4, 9); - topcenter.setRotationPoint(0F, 2F, 0F); - topcenter.setTextureSize(64, 32); - topcenter.mirror = true; - setRotation(topcenter, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 28, 15); - body3.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body3.setRotationPoint(0F, 28F, 0F); - body3.setTextureSize(64, 32); - body3.mirror = true; - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body3.mirror = false; - body2 = new ModelRenderer(this, 28, 15); - body2.addBox(0F, -18F, -4.5F, 9, 8, 9); - body2.setRotationPoint(0F, 20F, 0F); - body2.setTextureSize(64, 32); - body2.mirror = true; - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body2.mirror = false; - body1 = new ModelRenderer(this, 28, 15); - body1.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body1.setRotationPoint(0F, 20F, 0F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - baselef = new ModelRenderer(this, 0, 0); - baselef.addBox(-12F, -3F, -6F, 12, 6, 12); - baselef.setRotationPoint(0F, 21F, 0F); - baselef.setTextureSize(64, 32); - baselef.mirror = true; - baselef.mirror = true; - setRotation(baselef, 0F, 0F, 0F); - baselef.mirror = false; - baserig = new ModelRenderer(this, 0, 0); - baserig.addBox(0F, -3F, -6F, 12, 6, 12); - baserig.setRotationPoint(0F, 21F, 0F); - baserig.setTextureSize(64, 32); - baserig.mirror = true; - baserig.mirror = true; - setRotation(baserig, 0F, 0F, 0F); - baserig.mirror = false; - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 1.2F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - TOPLEFROT = new ModelRenderer(this, "TOPLEFROT"); - TOPLEFROT.setRotationPoint(-5.8F, 0F, 0F); - setRotation(TOPLEFROT, 0F, 0F, 0.837758F); - TOPLEFROT.mirror = true; - TOPLEFROT.addBox("topleft", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPLEFROT); - TOPRIGROT = new ModelRenderer(this, "TOPRIGROT"); - TOPRIGROT.setRotationPoint(5.8F, 0F, 0F); - setRotation(TOPRIGROT, 0F, 0F, -0.837758F); - TOPRIGROT.mirror = true; - TOPRIGROT.addBox("topright", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPRIGROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - baserig.render(f5); - body4.render(f5); - topcenter.render(f5); - baselef.render(f5); - body3.render(f5); - body2.render(f5); - body1.render(f5); - - CENTERROT.render(f5); - - } - - public void render1(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - body4.rotateAngleY = (float) (angle*Math.PI/180); - body4.render(f5); - topcenter.rotateAngleY = (float) (angle*Math.PI/180); - topcenter.render(f5); - - body3.rotateAngleY = (float) (angle*Math.PI/180); - body3.render(f5); - body2.rotateAngleY = (float) (angle*Math.PI/180); - body2.render(f5); - body1.rotateAngleY = (float) (angle*Math.PI/180); - body1.render(f5); - - baselef.rotateAngleY = (float) (angle*Math.PI/180); - baselef.render(f5); - baserig.rotateAngleY = (float) (angle*Math.PI/180); - baserig.render(f5); - } - - public void render2(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - CENTERROT.rotateAngleY = (float) (angle*Math.PI/180); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } - -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/e12399e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/e12399e6c42100141fce95f06aba7e85 deleted file mode 100644 index cde2d21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/e12399e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.BlockWithPalmTree; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/e180cee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/e180cee5c42100141fce95f06aba7e85 deleted file mode 100644 index 9cbf83c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/54/e180cee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class TileEntityBrewingStandRenderer extends TileEntitySpecialRenderer { - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - renderTileEntity((TileEntityBrewingBase) tileEntity, xRenderCoord, yRenderCoord, zRenderCoord, var8); - } - - private void renderTileEntity(TileEntityBrewingBase tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - RenderItem itemRenderer = new RenderItem(); - itemRenderer.setRenderManager(RenderManager.instance); - - ItemStack ingredientStack = tileEntity.brewingItemStacks[tileEntity.brewingItemStacks.length - 1]; - if (ingredientStack != null) { - if (ingredientStack.stackSize > 1) { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.28f); - } else { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.4f); - } - } - - float[] zOffsets = new float[] { 0, +0.29f, -0.29f }; - float[] rotation = new float[] { 90f, 0.0f, 0.0f }; - for (int i = 0; i < tileEntity.brewingItemStacks.length - 1; i++) { - ItemStack stackToRender = tileEntity.brewingItemStacks[i]; - if (stackToRender == null) { - continue; - } - renderItemStack(stackToRender, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord - 0.25D, - zRenderCoord + zOffsets[i], rotation[i], 0.6f); - } - } - - private void renderItemStack(ItemStack stackToRender, RenderItem renderer, World world, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float rotation, float scale) { - EntityItem entityItemToRender = new EntityItem(world, xRenderCoord, yRenderCoord, zRenderCoord, stackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = scale; - GL11.glPushMatrix(); - bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); - renderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/013ca0fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/013ca0fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f8d0f0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/013ca0fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/017228e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/017228e4c42100141fce95f06aba7e85 deleted file mode 100644 index 298643b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/017228e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/10194701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/10194701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 287f42d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/10194701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,556 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/10d41301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/10d41301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ee7000..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/10d41301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBoar; -import projectzulu.common.mobs.models.ModelBoar; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/30e1b7f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/30e1b7f6c42100141fce95f06aba7e85 deleted file mode 100644 index 437b4ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/30e1b7f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZPotionTab extends CreativeTabs { - - public CreativePZPotionTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - public Item getTabIconItem() { - return Items.potionitem; - } - - @Override - public int func_151243_f() { - return 3; - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu Potions"; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/30f0f19dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/30f0f19dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 05a40e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/30f0f19dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/313b38f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/313b38f4c42100141fce95f06aba7e85 deleted file mode 100644 index 5c3c0b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/313b38f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,5 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -public interface BuildingManager { - public abstract void generate(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/321d0cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/321d0cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5072cb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/321d0cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/41cbbdfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/41cbbdfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54b0d8c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/41cbbdfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/51727ea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/51727ea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5414777..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/51727ea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,152 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.client.model.ModelRenderer; -/** - * Used for Models that need to Track their Rotation - * i.e. Rotate based on their previous rotation angle - * See {@link #ModelArmadillo} - */ -public class EntityModelRotation { - public float rotateAngleX = 0; - public float rotateAngleY = 0; - public float rotateAngleZ = 0; - - public float rotationPointX; - public float rotationPointY; - public float rotationPointZ; - - public Boolean isSetup = false; - public String assignedPiece = "nothing"; - - private int xAngleDirec = 1; - private int yAngleDirec = 1; - public int zAngleDirec = 1; - - public EntityModelRotation() {} - - public void setup(ModelRenderer modelRenderer){ - rotateAngleX = modelRenderer.rotateAngleX; - rotateAngleY = modelRenderer.rotateAngleY; - rotateAngleZ = modelRenderer.rotateAngleZ; - rotationPointX = modelRenderer.rotationPointX; - rotationPointY = modelRenderer.rotationPointY; - rotationPointZ = modelRenderer.rotationPointZ; - - isSetup = true; - assignedPiece = modelRenderer.boxName; - } - - public float rotateX(float increment, float min, float max){ - rotateAngleX = clamp(rotateAngleX+increment, min, max); - return rotateAngleX; - } - - public float rotateY(float increment, float min, float max){ - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - public float rotateZ(float increment, float min, float max){ - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - - /** - * rotateZ Angle. - * par4 = 0 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min - */ - public float rotateZ(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleZ; - - case 2: - if(rotateAngleZ+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = max; - return rotateAngleZ; - } - - if(rotateAngleZ+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = min; - return rotateAngleZ; - } - - rotateAngleZ = rotateAngleZ+increment*zAngleDirec; - return rotateAngleZ; - - default: - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - } - - /* - * rotateY Angle. - * par4 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min (Uses Cosine) - */ - public float rotateY(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleY; - - case 2: - if(rotateAngleY+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = max; - return rotateAngleY; - } - - if(rotateAngleY+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = min; - return rotateAngleY; - } - - rotateAngleY = rotateAngleY+increment*zAngleDirec; - return rotateAngleY; - - default: - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - } - - - - private float clamp(float number, float min, float max){ - return Math.max(Math.min(number, max), min); - } - private float loop(float number, float min, float max){ - if(number>max){ - return min+number-max; - } - if(number 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70180601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70180601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9eaa807..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/70180601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIWander extends EntityAIBase -{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityGenericCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityGenericCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && !entity.isEntityGrounded()) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/8001bd00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/8001bd00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f36c4bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/8001bd00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/8155c8f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/8155c8f9c42100141fce95f06aba7e85 deleted file mode 100644 index 838f419..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/8155c8f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.projectzulu.common; - -import com.ngb.projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import com.ngb.projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/91815ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/91815ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 819a0fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/91815ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/91d9019fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/91d9019fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2a9162..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/91d9019fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/a2adfa9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/a2adfa9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8bd43ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/a2adfa9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.command.IEntitySelector; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAINearestAttackableTarget extends EntityAITarget{ - EntityLivingBase targetEntity; - Class targetClass; - int targetChance; - private final IEntitySelector entitySelector; - EnumSet setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b1b86cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b1b86cf4c42100141fce95f06aba7e85 deleted file mode 100644 index aed0942..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/b1b86cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/c04e5c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/c04e5c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3540cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/c04e5c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,1046 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/d24232ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/d24232ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9b13b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/d24232ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/e1e90cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/e1e90cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 28ff81c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/e1e90cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,141 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f00850f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f00850f4c42100141fce95f06aba7e85 deleted file mode 100644 index 1f5e820..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f00850f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,334 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f086aa9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f086aa9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 805dae7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f086aa9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f12fc801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f12fc801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b1d49e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/55/f12fc801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public abstract class BPOasisEdge implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - List flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/007e8fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/007e8fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3167702..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/007e8fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/014996f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/014996f9c42100141fce95f06aba7e85 deleted file mode 100644 index 769f476..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/014996f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLimitedMobSpawner extends BlockContainer { - - public BlockLimitedMobSpawner() { - super(Material.rock); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, - float par7, float par8, float par9) { - if (player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isCreativeMode) { - ((EntityPlayer) player).openGui(ProjectZulu_Core.modInstance, GuiID.MobSpawner.getID(), par1World, par2, - par3, par4); - return true; - } - return super.onBlockActivated(par1World, par2, par3, par4, player, par6, par7, par8, par9); - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityLimitedMobSpawner(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/01bf2ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/01bf2ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 69a6d9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/01bf2ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/01d3fcf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/01d3fcf9c42100141fce95f06aba7e85 deleted file mode 100644 index 0714f67..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/01d3fcf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public ScaleArmorDeclaration(int renderIndex) { - super(new String[] { "ScaleHelmet", "ScaleChest", "ScaleLegs", "ScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.scaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.scaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.scaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.scaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.scaleArmorHead.get(); - break; - case 1: - item = ItemList.scaleArmorChest.get(); - break; - case 2: - item = ItemList.scaleArmorLeg.get(); - break; - case 3: - item = ItemList.scaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/10cdcf9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/10cdcf9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6b3779b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/10cdcf9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,119 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isRideable() function - */ -public abstract class EntityGenericRideable extends EntityGenericBreedable{ - - public EntityGenericRideable(World par1World) { - super(par1World); - } - /* Toggles Whether the Child Class can be Ridden and used methods in this Class - * i.e. If false, will not be able to be saddled/mounted */ - public boolean isRideable(){ - return false; - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handles Whether the Entity Is Saddled */ - this.dataWatcher.addObject(21, Byte.valueOf((byte)0)); - } - - /** - * Returns true if the Entity is saddled. - */ - public boolean getSaddled() { - return (this.dataWatcher.getWatchableObjectByte(21) & 1) != 0; - } - - /** - * Set or remove the saddle of the Entity. - */ - public void setSaddled(boolean par1) { - if (par1) { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)1)); - } - else { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)0)); - } - } - - /** - * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden - * by a player and the player is holding a carrot-on-a-stick - */ - @Override - public boolean canBeSteered() { - ItemStack var1 = ((EntityPlayer) this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem().equals(Items.stick); - } - - /** - * Checks if Item should Cause the Horse to Continue Moving in the Direction it was already going - */ - public boolean shouldIgnorePlayerRot(){ - if(riddenByEntity != null && riddenByEntity instanceof EntityPlayer){ - ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem() != Items.stick; - } - return false; - } - - /** - * Sets the Player Rotation to Face the Direction of the Entity - */ - @Override - public boolean shouldRiderFaceForward(EntityPlayer player) { - return true; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - if (super.interact(par1EntityPlayer)) { - return true; - } - - if(isRideable()){ - /* If Saddled Get on/off Entity */ - if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { - par1EntityPlayer.mountEntity(this); - return true; - - /* If Not Saddled: Try to Saddle Entity */ - }else if(!getSaddled() && par1EntityPlayer.inventory.getCurrentItem() != null - && par1EntityPlayer.inventory.getCurrentItem().getItem() == Items.saddle ){ - setSaddled(true); - return true; - } - } - return false; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/21a38ca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/21a38ca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0e304de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/21a38ca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3031ecf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3031ecf9c42100141fce95f06aba7e85 deleted file mode 100644 index 162677b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3031ecf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemFoodProjectZulu extends ItemFood { - /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; - - /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; - - /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; - - /** - * If this field is true, the food can be consumed even if the player don't need to eat. - */ - private boolean alwaysEdible; - - /** - * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect - */ - private int potionId; - - /** set by setPotionEffect */ - private int potionDuration; - - /** set by setPotionEffect */ - private int potionAmplifier; - - /** probably of the set potion effect occurring */ - private float potionEffectProbability; - - public ItemFoodProjectZulu(int par2, float par3, boolean par4, String name) { - super(par2, par3, par4); - itemUseDuration = 32; - healAmount = par2; - isWolfsFavoriteMeat = par4; - saturationModifier = par3; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - --par1ItemStack.stackSize; - par3EntityPlayer.getFoodStats().func_151686_a(this, par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); - this.func_77849_c(par1ItemStack, par2World, par3EntityPlayer); - return par1ItemStack; - } - - protected void func_77849_c(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3186c2fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3186c2fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 79cf867..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3186c2fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3191dde4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3191dde4c42100141fce95f06aba7e85 deleted file mode 100644 index f92608a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/3191dde4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/502eada2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/502eada2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f670851..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/502eada2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectOasis; -import projectzulu.common.world2.randomizer.EdgeRandomizer; -import projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/503613f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/503613f9c42100141fce95f06aba7e85 deleted file mode 100644 index f028864..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/503613f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/511ae0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/511ae0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b74157..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/511ae0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBrownBear extends ModelBear { - - public ModelBrownBear() { - super(7); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.4f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/80b2fdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/80b2fdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 14bbff9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/80b2fdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/81a8d39fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/81a8d39fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 765b683..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/81a8d39fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/9136c2f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/9136c2f5c42100141fce95f06aba7e85 deleted file mode 100644 index 0647724..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/9136c2f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/b022dfe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/b022dfe5c42100141fce95f06aba7e85 deleted file mode 100644 index a3ba720..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/b022dfe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/b04a1ff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/b04a1ff6c42100141fce95f06aba7e85 deleted file mode 100644 index 75f0880..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/b04a1ff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,165 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/d03db29fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/d03db29fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3f5688..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/d03db29fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world; - -import java.util.Random; - -public enum CellIndexDirection { - Middle, Inner, NorthMiddle, SouthMiddle, WestMiddle, EastMiddle, NorthWestCorner, NorthEastCorner, SouthWestCorner, SouthEastCorner, NorthWall, SouthWall, WestWall, EastWall; - - public boolean isCorner() { - return this == NorthWestCorner || this == NorthEastCorner || this == SouthWestCorner || this == SouthEastCorner; - } - - public static CellIndexDirection randomCardinalDirection(Random random) { - switch (random.nextInt(4)) { - case 0: - return NorthMiddle; - case 1: - return SouthMiddle; - case 2: - return WestMiddle; - case 3: - return EastMiddle; - default: - return NorthMiddle; - } - } - - public CellIndexDirection calcDirection(int cellIndex, int cellSize) { - - /* Check if Middle */ - if (cellSize % 2 == 1) { - if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1) / 2) { - return Middle; - } else if (cellIndex == (cellSize - 1) / 2) { - return WestMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2) { - return NorthMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) + (cellSize - 1) / 2) { - return EastMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1)) { - return SouthMiddle; - } - } - - /* Check if Corner */ - if (cellIndex == 0) { - return NorthWestCorner; - } else if (cellIndex == cellSize - 1) { - return SouthWestCorner; - } else if (cellIndex == cellSize * cellSize - 1) { - return SouthEastCorner; - } else if (cellIndex == cellSize * cellSize - cellSize) { - return NorthEastCorner; - } - - /* Check if Outer Edge */ - if ((cellIndex % cellSize == (0))) { - return NorthWall; - } else if ((cellIndex % cellSize == (cellSize - 1))) { - return SouthWall; - } else if (cellIndex >= cellSize * (cellSize - 1) && cellIndex < cellSize * cellSize) { - return EastWall; - } else if (cellIndex >= 0 && cellIndex < cellSize) { - return WestWall; - } - - /* If Nothing Else Mark as Inner */ - return Inner; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/d0fc0d00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/d0fc0d00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f4444b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/d0fc0d00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,159 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import net.minecraft.util.Vec3; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - // player.posY + player.getEyeHeight(), player.posZ), - // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - // entity.posZ)) == null) { - // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - // player.posY + player.getEyeHeight(), player.posZ), - Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), - // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - // entity.posZ) - Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) - ) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/f2595ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/f2595ee5c42100141fce95f06aba7e85 deleted file mode 100644 index 61489ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/f2595ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBoar; -import projectzulu.common.mobs.models.ModelBoar; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/008501a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/008501a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0155d5c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/008501a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/30aa3ea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/30aa3ea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 59ea507..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/30aa3ea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/31dc7effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/31dc7effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index edf9557..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/31dc7effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/409e2ef4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/409e2ef4c42100141fce95f06aba7e85 deleted file mode 100644 index 50ac433..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/409e2ef4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/60efcce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/60efcce4c42100141fce95f06aba7e85 deleted file mode 100644 index 0dd1ef4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/60efcce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; - -public class NBTTree { - private NBTNode root; - - public NBTTree(NBTBase rootData, String rootName) { - root = new NBTNode(rootData, null, rootName); - } - - public NBTNode getRootNode() { - return root; - } - - public boolean addNode(NBTBase data, NBTNode parent, String tagName) { - return parent.addChild(data, tagName); - } - - public void removeChildNode(NBTNode nodeToRemove, NBTNode parentNode) { - parentNode.removeChild(nodeToRemove); - } - - public NBTTagCompound toNBTTagCompound() { - NBTTagCompound nbtTagCompound = new NBTTagCompound(); - root.writeNodeandChildrenToNBT(nbtTagCompound); - return (NBTTagCompound) nbtTagCompound.getTag("Properties"); - } - - public ArrayList toArrayList() { - ArrayList nodeList = new ArrayList(); - root.writeNodeandChildrenToArrayList(nodeList); - return nodeList; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/71319bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/71319bf6c42100141fce95f06aba7e85 deleted file mode 100644 index b044250..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/71319bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.util.MathHelper; - -public class ModelHelper { - - /** - * Absolute Value alternative to {@link MathHelper#abs(float par0)} for Double values - */ - public static double abs(double value) { - if (value < 0) { - return 0f; - } else { - return value; - } - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value may be outside - * the range of values. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value will be clamped - * to the min.max values of the target range. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueWithClamp(float value, float set1min, float set1max, float set2min, float set2max) { - float value2 = (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - value2 = MathHelper.clamp_float(value2, set2min, set2max); - return value2; - } - - /** - * Vanilla Function used for Rotations - * - * @param par1 - * @param par2 - * @return - */ - // TODO: Rename To Something Decent, deobfuscate parameters - public static float func_78172_a(float par1, float par2) { - return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); - } - - /** - * Sets the RotationPoint of the provided Model using the value interpolated to the desired ranges foreach direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotationPoint(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotationPointX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotationPointY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotationPointZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } - - /** - * Sets the Rotation of the provided Model using the value interpolated to the desired ranges for each direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotation(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotateAngleX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotateAngleY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotateAngleZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/71c5a49ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/71c5a49ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2347779..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/71c5a49ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.NBTWriter; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/81ec2ff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/81ec2ff6c42100141fce95f06aba7e85 deleted file mode 100644 index 6738c99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/81ec2ff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04a3da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04a3da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d53c409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a04a3da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,133 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a0d3b5e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a0d3b5e6c42100141fce95f06aba7e85 deleted file mode 100644 index 7639a38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a0d3b5e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public abstract class BaseModule implements Module { - - @Override - public void registration(ItemBlockManager manager) { - } - - @Override - public void registration(CustomEntityManager manager) { - } - - @Override - public void registration(FeatureGenerator manager) { - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - } - - @Override - public void init(FMLInitializationEvent event, File configDirectory) { - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - } - - @Override - public void serverStart(FMLServerStartedEvent event, File configDirectory) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a1c65e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a1c65e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3fcd3c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/a1c65e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b10b5a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b10b5a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8106577..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/b10b5a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,524 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/c08219fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/c08219fac42100141fce95f06aba7e85 deleted file mode 100644 index 39203a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/c08219fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0a0c2f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0a0c2f4c42100141fce95f06aba7e85 deleted file mode 100644 index e466233..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e0a0c2f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e1162bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e1162bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9de43fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/57/e1162bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/00bf1cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/00bf1cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 313e859..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/00bf1cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,349 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/11d2669ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/11d2669ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2fbb6be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/11d2669ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.blocks.GuiAnimalName; -import projectzulu.common.blocks.tombstone.GuiTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.universalpot.ContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.GuiContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.dungeon.GuiLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; -import projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingBase; -import cpw.mods.fml.common.network.IGuiHandler; - -public class ZuluGuiHandler implements IGuiHandler { - - @Override - public Object getServerGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - - TileEntity tileEntityServer; - switch (GuiID.getGuiIDByID(guiID)) { - case FlowerPot: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityUniversalFlowerPot) { - return new ContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityServer); - } - case BrewingStand: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityBrewingBase) { - return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - default: - break; - } - return null; - - } - - @Override - public Object getClientGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tileEntityClient; - switch (GuiID.getGuiIDByID(guiID)) { - case Tombstone: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityTombstone) { - return new GuiTombstone((TileEntityTombstone) tileEntityClient); - } - break; - case FlowerPot: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityUniversalFlowerPot) { - return new GuiContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityClient); - } - break; - case AnimalName: - return new GuiAnimalName(world, player, x); - case MobSpawner: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityLimitedMobSpawner) { - return new GuiLimitedMobSpawner((TileEntityLimitedMobSpawner) tileEntityClient); - } - case BrewingStand: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityBrewingBase) { - return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - } - - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/20f51826ceab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/20f51826ceab00141ee9bf3050c1025b new file mode 100644 index 0000000..bd09f64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/20f51826ceab00141ee9bf3050c1025b @@ -0,0 +1,299 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate = 5; + private int stickSpawnRate = 5; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(101); + + if (stickDrop <= stickSpawnRate) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(101) <= bugReleaseRate) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/30702a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/30702a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5528428..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/30702a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.models.ModelPelican; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/30d60da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/30d60da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fa48de0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/30d60da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,91 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/40ca3d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/40ca3d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b65e245..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/40ca3d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRedFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedFinchDeclaration extends SpawnableDeclaration { - - public RedFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/51b81afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/51b81afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4355bd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/51b81afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,196 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.blocks.ModelTombstone; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/616cd8f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/616cd8f7c42100141fce95f06aba7e85 deleted file mode 100644 index b19b0e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/616cd8f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,382 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - //return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - // par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - return AxisAlignedBB.getBoundingBox(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/91f7e5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/91f7e5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f278918..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/91f7e5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.models.ModelMinotaur; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b07e20a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b07e20a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2978a2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b07e20a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,184 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import projectzulu.common.core.RenderHelper; -import projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b154c29dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b154c29dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index df54433..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b154c29dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,138 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelCrocodileHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer MOUTHTOPROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - - public ModelCrocodileHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - CENTERROT.addChild(MOUTHTOPROT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - CENTERROT.addChild(MOUTHBOTROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b1fe5ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b1fe5ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c25e305..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/b1fe5ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c016aef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c016aef9c42100141fce95f06aba7e85 deleted file mode 100644 index 238e105..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c016aef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,111 +0,0 @@ -//package com.ngb.projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -//import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -//import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -//import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -//import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c058a4e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c058a4e4c42100141fce95f06aba7e85 deleted file mode 100644 index 169e1c4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c058a4e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,247 +0,0 @@ -package projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.core.packets.PacketStreamSound; -import projectzulu.common.core.packets.PacketTameParticle; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.mobs.packets.PacketAnimTime; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import projectzulu.common.mobs.packets.PacketNameSync; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c0ddc45dce21001418ceed54b1d01b94 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c0ddc45dce21001418ceed54b1d01b94 deleted file mode 100644 index 729ef1c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/c0ddc45dce21001418ceed54b1d01b94 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d02019a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d02019a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f92608a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d02019a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d04e2401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d04e2401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 47cad4e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/d04e2401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBeige; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/e046a0ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/e046a0ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1a0d38c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/58/e046a0ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,201 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/00070501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/00070501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b5b957..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/00070501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,174 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/002b9f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/002b9f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ab5091a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/002b9f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSlowdown extends SubItemPotionGeneric { - - public SubItemPotionMoveSlowdown(Item itemID, int subID) { - super(itemID, subID, "potion.moveSlowdown"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/104df1ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/104df1ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ac48725..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/104df1ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/109dcba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/109dcba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cfde8a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/109dcba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.core; - - -/** - * For usage see: {@link Pair} - */ -public class PairFullShortName implements Comparable> { - private final K fullName; - private final V shortName; - - public static PairFullShortName createPair(K fullName, V shortName) { - return new PairFullShortName(fullName, shortName); - } - - public PairFullShortName(K fullName, V shortName) { - this.fullName = fullName; - this.shortName = shortName; - } - - public K getFullName() { - return fullName; - } - - public V getShortName() { - return shortName; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairFullShortName)) { return false; } - PairFullShortName pair = (PairFullShortName)object; - return fullName.equals(pair.fullName) && shortName.equals(pair.shortName); - } - - @Override - public int hashCode(){ - return 7 * fullName.hashCode() + 13 * shortName.hashCode(); - } - - @Override - public int compareTo(PairFullShortName otherPair) { - if(otherPair.equals(this)){ - return 0; - }else{ - return this.getShortName().compareTo(otherPair.getShortName()); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/10bef3ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/10bef3ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 29b6a08..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/10bef3ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/2044939fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/2044939fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dea8457..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/2044939fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionDigslowdown extends SubItemPotionHalfPower { - - public SubItemPotionDigslowdown(Item itemID, int subID) { - super(itemID, subID, "Fatique"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/214913ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/214913ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 99f53ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/214913ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.Properties; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/4030e1f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/4030e1f5c42100141fce95f06aba7e85 deleted file mode 100644 index 18bff11..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/4030e1f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/41d141e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/41d141e5c42100141fce95f06aba7e85 deleted file mode 100644 index a4dca28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/41d141e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; -import net.minecraft.util.MathHelper; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/60ec9ff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/60ec9ff6c42100141fce95f06aba7e85 deleted file mode 100644 index 04ac8ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/60ec9ff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/719f3fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/719f3fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dea8457..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/719f3fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionDigslowdown extends SubItemPotionHalfPower { - - public SubItemPotionDigslowdown(Item itemID, int subID) { - super(itemID, subID, "Fatique"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/72de04f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/72de04f9c42100141fce95f06aba7e85 deleted file mode 100644 index 00f15d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/72de04f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/906d92f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/906d92f8c42100141fce95f06aba7e85 deleted file mode 100644 index 8896c13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/906d92f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/90a9fda0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/90a9fda0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6048e32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/90a9fda0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,161 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import scala.annotation.meta.param; - -public class Node implements Comparable { - private Node parent; - private String name; - private List children = new ArrayList(); - - public Node(Node parent, String data) { - this.parent = parent; - parseDataForNode(data); - parseDataForChild(data); - } - - public Node getParent() { - return parent; - } - - public String getName() { - return name; - } - - /** - * Return Node name Concated after the name of its Parent(s) - * - * @return - */ - public String getFullName() { - return prefixParents(name); - } - - private String prefixParents(String name) { - if (parent != null && parent.parent != null && parent.parent.name.equals("root")) { - return parent.prefixParents(parent.name + ":" + name); - } else if (parent != null && !parent.name.equals("root")) { - return parent.prefixParents(parent.name + "." + name); - } else { - return name; - } - } - - public boolean addChild(String data) { - parseDataForChild(data); - return true; - } - - public Node getChild(int index) { - return children.get(index); - } - - public int numberOfChildren() { - return children.size(); - } - - public void sortNodeTree() { - Collections.sort(children); - for (Node child : children) { - child.sortNodeTree(); - } - } - - /** - * Return true if Name is Parsed from Data - */ - private boolean parseDataForNode(String data) { - String[] stringSplitData = data.split("\\.", 2); - this.name = stringSplitData[0]; - return true; - } - - /** - * Return true if Child is added from Data - */ - private boolean parseDataForChild(String data) { - String[] stringSplitData = data.split("\\.", 2); - if (stringSplitData.length < 2) { - return false; - } - String[] stringSplitChild = stringSplitData[1].split("\\.", 2); - - String childName = stringSplitChild[0]; - for (Node child : children) { - if (child.name.equals(childName)) { - child.addChild(stringSplitData[1]); - return true; - } - } - children.add(new Node(this, stringSplitData[1])); - return true; - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - Node otherNode = (Node) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (name == null) { - if (otherNode.name != null) { - return false; - } - } else if (!name.equals(otherNode.name)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } - - @Override - public int compareTo(Node node) { - if (node != null && node.children.size() > 0) { - if (children.size() > 0) { - return this.name.compareTo(node.name); - } else { - return +1; - } - } else if (this.children.size() > 0) { - return -1; - } - return this.name.compareTo(node.name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a214b8ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a214b8ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8384e93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/a214b8ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCoconut; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c155ec9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c155ec9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e235fe4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c155ec9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c1e97cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c1e97cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 593acd9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/c1e97cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; - -public class SlotBrewingStandSinglePotion extends Slot { - /** The player that has this container open. */ - private EntityPlayer player; - - public SlotBrewingStandSinglePotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, - int par5) { - super(par2IInventory, par3, par4, par5); - this.player = par1EntityPlayer; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return canHoldPotion(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 1; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack itemStack) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack)) { - this.player.addStat(AchievementList.potion, 1); - } - - super.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - /** - * Returns true if this itemstack can be filled with a potion - */ - public static boolean canHoldPotion(ItemStack itemStack) { - return itemStack != null - && (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack) || itemStack.getItem() == Items.potionitem - && itemStack.getItemDamage() == 0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e252a9a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e252a9a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 371792d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/59/e252a9a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,81 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBrownBear; -import projectzulu.common.mobs.models.ModelBrownBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/006094ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/006094ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7aff6f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/006094ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,203 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/1048009ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/1048009ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a09c2b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/1048009ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/3102e0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/3102e0e4c42100141fce95f06aba7e85 deleted file mode 100644 index f6e8ace..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/3102e0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40a1e3f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40a1e3f5c42100141fce95f06aba7e85 deleted file mode 100644 index e3751db..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40a1e3f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40d3abf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40d3abf6c42100141fce95f06aba7e85 deleted file mode 100644 index 0f20b98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40d3abf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraftforge.common.config.Configuration; - -public class EntityProperties { - public final float maxHealth; - public final float attackDamage; - public final float moveSpeed; - public final float followRange; - public final float knockbackResistance; - public final float flightChance; - - public EntityProperties(float health, float strength, float moveSpeed) { - this(health, strength, moveSpeed, 0); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance) { - this(health, strength, moveSpeed, flightChance, 0.0f, 32.0f); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance, float knockback, float followRange) { - this.maxHealth = health; - this.attackDamage = strength; - this.moveSpeed = moveSpeed; - this.flightChance = flightChance; - this.knockbackResistance = knockback; - this.followRange = followRange; - } - - public EntityProperties createFromConfig(Configuration config, String entityName) { - float maxHealth = (float) config.get("MOB CONTROLS." + entityName, "maxHealth", this.maxHealth).getDouble( - this.maxHealth); - float attackDamage = (float) config.get("MOB CONTROLS." + entityName, "attackDamage", this.attackDamage) - .getDouble(this.attackDamage); - float moveSpeed = (float) config.get("MOB CONTROLS." + entityName, "moveSpeed", this.moveSpeed).getDouble( - this.moveSpeed); - float flightChance = (float) config.get("MOB CONTROLS." + entityName, "flightChance", this.flightChance) - .getDouble(this.flightChance); - float knockbackResistance = (float) config.get("MOB CONTROLS." + entityName, "knockbackResistance", - this.knockbackResistance).getDouble(this.knockbackResistance); - float followRange = (float) config.get("MOB CONTROLS." + entityName, "followRange", this.followRange) - .getDouble(this.followRange); - return new EntityProperties(maxHealth, attackDamage, moveSpeed, flightChance, knockbackResistance, followRange); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40eaa5e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40eaa5e5c42100141fce95f06aba7e85 deleted file mode 100644 index f342ebb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/40eaa5e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,326 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/4146e7a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/4146e7a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index db8b279..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/4146e7a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,178 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/4176eb9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/4176eb9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e570fa0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/4176eb9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,117 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY == cellHeight - 2) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (piecePos.posY % 2 == 1) { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - private boolean isCorner(ChunkCoordinates piecePos, int cellSize) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) - && (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1)) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "cemeterytomb2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/501d0d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/501d0d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3110f2d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/501d0d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.models.ModelBlackBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/8114caf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/8114caf7c42100141fce95f06aba7e85 deleted file mode 100644 index 2d0ebb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/8114caf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/a037619fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/a037619fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 702d02f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/a037619fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/c1c31ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/c1c31ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7179139..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/c1c31ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,147 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ContainerBrewingStandSingle extends Container { - - private TileEntityBrewingBase tileBrewingStand; - - /** Instance of Slot. */ - private final Slot theSlot; - private int brewTime = 0; - public final int potionSlots; - - public ContainerBrewingStandSingle(InventoryPlayer par1InventoryPlayer, TileEntityBrewingBase brewingStand) { - this.tileBrewingStand = brewingStand; - potionSlots = tileBrewingStand.getSizeInventory() - 1; - int slotID = 0; - if (potionSlots >= 1) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 79, - 53)); - } - - if (potionSlots >= 3) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 56, - 46)); - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, - 102, 46)); - } - this.theSlot = this.addSlotToContainer(new SlotBrewingStandSingleIngredient(this, brewingStand, slotID++, 79, - 17)); - int i; - - /* Add Inventory Slots */ - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - /* Add Hot Bar Slots */ - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - - /** - * Looks for changes made in the container, sends them to every listener. - */ - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.brewTime != this.tileBrewingStand.getBrewTime()) { - icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - } - this.brewTime = this.tileBrewingStand.getBrewTime(); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - if (par1 == 0) { - this.tileBrewingStand.setBrewTime(par2); - } - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - int potionMin = 0; - int potionMax = potionSlots + 1; // 4; - int hotBarMin = potionSlots + 1 + 3 * 9; // 31; - int hotBarMax = potionSlots + 1 + 3 * 9 + 9; // 40; - int inventMin = potionSlots + 1; // 4; - int inventMax = potionSlots + 1 + 3 * 9;// 31; - - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - if ((par2 < 0 || par2 > potionMax)) { - if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) { - if (!this.mergeItemStack(itemstack1, potionMax - 1, potionMax, false)) { - return null; - } - } else if (SlotBrewingStandSinglePotion.canHoldPotion(itemstack)) { - if (!this.mergeItemStack(itemstack1, potionMin, potionMax - 1, false)) { - return null; - } - } else if (par2 >= inventMin && par2 < inventMax) { - if (!this.mergeItemStack(itemstack1, hotBarMin, hotBarMax, false)) { - return null; - } - } else if (par2 >= hotBarMin && par2 < hotBarMax) { - if (!this.mergeItemStack(itemstack1, inventMin, inventMax, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, false)) { - return null; - } - } else { - if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, true)) { - return null; - } - slot.onSlotChange(itemstack1, itemstack); - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - return itemstack; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0d142f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0d142f9c42100141fce95f06aba7e85 deleted file mode 100644 index f806cd0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0d142f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0ff4de8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0ff4de8c42100141fce95f06aba7e85 deleted file mode 100644 index 7bf932f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/d0ff4de8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityGenericAnimal theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityGenericAnimal par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, - //this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); - Vec3.createVectorHelper((double)this.targetEntity.posX, (double)this.targetEntity.posY, (double)this.targetEntity.posZ)); - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/f07934f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/f07934f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5025e37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/f07934f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/f14c03f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/f14c03f8c42100141fce95f06aba7e85 deleted file mode 100644 index 3a27920..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5a/f14c03f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,107 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/104c0001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/104c0001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0338960..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/104c0001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,94 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIPanic extends EntityAIBase { - private EntityGenericCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getEntityState() != EntityStates.fleeing) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/205354f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/205354f8c42100141fce95f06aba7e85 deleted file mode 100644 index 32e05cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/205354f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSlowdown extends SubItemPotionGeneric { - - public SubItemPotionMoveSlowdown(Item itemID, int subID) { - super(itemID, subID, "potion.moveSlowdown"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/314a242bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/314a242bc52100141fce95f06aba7e85 deleted file mode 100644 index f86aa0d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/314a242bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/410052a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/410052a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dbc2fe1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/410052a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/605fdba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/605fdba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4c72756..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/605fdba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,277 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelArmadillo extends ModelBase { - public ModelRenderer WHOLE; - public ModelRenderer HEADPIECE; - public ModelRenderer REARRTR1; - public ModelRenderer REARRTR2; - public ModelRenderer REARRTR3; - - public ModelRenderer leg1; - public ModelRenderer leg2; - public ModelRenderer leg3; - public ModelRenderer leg4; - public ModelRenderer body2; - public ModelRenderer tail; - public ModelRenderer body1; - public ModelRenderer body3; - public ModelRenderer body4; - - public ModelRenderer chin; - public ModelRenderer head; - public ModelRenderer nose; - - public ModelArmadillo() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("WHOLE.dltfold0", 0, 0); - - WHOLE = new ModelRenderer(this, "WHOLE"); - WHOLE.setRotationPoint(0F, 18F, 0F); - // WHOLE.setRotationPoint(0F, 0F, 0F); - WHOLE.mirror = true; - setRotation(WHOLE, 0F, 0F, 0F); - - REARRTR1 = new ModelRenderer(this, "REARRTR1"); - WHOLE.addChild(REARRTR1); - REARRTR1.setRotationPoint(0F, -3F, -2F); - setRotation(REARRTR1, 0F, 0F, 0F); - REARRTR1.mirror = true; - body2 = new ModelRenderer(this, 32, 0); - body2.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR1.addChild(body2); - body2.setRotationPoint(0F, 3F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - REARRTR2 = new ModelRenderer(this, "REARRTR2"); - REARRTR1.addChild(REARRTR2); - REARRTR2.setRotationPoint(0F, -1F, 4F); - setRotation(REARRTR2, 0F, 0F, 0F); - REARRTR2.mirror = true; - body3 = new ModelRenderer(this, 32, 0); - body3.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR2.addChild(body3); - body3.setRotationPoint(0F, 4F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - REARRTR3 = new ModelRenderer(this, "REARRTR3"); - REARRTR2.addChild(REARRTR3); - REARRTR3.setRotationPoint(0F, 0F, 4F); - setRotation(REARRTR3, 0F, 0F, 0F); - REARRTR3.mirror = true; - tail = new ModelRenderer(this, 8, 14); - tail.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); - REARRTR3.addChild(tail); - tail.setRotationPoint(0F, 6F, 4F); - tail.setTextureSize(64, 32); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 32, 0); - body4.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR3.addChild(body4); - body4.setRotationPoint(0F, 4F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(REARRTR3); - // dltfold2.addChildModelRenderer(REARRTR2); - // dltfold0.addChildModelRenderer(REARRTR1); - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - WHOLE.addChild(HEADPIECE); - HEADPIECE.setRotationPoint(0F, 1F, -6F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - nose = new ModelRenderer(this, 12, 9); - nose.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADPIECE.addChild(nose); - nose.setRotationPoint(0F, 2F, -5F); - nose.setTextureSize(64, 32); - nose.mirror = true; - setRotation(nose, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 0); - head.addBox(-2.5F, -2.5F, -1.5F, 5, 5, 3); - HEADPIECE.addChild(head); - head.setRotationPoint(0F, 0F, -1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - chin = new ModelRenderer(this, 0, 8); - chin.addBox(-1.5F, -1.5F, -2.5F, 3, 3, 3); - HEADPIECE.addChild(chin); - chin.setRotationPoint(0F, 1F, -3F); - chin.setTextureSize(64, 32); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - // dltfold0.addChildModelRenderer(HEADPIECE); - body1 = new ModelRenderer(this, 32, 0); - body1.addBox(-4.5F, -4F, -2F, 9, 8, 4); - WHOLE.addChild(body1); - body1.setRotationPoint(0F, 0F, -4F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 15); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg4); - leg4.setRotationPoint(3F, 4F, 5F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 15); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg3); - leg3.setRotationPoint(-3F, 4F, 5F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 0, 15); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg2); - leg2.setRotationPoint(3F, 4F, -4F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 15); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg1); - leg1.setRotationPoint(-3F, 4F, -4F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // Something Should GO here - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - WHOLE.render(f5); - GL11.glPopMatrix(); - } else { - WHOLE.render(f5); - } - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - EntityArmadillo var5 = (EntityArmadillo) par7Entity; - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateX(+0.05f * 2.0f, 0f, (float) (145 * Math.PI / 180f)); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - // HEADPIECE.rotateAngleX = - // var5.eHEADPIECE.rotateX(-0.05f*animSpeed,0f,(float)(145*Math.PI/180f)); - this.HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateAngleX = Math.min(Math.max(par5, -180), +180) - * (float) (Math.PI / 180f); - this.HEADPIECE.rotateAngleY = var5.eHEADPIECE.rotateAngleY = Math.min(Math.max(par4, -30), +30) - * (float) (Math.PI / 180f); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityArmadillo var5 = (EntityArmadillo) par1EntityLiving; - - if (var5.eWHOLE.isSetup == false) { - var5.eWHOLE.setup(WHOLE); - } - if (var5.eHEADPIECE.isSetup == false) { - var5.eHEADPIECE.setup(HEADPIECE); - } - if (var5.eREARRTR1.isSetup == false) { - var5.eREARRTR1.setup(REARRTR1); - } - if (var5.eREARRTR2.isSetup == false) { - var5.eREARRTR2.setup(REARRTR2); - } - if (var5.eREARRTR3.isSetup == false) { - var5.eREARRTR3.setup(REARRTR3); - } - if (var5.etail.isSetup == false) { - var5.etail.setup(tail); - } - if (var5.eleg3.isSetup == false) { - var5.eleg3.setup(leg3); - } - if (var5.eleg4.isSetup == false) { - var5.eleg4.setup(leg4); - } - - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - float animSpeed = 2.0f; - if (var5.isCharging() == true) { - animSpeed = 5.0f; - /* Make Complete Body Circle */ - if (var5.eWHOLE.rotateAngleX == (float) ((390 + 360) * Math.PI / 180f)) { - var5.eWHOLE.rotateAngleX -= 360 * Math.PI / 180; - } - WHOLE.rotateAngleX = var5.eWHOLE - .rotateX(+0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - } else { - animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(+0.09f * animSpeed, 0f, (float) (390 * Math.PI / 180f)); - } - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(+0.1f, (float) (0 * Math.PI / 180f), (float) (90 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(-0.5f * animSpeed, 2.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(-0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(-0.5f * animSpeed, -4f, 4f); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - float animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(-0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - /* Rotate Face Inward */ - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(-0.1f * animSpeed, (float) (-15 * Math.PI / 180f), - (float) (30 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(+0.5f * animSpeed, 0.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(+0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(+0.5f * animSpeed, -4f, 4f); - - leg1.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg2.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - leg3.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg4.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/6067459ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/6067459ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e90310d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/6067459ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,120 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/606d9801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/606d9801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8017bb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/606d9801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/607ecae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/607ecae4c42100141fce95f06aba7e85 deleted file mode 100644 index feb0740..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/607ecae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,577 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/724d2ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/724d2ce5c42100141fce95f06aba7e85 deleted file mode 100644 index 5ea5b20..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/724d2ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,353 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - 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(vec3, vec31); - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80b01fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80b01fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 003fa0a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/80b01fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/81ab8be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/81ab8be5c42100141fce95f06aba7e85 deleted file mode 100644 index d325bf3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/81ab8be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,198 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -public class ModelCentipede extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelCentipede() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - sidebody2.render(f5); - body.render(f5); - sidebody3.render(f5); - sidebody1.render(f5); - ANTENLEFROT1.render(f5); - ANTENRIGROT1.render(f5); - LEG11ROT.render(f5); - LEG21ROT.render(f5); - LEG31ROT.render(f5); - LEG41ROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - - ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/822125e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/822125e5c42100141fce95f06aba7e85 deleted file mode 100644 index bc46923..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/822125e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a123949ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a123949ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 926f898..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/a123949ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b03652f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b03652f5c42100141fce95f06aba7e85 deleted file mode 100644 index 173c24f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b03652f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b1deb3f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b1deb3f5c42100141fce95f06aba7e85 deleted file mode 100644 index 142734b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/b1deb3f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/c18c34ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/c18c34ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e9eee3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/c18c34ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d0de43f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d0de43f5c42100141fce95f06aba7e85 deleted file mode 100644 index 541e36f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d0de43f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,213 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d15ba9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d15ba9f9c42100141fce95f06aba7e85 deleted file mode 100644 index c37bc1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/d15ba9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/e0c609f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/e0c609f6c42100141fce95f06aba7e85 deleted file mode 100644 index 6697240..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/e0c609f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/f149acfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/f149acfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 634f73c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5b/f149acfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,404 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10f734fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10f734fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2d54d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/10f734fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/204913ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/204913ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 12d5690..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/204913ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.BossHealthDisplayTicker; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/301d0cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/301d0cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c5fb7f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/301d0cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/309b7ce6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/309b7ce6c42100141fce95f06aba7e85 deleted file mode 100644 index e3884bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/309b7ce6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40bf539ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40bf539ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9eef49..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/40bf539ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,126 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.base.Optional; - -public class OptionalItemStack { - enum OptionalType { - BLOCK, ITEM, OREDIC; - } - - private OptionalType type = OptionalType.BLOCK; - private Optional itemBlock; - private int meta; - private int stackSize; - - public OptionalItemStack(Optional itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - - if (itemBlock.isPresent()) { - if (itemBlock.get() instanceof Item) { - type = OptionalType.ITEM; - } else if (itemBlock.get() instanceof Block) { - type = OptionalType.BLOCK; - } else if (itemBlock.get() instanceof String) { - type = OptionalType.OREDIC; - } - } else { - itemBlock = Optional.absent(); - } - } - - /* Item */ - public OptionalItemStack(Item itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.ITEM); - } - - /* Block */ - public OptionalItemStack(Block itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.BLOCK); - } - - /* Ore Dictionary String */ - public OptionalItemStack(String itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.OREDIC); - } - - /** Optional Parameter With Supplied Type */ - public OptionalItemStack(Optional itemBlock, OptionalType type) { - this(itemBlock, 1, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, OptionalType type) { - this(itemBlock, stackSize, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta, OptionalType type) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - this.type = type; - } - - public boolean isPresent() { - return itemBlock != null && itemBlock.isPresent(); - } - - public ItemStack createItemStack() { - switch (type) { - case BLOCK: - return new ItemStack((Block) (itemBlock.get()), stackSize, meta); - case ITEM: - return new ItemStack((Item) (itemBlock.get()), stackSize, meta); - default: - throw new IllegalStateException("Cannot create ItemStack for OptionalType"); - } - } - - public Object createRecipeObject() { - switch (type) { - case BLOCK: - case ITEM: - return createItemStack(); - case OREDIC: - return itemBlock.get(); - default: - throw new IllegalStateException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/509fafa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/509fafa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8e0e390..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/509fafa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.world2; - -import java.util.EnumSet; -import java.util.Random; - -/** - * Two Dimensional Direction - */ -public enum Direction { - /* U = Up, D = Down, L = Left, R = Right */ - U(0, 0, 1), D(1, 0, -1), L(2, 1, 0), R(3, -1, 0), UL(4, 1, 1), UR(5, -1, 1), DL(6, 1, -1), DR(7, -1, -1); - - public final int x; - public final int z; - public final int id; - - Direction(int id, int x, int z) { - this.id = id; - this.x = x; - this.z = z; - } - - public static final Direction[] invert = { D, U, R, L, DR, DL, UR, UL }; - public static final Direction[] cwRotation = { UR, DL, UL, DR, U, R, L, D }; - public static final Direction[] ccwRotation = { UL, DR, DL, UR, L, U, D, R }; - - public Direction invert() { - return invert[id]; - } - - /* Rotate Direction by an Ordinal either Clockwise or CounterClockwise */ - public Direction rotateOrdinal(boolean clockwise) { - return clockwise ? cwRotation[id] : ccwRotation[id]; - } - - public static Direction getCardinal(Random random) { - return getCardinal(random.nextInt(4)); - } - - public static Direction getCardinal(int id) { - id = id & 3; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getCardinals() { - return EnumSet.of(U, D, L, R); - } - - public static Direction getOrdinal(Random random) { - return getOrdinal(random.nextInt(8)); - } - - public static Direction getOrdinal(int id) { - id = id & 7; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getOrdinals() { - return EnumSet.of(U, D, L, R, UL, UR, DL, DR); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/5118a7f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/5118a7f6c42100141fce95f06aba7e85 deleted file mode 100644 index fcf9035..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/5118a7f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraft.world.biome.BiomeGenBase; - -public class SpawnEntry { - public final BiomeGenBase biome; - public final int spawnRate; - public final int minInChunk; - public final int maxInChunk; - public SpawnEntry(BiomeGenBase biome, int spawnRate, int minInChunk, int maxInChunk) { - this.biome = biome; - this.spawnRate = spawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/60be4c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/60be4c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 857ce28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/60be4c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,178 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/71a4d6a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/71a4d6a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 175f5ce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/71a4d6a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.models.ModelSandWorm; -import projectzulu.common.mobs.renders.RenderGenericIdle; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/819133a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/819133a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c4a496..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/819133a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/905a8501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/905a8501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 804f521..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/905a8501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/a194969ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/a194969ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 88bb27a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/a194969ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,109 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/b0d6bea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/b0d6bea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 670fdc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/b0d6bea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d0a411f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d0a411f8c42100141fce95f06aba7e85 deleted file mode 100644 index 28a4148..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d0a411f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,147 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d0a651fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d0a651fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 717cec4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/d0a651fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,91 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/e1967aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/e1967aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b829ba7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/e1967aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,60 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f103b9f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f103b9f4c42100141fce95f06aba7e85 deleted file mode 100644 index 0e5b448..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f103b9f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import net.minecraft.potion.Potion; - -public class ZuluPotionHelper{ - public static void setVanillaPotionProperties() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ - Potion potionToEdit = Potion.potionTypes[Potion.blindness.getId()]; - Method[] potionMethods = potionToEdit.getClass().getDeclaredMethods(); - int doubleCounter = 0; - for (int i = 0; i < potionMethods.length; i++) { - /* Look for setEffectiveness : It has 1 Parameter and it is a double : No other method fits that criteria */ - if(potionMethods[i].getParameterTypes().length == 1 && (potionMethods[i].getParameterTypes())[0].toString().equals("double")){ - potionMethods[i].setAccessible(true); - potionMethods[i].invoke(potionToEdit, 0.03D); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f1ab71a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f1ab71a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f1be10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5c/f1ab71a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/0115f3e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/0115f3e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2347779..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/0115f3e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.NBTWriter; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/112244f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/112244f4c42100141fce95f06aba7e85 deleted file mode 100644 index fdaff19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/112244f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public abstract class BPOasisEdge implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - List flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/305751f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/305751f6c42100141fce95f06aba7e85 deleted file mode 100644 index d5842c3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/305751f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,144 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/309a8ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/309a8ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 08b2311..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/309a8ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/313670ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/313670ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b1d49e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/313670ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public abstract class BPOasisEdge implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - List flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/5054bc2c8e2100141bd6a937048980ed b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/5054bc2c8e2100141bd6a937048980ed deleted file mode 100644 index 96f592f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/5054bc2c8e2100141bd6a937048980ed +++ /dev/null @@ -1,357 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/619927f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/619927f4c42100141fce95f06aba7e85 deleted file mode 100644 index 206726f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/619927f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import com.ngb.projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/802da3a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/802da3a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5feb479..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/802da3a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.blocks.util.StringHelper; -import projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/80be8ff2c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/80be8ff2c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6abb50e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/80be8ff2c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,359 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - - //vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/914731a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/914731a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3ba720..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/914731a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/916fd2fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/916fd2fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3b5ea1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/916fd2fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.models.ModelFollower; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/b195c09fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/b195c09fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f1be10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/b195c09fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/c0d258fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/c0d258fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 371b5cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/c0d258fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/c16156fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/c16156fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0bdd49b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/c16156fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/e0cb159ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/e0cb159ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1e1c78c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5d/e0cb159ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/004403a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/004403a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d6fbe83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/004403a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.util.Random; - -import projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/011c65f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/011c65f8c42100141fce95f06aba7e85 deleted file mode 100644 index f81160c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/011c65f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/11e454e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/11e454e5c42100141fce95f06aba7e85 deleted file mode 100644 index c2503ef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/11e454e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,174 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/215354f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/215354f8c42100141fce95f06aba7e85 deleted file mode 100644 index a45c23c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/215354f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/4135ed9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/4135ed9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 262ff54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/4135ed9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/7034c8e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/7034c8e4c42100141fce95f06aba7e85 deleted file mode 100644 index 6f34a22..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/7034c8e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.dungeon.BlockLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/717a5de6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/717a5de6c42100141fce95f06aba7e85 deleted file mode 100644 index b4ee220..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/717a5de6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/801e6d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/801e6d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bd79ea2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/801e6d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/905f33a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/905f33a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3dfa0d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/905f33a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/a091c3a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/a091c3a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7a14c74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/a091c3a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseWhite; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/c0f053fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/c0f053fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee5ef75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/c0f053fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0491d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0491d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d7e4fa8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5e/f0491d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGiraffe; -import projectzulu.common.mobs.models.ModelGiraffe; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30ac1cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30ac1cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 7421432..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30ac1cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30c580f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30c580f9c42100141fce95f06aba7e85 deleted file mode 100644 index a13a899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/30c580f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/504f77f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/504f77f9c42100141fce95f06aba7e85 deleted file mode 100644 index df8b132..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/504f77f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,91 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/62235dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/62235dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 59b8523..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/62235dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,240 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/706d02f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/706d02f9c42100141fce95f06aba7e85 deleted file mode 100644 index 2130a59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/706d02f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,114 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/70e8a7a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/70e8a7a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d0d6dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/70e8a7a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.core; - -public class DefaultProps { - - /* ModIDs, Dependencies, and Version */ - public static final String DesiredBefore = "after:ExtrabiomesXL@"; - public static final String VERSION_STRING = "1.1.7.3"; - public static final String CoreModId = "ProjectZulu|Core"; - public static final String BlocksModId = "ProjectZulu|Block"; - public static final String MobsModId = "ProjectZulu|Mob"; - public static final String WorldModId = "ProjectZulu|World"; - public static final String DungeonModId = "ProjectZulu|Dungeon"; - public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; - - /* Packet Channels */ - public static final String defaultChannel = "Channel_Zulu"; - - /* Module Directory Keys */ - public static final String coreKey = "projectzulucore"; - public static final String mobKey = "projectzulumob"; - public static final String blockKey = "projectzulublock"; - public static final String worldKey = "projectzuluworld"; - public static final String dungeonKey = "projectzuludungeon"; - - /* Module Resource Directories */ - public static final String coreDiretory = "/mods/" + coreKey + "/"; - public static final String mobDiretory = "/mods/" + mobKey + "/"; - public static final String blockDiretory = "/mods/" + blockKey + "/"; - public static final String worldDiretory = "/mods/" + worldKey + "/"; - public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; - public static final String entitySoundDir = "mob/"; - public static final String entitySounds = entitySoundDir.replace("/", "."); - - /* Common Resource Sub-Directories */ - public static final String itemSubDir = "textures/blocks/"; - public static final String blockSubDir = "textures/blocks/"; -// public static final String blockSpriteSheet = blockDiretory + "blocks_projectzulu.png"; // TODO: Delete -// public static final String itemSpriteSheet = blockDiretory + "items_projectzulu.png"; // TODO: Delete - - /* Config Directories */ - public static final String configDirectory = "/Project Zulu/"; - public static final String customResourcesDirectory = "CustomResources/"; - public static final String streamingResourcesDirectory = "streaming/"; - public static final String soundResourcesDirectory = "sound/"; - public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; - public static final String moduleConfigFile = "ProjectZuluModules.cfg"; - public static final String tempConfigFile = "tempSettingsConfig.cfg"; - public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; - public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/806cc6ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/806cc6ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 76531c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/806cc6ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.heads.BlockMobHeads; -import projectzulu.common.blocks.heads.ItemMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/8178cfa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/8178cfa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5528428..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/8178cfa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.models.ModelPelican; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/a0282b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/a0282b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d3022d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/a0282b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/b0e3bf9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/b0e3bf9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5cfabb3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/b0e3bf9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBeaverHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBeaverHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 0F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 2F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 2F, -5F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/c03c13f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/c03c13f6c42100141fce95f06aba7e85 deleted file mode 100644 index 66cb450..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/c03c13f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e2a528ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e2a528ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a68362..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/5f/e2a528ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/00f4caf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/00f4caf6c42100141fce95f06aba7e85 deleted file mode 100644 index 1a3d0c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/00f4caf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,196 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.blocks.ModelTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/21474be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/21474be5c42100141fce95f06aba7e85 deleted file mode 100644 index 4282098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/21474be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,25 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Comparator; - -import net.minecraft.entity.Entity; -public class EntityAINearestAttackableTargetSorter implements Comparator{ - private Entity theEntity; - - final EntityAINearestAttackableTarget parent; - - public EntityAINearestAttackableTargetSorter(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, Entity par2Entity){ - this.parent = par1EntityAINearestAttackableTarget; - this.theEntity = par2Entity; - } - - public int compareDistanceSq(Entity par1Entity, Entity par2Entity){ - double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); - double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - - public int compare(Object par1Obj, Object par2Obj){ - return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/300b92fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/300b92fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 073e1b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/300b92fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,121 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/3087afe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/3087afe5c42100141fce95f06aba7e85 deleted file mode 100644 index 500597d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/3087afe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,1046 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/50b6daf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/50b6daf7c42100141fce95f06aba7e85 deleted file mode 100644 index 9359599..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/50b6daf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,264 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/a150c59fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/a150c59fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2039367..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/a150c59fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericLimited; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/c01117fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/c01117fac42100141fce95f06aba7e85 deleted file mode 100644 index bea983d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/c01117fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import com.ngb.projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import com.ngb.projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/c0b87401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/c0b87401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 972f773..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/c0b87401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionBlindness; -import projectzulu.common.potion.subitem.SubItemPotionBubbling; -import projectzulu.common.potion.subitem.SubItemPotionCleansing; -import projectzulu.common.potion.subitem.SubItemPotionCurse; -import projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import projectzulu.common.potion.subitem.SubItemPotionJump; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionResistance; -import projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import projectzulu.common.potion.subitem.SubItemPotionThorns; -import projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d15616a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d15616a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 60f6790..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/d15616a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,203 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/e073779ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/e073779ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6f34a22..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6/e073779ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.dungeon.BlockLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/002e54a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/002e54a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 880a9b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/002e54a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/4044aef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/4044aef6c42100141fce95f06aba7e85 deleted file mode 100644 index 8795cd8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/4044aef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/60b50f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/60b50f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c346ba6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/60b50f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPolarBear; -import projectzulu.common.mobs.models.ModelPolarBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/90797100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/90797100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6096b28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/90797100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a1965aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a1965aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d91deb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/a1965aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,241 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Reminder: This is technically a 'Flying' Entity - */ -public class EntityFollower extends EntityLiving { - - EntityMaster masterEntity; - int followerIndex = -1; - - public int getFollowerIndex() { - return followerIndex; - } - - private Vec3 targetPosition = Vec3.createVectorHelper(0, 0, 0); - - public void setTargetPosition(Vec3 targetPosition) { - this.targetPosition = targetPosition; - } - - float targetRotation; - - public void setTargetRotation(float targetRotation) { - this.targetRotation = wrapAngleTo360(targetRotation); - } - - boolean shouldBeDying = false; - - /* Client Side Variable that Controls if it should Sync its Contents with Client Master */ - boolean isClientSetup = false; - - public EntityFollower(World par1World) { - super(par1World); - noClip = true; - setSize(0.65f, 0.5f); - } - - public EntityFollower(World par1World, double parx, double pary, double parz, EntityMaster masterEntity, - int followerIndex) { - this(par1World); - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.followerIndex = followerIndex; - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns False so that Entity doesn't Suffocate while in a wall - */ - @Override - public boolean isEntityInsideOpaqueBlock() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - - /* - * Note that the Client Side Entity will exists for several ticks before the masterEntity is Synced from server, - * So we only Check if should SetDead on Server - * - * Also, onReload, the Server will re-create its Children, this the old Children must dye. - */ - if (masterEntity == null && ticksExisted > 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/b006c39fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/b006c39fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cdc1250..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/b006c39fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprint.cathedral.BPSetCathedral; - -public class ArchitectCathedral extends ArchitectBase { - - public ArchitectCathedral(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetCathedral()); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - set = stockpile.getRandomApplicable(cells, buildCoords); - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c1341ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c1341ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 59a1459..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c1341ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.HashMap; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class PotionIngredients { - - public static interface IngredientProperty { - public abstract boolean isIngredient(ItemStack ingredient); - } - - public static class OverrideIngredient implements IngredientProperty { - boolean isIngredient = true; - - @Override - public boolean isIngredient(ItemStack ingredient) { - return isIngredient; - } - } - - private static HashMap ingredientProperties = new HashMap(); - - static { - addIngredientProperties(Items.feather, new OverrideIngredient()); - } - - public static void addIngredientProperties(Item item, IngredientProperty ingredientProperty) { - ingredientProperties.put(item, ingredientProperty); - } - - public static boolean isPotionIngredient(ItemStack ingredient) { - if (ingredient == null) { - return false; - } - - IngredientProperty property = ingredientProperties.get(ingredient.getItem()); - if (property != null) { - return property.isIngredient(ingredient); - } else { - return ingredient != null ? ingredient.getItem().isPotionIngredient(ingredient) : false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c1d1d801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c1d1d801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3061b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/c1d1d801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f0a56101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f0a56101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5072cb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f0a56101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f1b3db9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f1b3db9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 97fffc4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/60/f1b3db9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,102 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/10ded0fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/10ded0fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a80bccf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/10ded0fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAloeVeraSeeds; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/11cafca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/11cafca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8106577..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/11cafca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,524 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/3161f49dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/3161f49dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cadc94..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/3161f49dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.heads.BlockMobHeads; -import projectzulu.common.blocks.heads.ItemMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/31eb5a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/31eb5a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cfde8a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/31eb5a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.core; - - -/** - * For usage see: {@link Pair} - */ -public class PairFullShortName implements Comparable> { - private final K fullName; - private final V shortName; - - public static PairFullShortName createPair(K fullName, V shortName) { - return new PairFullShortName(fullName, shortName); - } - - public PairFullShortName(K fullName, V shortName) { - this.fullName = fullName; - this.shortName = shortName; - } - - public K getFullName() { - return fullName; - } - - public V getShortName() { - return shortName; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairFullShortName)) { return false; } - PairFullShortName pair = (PairFullShortName)object; - return fullName.equals(pair.fullName) && shortName.equals(pair.shortName); - } - - @Override - public int hashCode(){ - return 7 * fullName.hashCode() + 13 * shortName.hashCode(); - } - - @Override - public int compareTo(PairFullShortName otherPair) { - if(otherPair.equals(this)){ - return 0; - }else{ - return this.getShortName().compareTo(otherPair.getShortName()); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50de92f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50de92f4c42100141fce95f06aba7e85 deleted file mode 100644 index ff1e27a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/50de92f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import net.minecraft.util.WeightedRandom; - -public class EntityEntry extends WeightedRandom.Item { - - public final String entityname; - - public EntityEntry(String entityname, int spawnWeight) { - super(spawnWeight); - if (entityname == null || entityname.trim() == "") { - throw new IllegalArgumentException("Entity Name Cannot be " + entityname == null ? "null" : "blank"); - } - this.entityname = entityname.trim(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/708666f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/708666f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5a9b49b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/708666f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/7093dc9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/7093dc9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c87ec0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/7093dc9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAloeVeraSeeds; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/71ca37f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/71ca37f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1edf044..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/71ca37f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; - -/* Helper Class to contain both BlockID and Meta in a single Structure */ -public class BlockWithMeta extends WeightedRandom.Item { - public final Block block; - public final int meta; - - public BlockWithMeta(Block block) { - this(block, 0); - } - - public BlockWithMeta(Block block, int meta) { - this(block, meta, 1); - } - - public BlockWithMeta(Block block, int meta, int weight) { - super(weight); - this.block = block; - this.meta = meta; - } - - /** - * Helper Function to Place Block/TileEntity/Spawner. Overridden in child to make use of specific knowledge, i.e. A - * Chests Loot Chance - */ - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (block != null) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/81ee68a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/81ee68a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d67559e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/81ee68a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/829e30f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/829e30f8c42100141fce95f06aba7e85 deleted file mode 100644 index f231022..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/829e30f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/913364a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/913364a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2936a7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/913364a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,309 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/a00f2100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/a00f2100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89bba5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/a00f2100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/b07c5c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/b07c5c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e280e25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/b07c5c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.mobs.models; -//package projectzulu.common.mobs; -// -//import net.minecraft.src.Entity; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.MathHelper; -//import net.minecraft.src.ModelBase; -//import net.minecraft.src.ModelRenderer; -// -//public class ModelZulu extends ModelBase -//{ -// -// public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.render(entity, f, f1, f2, f3, f4, f5); -// setRotationAngles(f, f1, f2, f3, f4, f5); -// if(this.isChild){ -// HEADROT.render(f5); -// BODYROT.render(f5); -// } -// -// } -// public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.setRotationAngles(f, f1, f2, f3, f4, f5); -// } -// -// -// -// @Override -// public void setLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4) { -// super.setLivingAnimations(par1EntityLiving, par2, par3, par4); -// } -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d129e59ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d129e59ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 808036c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/d129e59ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/e07bddf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/e07bddf4c42100141fce95f06aba7e85 deleted file mode 100644 index e05ad86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/e07bddf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/f1f791e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/f1f791e6c42100141fce95f06aba7e85 deleted file mode 100644 index c27af5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/61/f1f791e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public abstract class BPOasisEdge implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - List flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/01f603a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/01f603a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 702d02f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/01f603a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketTileText extends PacketByteStream { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/11e19c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/11e19c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index df7e593..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/11e19c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30298dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30298dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 495fc3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30298dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30fa1bf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30fa1bf7c42100141fce95f06aba7e85 deleted file mode 100644 index 99dd85f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/30fa1bf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockNightBloom; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/412d83a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/412d83a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bec4df7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/412d83a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/41b5b0f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/41b5b0f6c42100141fce95f06aba7e85 deleted file mode 100644 index 0bdcd32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/41b5b0f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/520aa201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/520aa201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 02993e4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/520aa201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/80c137a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/80c137a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b05e6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/80c137a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelRhinoHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelRhinoHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 18F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/a1d2c8fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/a1d2c8fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3110f2d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/a1d2c8fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.models.ModelBlackBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b10e12e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b10e12e5c42100141fce95f06aba7e85 deleted file mode 100644 index 9e2694c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b10e12e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,121 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b190b4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b190b4f7c42100141fce95f06aba7e85 deleted file mode 100644 index 4ba4adc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b190b4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelFoxHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFoxHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b19878e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b19878e5c42100141fce95f06aba7e85 deleted file mode 100644 index 68cee4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/b19878e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMummy; -import projectzulu.common.mobs.models.ModelMummy; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e08565e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e08565e5c42100141fce95f06aba7e85 deleted file mode 100644 index 3581d16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e08565e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.models.ModelFox; -import projectzulu.common.mobs.renders.RenderTameable; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e0b11a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e0b11a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4670445..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e0b11a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.models.ModelFox; -import projectzulu.common.mobs.renders.RenderTameable; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e27fe1fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e27fe1fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6fd8db0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/e27fe1fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f1b1fce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f1b1fce4c42100141fce95f06aba7e85 deleted file mode 100644 index 41748eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/62/f1b1fce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,321 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/11d7fd9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/11d7fd9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 72fb9ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/11d7fd9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockQuickSand; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/2071c4a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/2071c4a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3a3f71c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/2071c4a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,111 +0,0 @@ -//package projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import projectzulu.common.core.packets.PacketPlaySound; -//import projectzulu.common.core.packets.PacketStreamSound; -//import projectzulu.common.dungeon.packets.PacketMobSpawner; -//import projectzulu.common.mobs.packets.PacketAnimTime; -//import projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/20d823f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/20d823f9c42100141fce95f06aba7e85 deleted file mode 100644 index 66af19b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/20d823f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/40ad46fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/40ad46fac42100141fce95f06aba7e85 deleted file mode 100644 index e4043cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/40ad46fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,230 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/415d12f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/415d12f7c42100141fce95f06aba7e85 deleted file mode 100644 index 474903d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/415d12f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockZuluSlab; -import com.ngb.projectzulu.common.blocks.ItemZuluSlab; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/5042f200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/5042f200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 42a62b3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/5042f200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - /** The PathNavigate of our entity. */ - EntityLivingBase entityPathNavigate; - int fleeChance = 0; - /** Task Owner in the form of out Generic Creature, used to access Specialized information, such as Anger or EntityState */ - EntityGenericCreature genericTaskOwner; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityLiving, boolean shouldCallAllies, boolean shouldCheckSight) { - super(par1EntityLiving, 16.0F, shouldCheckSight); - this.shouldCallAllies = shouldCallAllies; - this.setMutexBits(1); - this.genericTaskOwner = par1EntityLiving; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.isSuitableTarget(this.taskOwner.getAITarget(), false); - - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return shouldExecute(); -// return this.taskOwner.getAITarget() != null && this.taskOwner.getAITarget() != this.entityPathNavigate; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.entityPathNavigate = this.taskOwner.getAITarget(); - - if (this.shouldCallAllies){ - List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - Iterator var2 = var1.iterator(); - - while (var2.hasNext()){ - EntityLiving var3 = (EntityLiving)var2.next(); - - if (this.taskOwner != var3 && var3.getAttackTarget() == null){ - var3.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - super.startExecuting(); - } - - @Override - public void updateTask() { - startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/507609f83620001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/507609f83620001413909a661a93f408 deleted file mode 100644 index 0ebbe97..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/507609f83620001413909a661a93f408 +++ /dev/null @@ -1,43 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone }); - - GameRegistry.addRecipe(new ItemStack(Items.dye, 2, 15), new Object[]{ - "AB ", - "AAC", - "A ", - 'A', Blocks.cobblestone, 'B', Blocks.dirt, 'C', new ItemStack(Items.dye, 1, 1) - }); - - GameRegistry.addRecipe(new ItemStack(Item.diamond, 2), new Object[] { - "DDD", "DDD", "DDD", 'D', Blocks.dirt }); - - GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 2, 1), new Object[] - { - new ItemStack(Items.dye, 1, 1), Items.apple - }); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/5168dbf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/5168dbf9c42100141fce95f06aba7e85 deleted file mode 100644 index 3edb61f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/5168dbf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/6032aaa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/6032aaa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 680b206..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/6032aaa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/61f463e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/61f463e4c42100141fce95f06aba7e85 deleted file mode 100644 index 6f198ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/61f463e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,22 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/70549ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/70549ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 77cea2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/70549ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,169 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/71686bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/71686bf9c42100141fce95f06aba7e85 deleted file mode 100644 index 5f75eee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/71686bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/8083f1e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/8083f1e3c42100141fce95f06aba7e85 deleted file mode 100644 index dffc281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/8083f1e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,380 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/9022f5f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/9022f5f4c42100141fce95f06aba7e85 deleted file mode 100644 index ba2c45d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/9022f5f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -public class PotionThorns extends PotionZulu { - - public PotionThorns(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/c0bca9ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/c0bca9ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 61659bd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/c0bca9ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/f115a89dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/f115a89dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 60f6790..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/63/f115a89dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,203 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009ca19fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009ca19fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 62e8ae8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/009ca19fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/10ef54b1302000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/10ef54b1302000141dbfc2e92eb0e949 deleted file mode 100644 index bc918c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/10ef54b1302000141dbfc2e92eb0e949 +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.examplemod; - -import net.minecraft.init.Blocks; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulMod1.MODID, version = SoulMod1.VERSION) -public class SoulMod1 -{ - public static final String MODID = "SoulMod1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - // some example code - System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/31898e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/31898e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index db2dc74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/31898e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50e329f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50e329f4c42100141fce95f06aba7e85 deleted file mode 100644 index 516e241..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/50e329f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.Random; - -import com.ngb.projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/5240b6a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/5240b6a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8f0ac59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/5240b6a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraft.world.biome.BiomeGenBase; - -public class SpawnEntry { - public final BiomeGenBase biome; - public final int spawnRate; - public final int minInChunk; - public final int maxInChunk; - public SpawnEntry(BiomeGenBase biome, int spawnRate, int minInChunk, int maxInChunk) { - this.biome = biome; - this.spawnRate = spawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/70a7a99ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/70a7a99ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 53e4882..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/70a7a99ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,206 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/80a8d39fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/80a8d39fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5311cea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/80a8d39fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/81b2fdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/81b2fdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 505a6c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/81b2fdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,157 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/90d70801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/90d70801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 76fe4bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/90d70801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/912e76f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/912e76f4c42100141fce95f06aba7e85 deleted file mode 100644 index d85b40b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/912e76f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthRandomWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if ((piecePos.posY == 0)) {// || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0c916e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0c916e5c42100141fce95f06aba7e85 deleted file mode 100644 index 7ef83f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/a0c916e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,149 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/b1dc49e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/b1dc49e4c42100141fce95f06aba7e85 deleted file mode 100644 index d1d3b1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/b1dc49e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreePlank; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c03d04f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c03d04f5c42100141fce95f06aba7e85 deleted file mode 100644 index ca0cf7c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c03d04f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingSingle extends TileEntityBrewingBase { - - public TileEntityBrewingSingle() { - brewingItemStacks = new ItemStack[2]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c1ad15f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c1ad15f6c42100141fce95f06aba7e85 deleted file mode 100644 index 491b3c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/c1ad15f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/d0226fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/d0226fe5c42100141fce95f06aba7e85 deleted file mode 100644 index e1f8c30..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/d0226fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/d17eb0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/d17eb0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 10d0405..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/d17eb0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.models.ModelEagle; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/e15fa6f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/e15fa6f7c42100141fce95f06aba7e85 deleted file mode 100644 index 3dde31b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/e15fa6f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemAloeVera extends ItemBlock { - - public ItemAloeVera(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "base_1"; - break; - } - case 1: { - name = "base_2"; - break; - } - case 2: { - name = "base_3"; - break; - } - case 3: { - name = "base_4"; - break; - } - case 4: { - name = "flower_1"; - break; - } - case 5: { - name = "flower_2"; - break; - } - case 6: { - name = "flower_3"; - break; - } - case 7: { - name = "flower_4"; - break; - } - case 8: { - name = "flower_5"; - break; - } - default: - name = "base_1"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/f021b4f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/f021b4f4c42100141fce95f06aba7e85 deleted file mode 100644 index cd4fd53..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/64/f021b4f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import com.ngb.projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/00943efec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/00943efec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index fd0b56c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/00943efec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/108e91f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/108e91f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5d8846b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/108e91f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/10b5e7f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/10b5e7f4c42100141fce95f06aba7e85 deleted file mode 100644 index 5946778..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/10b5e7f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionHarm; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionHeal; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionNightVision; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionPoison; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/30ff279fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/30ff279fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4af4a31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/30ff279fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.models.ModelMinotaur; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/318c46e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/318c46e5c42100141fce95f06aba7e85 deleted file mode 100644 index c7b234d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/318c46e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,157 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/41c5a601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/41c5a601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 71d72ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/41c5a601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public interface Blueprint { - - /** - * - * @param pieceLoc X,Y,Z Coordinate of Piece within Cell - * @param cellSize - * @param maxHeight - * @param xIndex - * @param zIndex - * @param random - * @param cellIndexDirection - * @return - */ - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection); - - /** - * Used to Search Architect list for a specific Building Type - * - * Type insensitive. Should be unique. - */ - public abstract String getIdentifier(); - - public abstract int getWeight(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/5136179fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/5136179fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 46de0af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/5136179fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGreenFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/517fd9ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/517fd9ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d8e74f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/517fd9ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockTumbleweed; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class TumbleweedDeclaration extends BlockDeclaration { - - public TumbleweedDeclaration() { - super("Tumbleweed"); - } - - @Override - protected boolean createBlock() { - BlockList.tumbleweed = Optional.of((new BlockTumbleweed()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tumbleweed.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/519fb6fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/519fb6fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c4ead9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/519fb6fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,380 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ec2ff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ec2ff6c42100141fce95f06aba7e85 deleted file mode 100644 index 42f1ffc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/80ec2ff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,109 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90d197a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90d197a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6097c98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/90d197a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryEdge implements Blueprint { - - List wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9154329ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9154329ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 34926a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/9154329ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerUniversalFlowerPot extends Container{ - protected TileEntityUniversalFlowerPot tileEntity; - - public ContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntityUniversalFlowerPot){ - this.tileEntity = tileEntityUniversalFlowerPot; - - // The Slot constructor takes the IInventory and the slot number in that it binds to - // and the x-y coordinates it resides on-screen - addSlotToContainer(new Slot(tileEntity, 0, 79, 17)); - - // Commonly used vanilla code that adds the player's inventory - bindPlayerInventory(inventoryPlayer); - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return tileEntity.isUseableByPlayer(player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { - ItemStack stack = null; - Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) - if (slotObject != null && slotObject.getHasStack()) { - ItemStack stackInSlot = slotObject.getStack(); - stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity - //this assumes only 1 slot, for inventories with > 1 slots, check out the Chest Container. - if (slot == 0) { - if (!mergeItemStack(stackInSlot, 1, inventorySlots.size(), true)) { - return null; - } - //places it into the tileEntity is possible since its in the player inventory - } else if (!mergeItemStack(stackInSlot, 0, 1, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slotObject.putStack(null); - } else { - slotObject.onSlotChanged(); - } - } - - return stack; - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/a01efd9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/a01efd9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4282098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/a01efd9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,25 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Comparator; - -import net.minecraft.entity.Entity; -public class EntityAINearestAttackableTargetSorter implements Comparator{ - private Entity theEntity; - - final EntityAINearestAttackableTarget parent; - - public EntityAINearestAttackableTargetSorter(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, Entity par2Entity){ - this.parent = par1EntityAINearestAttackableTarget; - this.theEntity = par2Entity; - } - - public int compareDistanceSq(Entity par1Entity, Entity par2Entity){ - double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); - double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - - public int compare(Object par1Obj, Object par2Obj){ - return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/c17ba7e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/c17ba7e6c42100141fce95f06aba7e85 deleted file mode 100644 index c8a3230..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/c17ba7e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/c1b7b89dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/c1b7b89dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 346e715..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/c1b7b89dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,201 +0,0 @@ -package projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/f08d01fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/f08d01fac42100141fce95f06aba7e85 deleted file mode 100644 index 474903d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/65/f08d01fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockZuluSlab; -import com.ngb.projectzulu.common.blocks.ItemZuluSlab; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/01a6cbf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/01a6cbf8c42100141fce95f06aba7e85 deleted file mode 100644 index 8845642..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/01a6cbf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityMummy; -import com.ngb.projectzulu.common.mobs.models.ModelMummy; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/205df79fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/205df79fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 50108b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/205df79fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,5 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -public interface BuildingManager { - public abstract void generate(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/2171c4a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/2171c4a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 169e1c4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/2171c4a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,247 +0,0 @@ -package projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.core.packets.PacketStreamSound; -import projectzulu.common.core.packets.PacketTameParticle; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.mobs.packets.PacketAnimTime; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import projectzulu.common.mobs.packets.PacketNameSync; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/21d823f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/21d823f9c42100141fce95f06aba7e85 deleted file mode 100644 index 4e49e6f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/21d823f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/227beef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/227beef9c42100141fce95f06aba7e85 deleted file mode 100644 index c15c8b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/227beef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/904f26f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/904f26f6c42100141fce95f06aba7e85 deleted file mode 100644 index 6650448..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/904f26f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawn extends KeyParserBase { - - public KeyParserSpawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/90cacb9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/90cacb9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fa832ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/90cacb9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,195 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelMammothHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer TUSKLEFROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer NOSEROT1; - private ModelRenderer NOSEROT2; - private ModelRenderer NOSEROT3; - private ModelRenderer NOSEROT4; - private ModelRenderer NOSEROT5; - private ModelRenderer NOSEROT6; - private ModelRenderer NOSEROT7; - private ModelRenderer NOSEROT8; - private ModelRenderer NOSEROT9; - private ModelRenderer EARRIGROT; - private ModelRenderer EARLEFROT; - - public ModelMammothHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 16F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5) - { - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NOSEROT1.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (0.0*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - default: - NOSEROT1.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - } - - TUSKRIGROT.rotateAngleY = (float) (-22.5*Math.PI/180); - TUSKLEFROT.rotateAngleY = (float) (22.5*Math.PI/180); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/a14ee6e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/a14ee6e5c42100141fce95f06aba7e85 deleted file mode 100644 index 840c92b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/a14ee6e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/e0ef6301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/e0ef6301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ef32ae0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/e0ef6301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/f067a7fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/f067a7fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e5ed9d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/f067a7fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,167 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/f153dafdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/f153dafdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 192366a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/66/f153dafdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutSeed; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/005b2ef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/005b2ef5c42100141fce95f06aba7e85 deleted file mode 100644 index e32a569..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/005b2ef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,524 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import com.ngb.projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/00a6c7cbcaab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/00a6c7cbcaab00141ee9bf3050c1025b new file mode 100644 index 0000000..6f59780 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/00a6c7cbcaab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(2) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/101186e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/101186e6c42100141fce95f06aba7e85 deleted file mode 100644 index 1212d27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/101186e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,225 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/30a772ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/30a772ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7d51e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/30a772ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/31fd48e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/31fd48e5c42100141fce95f06aba7e85 deleted file mode 100644 index 67ef5f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/31fd48e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityCreature theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) this.targetEntity.posX, (double) this.targetEntity.posY, (double) this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/4047dbe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/4047dbe4c42100141fce95f06aba7e85 deleted file mode 100644 index 262ce65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/4047dbe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/4054a401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/4054a401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a644773..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/4054a401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericLimited; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/5071b8ab332000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/5071b8ab332000141dbfc2e92eb0e949 deleted file mode 100644 index abcea27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/5071b8ab332000141dbfc2e92eb0e949 +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.examplemod; - -import net.minecraft.init.Blocks; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulMod1.MODID, version = SoulMod1.VERSION) -public class SoulMod1 -{ - public static final String MODID = "examplemod"; - public static final String VERSION = "1.0"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - // some example code - System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/7063d89fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/7063d89fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2e12ea9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/7063d89fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8055c8f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8055c8f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0599b3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/8055c8f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,14 +0,0 @@ -package com.ngb.projectzulu.common; - -public class CommonProxyProjectZulu { - - public int addArmor(String armor) { - return 0; - } - - public void bossHealthTicker() { - } - - public void registerModelsAndRender() { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/9029c1f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/9029c1f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3c5827e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/9029c1f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/a00708d6ebac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/a00708d6ebac0014196dc3517d78505a new file mode 100644 index 0000000..d36260d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/a00708d6ebac0014196dc3517d78505a @@ -0,0 +1,336 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelCamel extends ModelBase +{ + float heightToRaise = 33f; + float renderScale = 1.0f; + //fields + //fields + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer HEADbump; + ModelRenderer HEAD; + ModelRenderer neckTop; + ModelRenderer neckBase; + ModelRenderer humpMain; + ModelRenderer humpMain2; + ModelRenderer saddleBase; + ModelRenderer saddleHorn1; + ModelRenderer saddleHorn2; + ModelRenderer Body; + ModelRenderer hip1; + ModelRenderer Leg1toProt; + ModelRenderer Leg1BotRot; + ModelRenderer hip2; + ModelRenderer Leg2toProt; + ModelRenderer Leg2BotRot; + ModelRenderer hip3; + ModelRenderer Leg3toProt; + ModelRenderer Leg3BotRot; + ModelRenderer hip4; + ModelRenderer Leg4toProt; + ModelRenderer Leg4BotRot; + ModelRenderer tail; + + public ModelCamel() + { + textureWidth = 128; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -3F, -4F, 5, 4, 7); + HEAD.setRotationPoint(0F, 3F - heightToRaise, -15F); + HEAD.setTextureSize(128, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.2268928F, 0F, 0F); + HEADbump = new ModelRenderer(this, 105, 42); + HEADbump.addBox(-2F, -2F, -3F, 3, 2, 6); + //HEADbump.setRotationPoint(1F, 1.5F, -15.5F); + HEADbump.setRotationPoint(1F, -1.5F, -0.5F); + HEADbump.setTextureSize(128, 64); + HEADbump.mirror = true; + setRotation(HEADbump, 0.296706F, 0F, 0F); + HEAD.addChild(HEADbump); + earLeft = new ModelRenderer(this, 60, 6); + earLeft.addBox(0F, -3F, -1F, 1, 4, 1); + //earLeft.setRotationPoint(1.5F, 1F, -13F); + earLeft.setRotationPoint(1.5F, -1.0F, 2.5F); + earLeft.setTextureSize(128, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, 0.5235988F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 60, 1); + earRight.addBox(-1F, -3F, -1F, 1, 4, 1); + //earRight.setRotationPoint(-0.5F, 1F, -13F); + earRight.setRotationPoint(-0.5F, -1.0F, 2.5F); + earRight.setTextureSize(128, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, -0.5235988F); + HEAD.addChild(earRight); + + neckTop = new ModelRenderer(this, 29, 1); + neckTop.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + neckTop.setRotationPoint(0.5F, 1.8F - heightToRaise , -14F); + neckTop.setTextureSize(128, 64); + neckTop.mirror = true; + setRotation(neckTop, 0.6457718F, 0F, 0F); + neckBase = new ModelRenderer(this, 43, 1); + neckBase.addBox(-1.5F, 0F, -1.5F, 3, 6, 4); + neckBase.setRotationPoint(0.5F, 6F - heightToRaise, -11.5F); + neckBase.setTextureSize(128, 64); + neckBase.mirror = true; + setRotation(neckBase, 1.117011F, 0F, 0F); + humpMain = new ModelRenderer(this, 1, 41); + humpMain.addBox(-3.5F, -2F, -2F, 8, 4, 9); + humpMain.setRotationPoint(0F, 3F - heightToRaise, -0.5F); + humpMain.setTextureSize(128, 64); + humpMain.mirror = true; + setRotation(humpMain, 0F, 0F, 0F); + humpMain2 = new ModelRenderer(this, 37, 42); + humpMain2.addBox(-3F, -2F, -2F, 7, 4, 7); + humpMain2.setRotationPoint(0F, 0.75F - heightToRaise, 0.5F); + humpMain2.setTextureSize(128, 64); + humpMain2.mirror = true; + setRotation(humpMain2, 0F, 0F, 0F); + saddleBase = new ModelRenderer(this, 68, 52); + saddleBase.addBox(-3.5F, -2F, -2F, 6, 1, 5); + saddleBase.setRotationPoint(1F, 4F - heightToRaise, -5F); + saddleBase.setTextureSize(128, 64); + saddleBase.mirror = true; + setRotation(saddleBase, 0F, 0F, 0F); + saddleHorn1 = new ModelRenderer(this, 67, 1); + saddleHorn1.addBox(-1F, -3F, -1F, 1, 5, 1); + saddleHorn1.setRotationPoint(1F, 1F - heightToRaise, -6F); + saddleHorn1.setTextureSize(128, 64); + saddleHorn1.mirror = true; + setRotation(saddleHorn1, 0.3346075F, 0F, 0F); + saddleHorn2 = new ModelRenderer(this, 73, 5); + saddleHorn2.addBox(-2F, -1F, -1F, 4, 1, 1); + saddleHorn2.setRotationPoint(0.5F, 0F - heightToRaise, -7F); + saddleHorn2.setTextureSize(128, 64); + saddleHorn2.mirror = true; + setRotation(saddleHorn2, 0F, 0F, 0F); + Body = new ModelRenderer(this, 1, 14); + Body.addBox(-3.5F, -2F, -10F, 9, 9, 16); + Body.setRotationPoint(-0.5F, 5F - heightToRaise, 3F); + Body.setTextureSize(128, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + hip1 = new ModelRenderer(this, 68, 42); + hip1.addBox(-1F, -3F, -1F, 4, 4, 4); + hip1.setRotationPoint(-4F, 12F - heightToRaise, -5.5F); + hip1.setTextureSize(128, 64); + hip1.mirror = true; + setRotation(hip1, 0.0698132F, 0F, 0F); + Leg1toProt = new ModelRenderer(this, 65, 13); + Leg1toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg1toProt.setRotationPoint(-3F, 12F, -4.5F); + Leg1toProt.setRotationPoint(1F, 0F, 0.5F); + Leg1toProt.setTextureSize(128, 64); + Leg1toProt.mirror = true; + setRotation(Leg1toProt, 0.0698132F, 0F, 0F); + hip1.addChild(Leg1toProt); + Leg1BotRot = new ModelRenderer(this, 65, 25); + Leg1BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg1BotRot.setRotationPoint(-3F, 17F, -4F); + Leg1BotRot.setRotationPoint(0F, 6F, 0F); + Leg1BotRot.setTextureSize(128, 64); + Leg1BotRot.mirror = true; + setRotation(Leg1BotRot, -0.0698132F, 0F, 0F); + Leg1toProt.addChild(Leg1BotRot); + hip2 = new ModelRenderer(this, 68, 42); + hip2.addBox(-1F, -1F, -1F, 4, 4, 4); + hip2.setRotationPoint(3F, 10F - heightToRaise, -5.5F); + hip2.setTextureSize(128, 64); + hip2.mirror = true; + setRotation(hip2, 0.0698132F, 0F, 0F); + Leg2toProt = new ModelRenderer(this, 52, 13); + Leg2toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg2toProt.setRotationPoint(4F, 11F, -4.5F); + Leg2toProt.setRotationPoint(1F, 2F, 0.5F); + Leg2toProt.setTextureSize(128, 64); + Leg2toProt.mirror = true; + setRotation(Leg2toProt, 0.0698132F, 0F, 0F); + hip2.addChild(Leg2toProt); + Leg2BotRot = new ModelRenderer(this, 52, 25); + Leg2BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg2BotRot.setRotationPoint(4F, 17F, -4F); + Leg2BotRot.setRotationPoint(0F, 6F, 0F); + Leg2BotRot.setTextureSize(128, 64); + Leg2BotRot.mirror = true; + setRotation(Leg2BotRot, -0.0698132F, 0F, 0F); + Leg2toProt.addChild(Leg2BotRot); + hip3 = new ModelRenderer(this, 87, 42); + hip3.addBox(-1F, -1F, -1F, 4, 5, 4); + hip3.setRotationPoint(-4F, 9F - heightToRaise, 5F); + hip3.setTextureSize(128, 64); + hip3.mirror = true; + setRotation(hip3, 0.0698132F, 0F, 0F); + Leg3toProt = new ModelRenderer(this, 95, 13); + Leg3toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg3toProt.setRotationPoint(-3F, 12F, 6F); + Leg3toProt.setRotationPoint(1F, 2F, 1F); + Leg3toProt.setTextureSize(128, 64); + Leg3toProt.mirror = true; + setRotation(Leg3toProt, 0.0872665F, 0F, 0F); + hip3.addChild(Leg3toProt); + Leg3BotRot = new ModelRenderer(this, 95, 25); + Leg3BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg3BotRot.setRotationPoint(-3F, 17F, 6.5F); + Leg3BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg3BotRot.setTextureSize(128, 64); + Leg3BotRot.mirror = true; + setRotation(Leg3BotRot, -0.0698132F, 0F, 0F); + Leg3toProt.addChild(Leg3BotRot); + + hip4 = new ModelRenderer(this, 87, 42); + hip4.addBox(-1F, -1F, -1F, 4, 5, 4); + hip4.setRotationPoint(3F, 9F - heightToRaise, 5F); + hip4.setTextureSize(128, 64); + hip4.mirror = true; + setRotation(hip4, 0.0698132F, 0F, 0F); + Leg4toProt = new ModelRenderer(this, 81, 13); + Leg4toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg4toProt.setRotationPoint(4F, 12F, 6F); + Leg4toProt.setRotationPoint(1F, 2F, 1F); + Leg4toProt.setTextureSize(128, 64); + Leg4toProt.mirror = true; + setRotation(Leg4toProt, 0.0872665F, 0F, 0F); + hip4.addChild(Leg4toProt); + Leg4BotRot = new ModelRenderer(this, 81, 25); + Leg4BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg4BotRot.setRotationPoint(4F, 17F, 6.5F); + Leg4BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg4BotRot.setTextureSize(128, 64); + Leg4BotRot.mirror = true; + setRotation(Leg4BotRot, -0.0698132F, 0F, 0F); + Leg4toProt.addChild(Leg4BotRot); + tail = new ModelRenderer(this, 109, 13); + tail.addBox(-1F, -1F, 0F, 2, 7, 2); + tail.setRotationPoint(0F, 7F - heightToRaise, 7.6F); + tail.setTextureSize(128, 64); + tail.mirror = true; + setRotation(tail, 0.5585054F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + //Leg1toProt.render(f5); + //Leg1BotRot.render(f5); + hip2.render(renderScale * f5); + //Leg2toProt.render(f5); + //Leg2BotRot.render(f5); + hip3.render(renderScale * f5); + //Leg3toProt.render(f5); + //Leg3BotRot.render(f5); + hip4.render(renderScale * f5); + //Leg4toProt.render(f5); + //Leg4BotRot.render(f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + hip2.render(renderScale * f5); + hip3.render(renderScale * f5); + hip4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Tail Rotation */ + //NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 + //* MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + /* Tail Rotation */ + tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + /* Leg Animation */ + hip1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + hip2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + Leg1BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg2BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + hip3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + hip4.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + Leg3BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg4BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + //HEAD.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + //HEAD.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + HEAD.rotateAngleX = f3 / (180F / (float)Math.PI); + } + + } diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c046b2f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c046b2f7c42100141fce95f06aba7e85 deleted file mode 100644 index 2094daf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/c046b2f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelLizardHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADBASE; - private ModelRenderer FRILL3ROT; - private ModelRenderer FRILL4ROT; - - public ModelLizardHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("FRILL3ROT.Frill3", 37, 22); - setTextureOffset("HEADBASE.head", 0, 0); - setTextureOffset("HEADBASE.Frill1", 29, 22); - setTextureOffset("HEADBASE.Frill2", 29, 22); - setTextureOffset("FRILL4ROT.Frill4", 37, 22); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 0F, 3F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - FRILL3ROT = new ModelRenderer(this, "FRILL3ROT"); - FRILL3ROT.setRotationPoint(1F, -2F, -2.5F); - setRotation(FRILL3ROT, 0F, 0F, 0F); - FRILL3ROT.mirror = true; - FRILL3ROT.addBox("Frill3", 0F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL3ROT); - HEADBASE.addBox("head", -3F, -3F, -8F, 6, 6, 8); - HEADBASE.addBox("Frill1", 3F, -2F, -3F, 3, 5, 1); - HEADBASE.addBox("Frill2", -6F, -2F, -3F, 3, 5, 1); - FRILL4ROT = new ModelRenderer(this, "FRILL4ROT"); - FRILL4ROT.setRotationPoint(-1F, -2F, -2.5F); - setRotation(FRILL4ROT, 0F, 0F, 0F); - FRILL4ROT.mirror = true; - FRILL4ROT.addBox("Frill4", -4F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL4ROT); - CENTERROT.addChild(HEADBASE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - FRILL3ROT.rotateAngleZ = (float)( -45*Math.PI/180 ); - FRILL4ROT.rotateAngleZ = (float)( 45*Math.PI/180 ); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0a6392bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0a6392bc52100141fce95f06aba7e85 deleted file mode 100644 index 33a683a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/67/f0a6392bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,237 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import projectzulu.common.core.CreativePZGeneralTab; -import projectzulu.common.core.CreativePZPotionTab; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.EventHookContainerClass; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.PacketPipeline; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.ZuluGuiHandler; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/0068e000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/0068e000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89eb2fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/0068e000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/11f5f4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/11f5f4f7c42100141fce95f06aba7e85 deleted file mode 100644 index 5c3c0b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/11f5f4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,5 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -public interface BuildingManager { - public abstract void generate(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/1218f8f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/1218f8f9c42100141fce95f06aba7e85 deleted file mode 100644 index 659a906..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/1218f8f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemStructurePlacer; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/12fdb8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/12fdb8e5c42100141fce95f06aba7e85 deleted file mode 100644 index d87c2ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/12fdb8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40330ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40330ee4c42100141fce95f06aba7e85 deleted file mode 100644 index af2b6f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/40330ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/41fe72e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/41fe72e6c42100141fce95f06aba7e85 deleted file mode 100644 index 777aab8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/41fe72e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/8014caf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/8014caf7c42100141fce95f06aba7e85 deleted file mode 100644 index 68d708d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/8014caf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockWoodSlab; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockZuluSlab extends BlockWoodSlab { - - public static Block singleSlabID; - Block baseBlock; - - /** Single Slab Constructor */ - public BlockZuluSlab(Block baseBlock) { - super(false); - singleSlabID = this; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** Double Slab Constructor */ - public BlockZuluSlab(Block singleSlab, Block baseBlock) { - super(true); - singleSlabID = singleSlab; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - @Override - protected ItemStack createStackedBlock(int par1) { - return new ItemStack(singleSlabID, 2, par1 & 7); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return baseBlock.getIcon(par1, par2 & 7); - } - - @Override - public String func_150002_b(int par1) { - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(singleSlabID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/91c355e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/91c355e4c42100141fce95f06aba7e85 deleted file mode 100644 index ee4d172..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/91c355e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.spike.BlockSpikes; -import projectzulu.common.blocks.spike.RenderSpike; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0026ff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0026ff4c42100141fce95f06aba7e85 deleted file mode 100644 index 65bfb84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a0026ff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a06925fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a06925fac42100141fce95f06aba7e85 deleted file mode 100644 index 5d836c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/a06925fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelRhinoHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelRhinoHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 18F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/f2c7a89fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/f2c7a89fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75a5a2a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/68/f2c7a89fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import net.minecraft.potion.Potion; - -public class ZuluPotionHelper{ - public static void setVanillaPotionProperties() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ - Potion potionToEdit = Potion.potionTypes[Potion.blindness.getId()]; - Method[] potionMethods = potionToEdit.getClass().getDeclaredMethods(); - int doubleCounter = 0; - for (int i = 0; i < potionMethods.length; i++) { - /* Look for setEffectiveness : It has 1 Parameter and it is a double : No other method fits that criteria */ - if(potionMethods[i].getParameterTypes().length == 1 && (potionMethods[i].getParameterTypes())[0].toString().equals("double")){ - potionMethods[i].setAccessible(true); - potionMethods[i].invoke(potionToEdit, 0.03D); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/00ab62f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/00ab62f8c42100141fce95f06aba7e85 deleted file mode 100644 index fb1c9d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/00ab62f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/105463a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/105463a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 70f8fe6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/105463a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; - -public class ChestWithMeta extends BlockWithMeta { - - int lootChance; - int maxLoot; - TileEntityChest tileEntityChest; - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance) { - this(block, meta, tileEntityChest, lootChance, -1); - } - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance, int maxLoot) { - super(block, meta); - this.tileEntityChest = tileEntityChest; - this.lootChance = lootChance; - this.maxLoot = maxLoot; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntityChest); - int amountOfLoot = 0; - for (int slot = 0; slot < tileEntityChest.getSizeInventory(); slot++) { - if (lootChance - random.nextInt(100) >= 0) { - tileEntityChest.setInventorySlotContents(slot, ChestGenHooks.getOneItem(DUNGEON_CHEST, random)); - amountOfLoot++; - if (maxLoot > 0 && amountOfLoot >= maxLoot) { - break; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10819bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10819bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 05588d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/10819bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30cdeaf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30cdeaf5c42100141fce95f06aba7e85 deleted file mode 100644 index 291471d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/30cdeaf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/31754cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/31754cf6c42100141fce95f06aba7e85 deleted file mode 100644 index a13a899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/31754cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/72b8a3a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/72b8a3a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cde2d21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/72b8a3a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.BlockWithPalmTree; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80ab8be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80ab8be5c42100141fce95f06aba7e85 deleted file mode 100644 index 1b74157..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/80ab8be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBrownBear extends ModelBear { - - public ModelBrownBear() { - super(7); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.4f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/90d98cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/90d98cf6c42100141fce95f06aba7e85 deleted file mode 100644 index f51f09b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/90d98cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.core; -/** - * Usage: - * Pair pair = Pair.createPair(1, "test"); - * pair.getElement0(); - * pair.getElement1(); - * @param - * @param - */ -public class Pair { - - private final K element0; - private final V element1; - - public static Pair createPair(K element0, V element1) { - return new Pair(element0, element1); - } - - public Pair(K element0, V element1) { - this.element0 = element0; - this.element1 = element1; - } - - public K getElement0() { - return element0; - } - - public V getElement1() { - return element1; - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/a080c99dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/a080c99dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1ba40d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/a080c99dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGorillaHead extends ModelBase{ - - ModelRenderer HEADROT; - - public ModelGorillaHead() - { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 23F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/b18b1df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/b18b1df8c42100141fce95f06aba7e85 deleted file mode 100644 index d85b40b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/b18b1df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthRandomWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if ((piecePos.posY == 0)) {// || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/c1ce3de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/c1ce3de4c42100141fce95f06aba7e85 deleted file mode 100644 index 262ff54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/c1ce3de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/d04232ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/d04232ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 46c5462..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/d04232ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e011ab9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e011ab9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 697fbaf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e011ab9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,245 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.util.EnumSet; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.client.renderer.Tessellator; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.src.ModLoader; -//import net.minecraft.util.MathHelper; -// -//import org.lwjgl.opengl.GL11; -// -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class DisplayTemperatureTicker implements ITickHandler{ -// -// protected float zLevel = 10.0F; -// public static long inGameTicks = 0; -// private float playerTemp = 0; -// private float enviroTemp = 0; -// @Override -// public void tickStart(EnumSet type, Object... tickData) {} -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// -// /* Handle Display of Temperature on Client, TickType = Render*/ -// if(ModLoader.getMinecraftInstance().thePlayer != null){ -// -// Minecraft mc = ModLoader.getMinecraftInstance(); -// EntityPlayer player = ModLoader.getMinecraftInstance().thePlayer; -// -// FontRenderer var2 = mc.fontRenderer; -// ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); -// String textureLocation = "/mods/icons/temperature_icon.png"; -// int scalewidth = var3.getScaledWidth(); -// int scaleHeight = var3.getScaledHeight(); -// -// if( TemperatureTicker.getPlayerTemperature(player) != null && inGameTicks % 80 == 0){ -// playerTemp = TemperatureTicker.getPlayerTemperature(player); -// } -// if(TemperatureTicker.getPlayerLocTemperature(player) != null && inGameTicks % 80 == 0){ -// enviroTemp = TemperatureTicker.getPlayerLocTemperature(player); -// } -// int playerTempIconValue = (int) mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120); -// int playerTempHumanReadable = 80 - playerTempIconValue; -// int verticalOffsetFromTopY = 120; -// int horizontalOffsetFromRightX = 0; -// int iconXCoord = 0; -// int iconYCoord = 0; -// -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture( textureLocation )); -// -// scalewidth = 0; -// scaleHeight = scaleHeight/2; -// horizontalOffsetFromRightX = -(26+10); -// verticalOffsetFromTopY -= 50; -// if( (120 - playerTempIconValue) < 20){ -// /* Draw Very Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 150; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// -// }else if( (120 - playerTempIconValue) < 30 ){ -// /* Draw Medium Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 125; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur2.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// }else if ( (120 - playerTempIconValue) < 40 ){ -// /* Draw Little Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 100; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 100 ){ -// /* Draw High Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 50; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 90 ){ -// /* Draw Medium Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 25; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 80 ){ -// /* Draw Little Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 0; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else{ -// /* Draw Frame */ -// iconXCoord = 0; -// iconYCoord = 0; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-12), iconXCoord, iconYCoord, 15, 105); -// -// /* Draw Red Inside */ -// iconXCoord = 200; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// } -// -// /* Draw Marker */ -// iconXCoord = 30; -// iconYCoord = 94; -// int playerLocTemp = MathHelper.floor_float((mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120)) ); -// playerLocTemp = playerLocTemp > 116 ? 116 : playerLocTemp < 14 ? 14 : playerLocTemp; -// -// this.drawTexturedModalRect(scalewidth-(14+horizontalOffsetFromRightX+0), scaleHeight-(8+verticalOffsetFromTopY-playerLocTemp+4), iconXCoord, iconYCoord, 4, 8); -// scalewidth = var3.getScaledWidth(); -// horizontalOffsetFromRightX = 0; -// -// -// -// -// /* Write Temp String TO Top Of Screen, Mostly For Debugging For Now*/ -// byte var8 = 12; -// String var9 = "Current Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120))); -// String var10 = "Max Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120))); -// -//// var2.drawStringWithShadow(var10, scalewidth / 2 - var2.getStringWidth(var10) / 2, var8 - 10, 16711935); -//// var2.drawStringWithShadow(var9, scalewidth / 2 - var2.getStringWidth(var9) / 2, var8 + 10, 16711935); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// -// inGameTicks++; -// } -// -// } -// -// private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6){ -// float var7 = 0.00390625F; -// float var8 = 0.00390625F; -// -// Tessellator var9 = Tessellator.instance; -// var9.startDrawingQuads(); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); -// var9.draw(); -// } -// -// private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of( TickType.RENDER); } -// -// @Override -// public String getLabel() { -// return null; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e0eacc01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e0eacc01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77a91fe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e0eacc01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e120e1a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e120e1a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d3f1cbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/69/e120e1a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/105557e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/105557e5c42100141fce95f06aba7e85 deleted file mode 100644 index edb277b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/105557e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIWander extends EntityAIBase -{ - private EntityCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/11d939fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/11d939fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 02ef424..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/11d939fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.blocks.GuiAnimalName; -import projectzulu.common.blocks.tombstone.GuiTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.universalpot.ContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.GuiContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.dungeon.GuiLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; -import projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingBase; -import cpw.mods.fml.common.network.IGuiHandler; - -public class ZuluGuiHandler implements IGuiHandler { - - @Override - public Object getServerGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - - TileEntity tileEntityServer; - switch (GuiID.getGuiIDByID(guiID)) { - case FlowerPot: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityUniversalFlowerPot) { - return new ContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityServer); - } - case BrewingStand: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityBrewingBase) { - return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - default: - break; - } - return null; - - } - - @Override - public Object getClientGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tileEntityClient; - switch (GuiID.getGuiIDByID(guiID)) { - case Tombstone: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityTombstone) { - return new GuiTombstone((TileEntityTombstone) tileEntityClient); - } - break; - case FlowerPot: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityUniversalFlowerPot) { - return new GuiContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityClient); - } - break; - case AnimalName: - return new GuiAnimalName(world, player, x); - case MobSpawner: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityLimitedMobSpawner) { - return new GuiLimitedMobSpawner((TileEntityLimitedMobSpawner) tileEntityClient); - } - case BrewingStand: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityBrewingBase) { - return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - } - - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/203af0f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/203af0f7c42100141fce95f06aba7e85 deleted file mode 100644 index 47b57d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/203af0f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectOasis; -import com.ngb.projectzulu.common.world2.randomizer.EdgeRandomizer; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/310777e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/310777e4c42100141fce95f06aba7e85 deleted file mode 100644 index 184c18f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/310777e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/40569308c8ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/40569308c8ab00141ee9bf3050c1025b new file mode 100644 index 0000000..81131ec --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/40569308c8ab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/405ab4a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/405ab4a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ba742e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/405ab4a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/61ea35e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/61ea35e5c42100141fce95f06aba7e85 deleted file mode 100644 index bec4df7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/61ea35e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/7027cbffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/7027cbffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 624b63f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/7027cbffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLog; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/908afa90eeac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/908afa90eeac0014196dc3517d78505a new file mode 100644 index 0000000..bb05d4d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/908afa90eeac0014196dc3517d78505a @@ -0,0 +1,288 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelDeer extends ModelBase + { + float heightToRaise = 5f; + float renderScale = 1.3f; + + //fields + ModelRenderer top4hornRight; + ModelRenderer top4hornLeft; + ModelRenderer top3hornRight; + ModelRenderer top3hornLeft; + ModelRenderer top1hornRight; + ModelRenderer top1hornLeft; + ModelRenderer HEADROT; + ModelRenderer hornLeft; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer neck; + ModelRenderer BODYROT; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer tail; + ModelRenderer top2hornLeft; + ModelRenderer hornRight; + ModelRenderer top2hornRight; + + public ModelDeer() + { + textureWidth = 64; + textureHeight = 64; + + HEADROT = new ModelRenderer(this, 1, 19); + HEADROT.addBox(-1.5F, -6F, -7F, 5, 4, 7); + HEADROT.setRotationPoint(-2F, 4F - heightToRaise , -6F); + HEADROT.setTextureSize(64, 64); + HEADROT.mirror = true; + setRotation(HEADROT, 0.5230717F, 0F, 0F); + + earLeft = new ModelRenderer(this, 43, 33); + earLeft.addBox(0F, 1F, 0F, 1, 3, 1); + //earLeft.setRotationPoint(0F, 0.5F, -9F); + earLeft.setRotationPoint(2F, -3.5F, -2.0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, -2.199115F); + HEADROT.addChild(earLeft); + + earRight = new ModelRenderer(this, 50, 33); + earRight.addBox(-1F, 1F, 0F, 1, 3, 1); + //earRight.setRotationPoint(-2F, 0.5F, -9F); + earRight.setRotationPoint(-0.5F, -3.5F, -2.0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, 2.199115F); + HEADROT.addChild(earRight); + + hornLeft = new ModelRenderer(this, 8, 5); + hornLeft.addBox(0F, -3F, 0F, 1, 5, 1); + //hornLeft.setRotationPoint(0F, -3F, -9F); + hornLeft.setRotationPoint(2F, -8F, -2F); + hornLeft.setTextureSize(64, 64); + hornLeft.mirror = true; + setRotation(hornLeft, -0.5410521F, 0.1396263F, 0F); + HEADROT.addChild(hornLeft); + + hornRight = new ModelRenderer(this, 2, 5); + hornRight.addBox(-1F, -3F, 0F, 1, 5, 1); + //hornRight.setRotationPoint(-2F, -3F, -9F); + hornRight.setRotationPoint(0F, -8F, -2F); + hornRight.setTextureSize(64, 64); + hornRight.mirror = true; + setRotation(hornRight, -0.5410521F, -0.1396263F, 0F); + HEADROT.addChild(hornRight); + + top2hornLeft = new ModelRenderer(this, 21, 5); + top2hornLeft.addBox(0F, -3F, 0F, 1, 4, 1); + //top2hornLeft.setRotationPoint(0.3F, -5.5F, -8F); + top2hornLeft.setRotationPoint(0.3F, -3.5F, 0F); + top2hornLeft.setTextureSize(64, 64); + top2hornLeft.mirror = true; + setRotation(top2hornLeft, 0.6372665F, 0.0349066F, 0.0523599F); + hornLeft.addChild(top2hornLeft); + + top2hornRight = new ModelRenderer(this, 15, 5); + top2hornRight.addBox(-1F, -3F, 0F, 1, 4, 1); + //top2hornRight.setRotationPoint(-2.3F, -5.5F, -8F); + top2hornRight.setRotationPoint(0F, -3.5F, 0F); + top2hornRight.setTextureSize(64, 64); + top2hornRight.mirror = true; + setRotation(top2hornRight, 0.6372665F, -0.0349066F, -0.0523599F); + hornRight.addChild(top2hornRight); + + top1hornRight = new ModelRenderer(this, 41, 5); + top1hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top1hornRight.setRotationPoint(-2.4F, -7.5F, -8F); + top1hornRight.setRotationPoint(-0.4F, -2.0F, -0F); + top1hornRight.setTextureSize(64, 64); + top1hornRight.mirror = true; + setRotation(top1hornRight, 1.047198F, 0.1047198F, 0F); + top2hornRight.addChild(top1hornRight); + + top1hornLeft = new ModelRenderer(this, 41, 10); + top1hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top1hornLeft.setRotationPoint(0.5F, -7.5F, -8F); + top1hornLeft.setRotationPoint(0.5F, -2.0F, -0F); + top1hornLeft.setTextureSize(64, 64); + top1hornLeft.mirror = true; + setRotation(top1hornLeft, 1.047198F, -0.1047198F, 0F); + top2hornLeft.addChild(top1hornLeft); + + top3hornRight = new ModelRenderer(this, 34, 5); + top3hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top3hornRight.setRotationPoint(-2.2F, -5F, -8F); + top3hornRight.setRotationPoint(-0.2F, -2.0F, 0F); + top3hornRight.setTextureSize(64, 64); + top3hornRight.mirror = true; + setRotation(top3hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top3hornRight); + + top3hornLeft = new ModelRenderer(this, 34, 10); + top3hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top3hornLeft.setRotationPoint(0.2F, -5F, -8F); + top3hornLeft.setRotationPoint(0.2F, -2.0F, 0F); + top3hornLeft.setTextureSize(64, 64); + top3hornLeft.mirror = true; + setRotation(top3hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top3hornLeft); + + top4hornRight = new ModelRenderer(this, 28, 5); + top4hornRight.addBox(-1F, -3F, 0F, 1, 2, 1); + //top4hornRight.setRotationPoint(-2F, -2F, -8F); + top4hornRight.setRotationPoint(-0F, 1.5F, 1.5F); + top4hornRight.setTextureSize(64, 64); + top4hornRight.mirror = true; + setRotation(top4hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top4hornRight); + + top4hornLeft = new ModelRenderer(this, 28, 9); + top4hornLeft.addBox(0F, -3F, 0F, 1, 2, 1); + //top4hornLeft.setRotationPoint(0F, -2F, -8F); + top4hornLeft.setRotationPoint(0F, 1.5F, 1.5F); + top4hornLeft.setTextureSize(64, 64); + top4hornLeft.mirror = true; + setRotation(top4hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top4hornLeft); + + neck = new ModelRenderer(this, 28, 21); + neck.addBox(0F, -2F, -2F, 4, 3, 8); + neck.setRotationPoint(-3F, 2F - heightToRaise, -8F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, -0.9294653F, 0F, 0F); + BODYROT = new ModelRenderer(this, 28, 41); + BODYROT.addBox(-4F, -8F, -5F, 8, 15, 6); + BODYROT.setRotationPoint(-1F, 6F - heightToRaise, 1F); + BODYROT.setTextureSize(64, 64); + BODYROT.mirror = true; + setRotation(BODYROT, 1.570796F, 0F, 0F); + leg1 = new ModelRenderer(this, 0, 32); + leg1.addBox(-1F, 0F, -1F, 3, 10, 3); + leg1.setRotationPoint(-4F, 11F - heightToRaise, 6F); + leg1.setTextureSize(64, 64); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 13, 32); + leg2.addBox(-1F, 0F, -1F, 3, 10, 3); + leg2.setRotationPoint(1F, 11F - heightToRaise, 6F); + leg2.setTextureSize(64, 64); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 13, 49); + leg3.addBox(-2F, 0F, -1F, 3, 10, 3); + leg3.setRotationPoint(-3F, 11F - heightToRaise, -6F); + leg3.setTextureSize(64, 64); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 0, 49); + leg4.addBox(-1F, 0F, -1F, 3, 10, 3); + leg4.setRotationPoint(1F, 11F - heightToRaise, -6F); + leg4.setTextureSize(64, 64); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + tail = new ModelRenderer(this, 28, 34); + tail.addBox(-1F, 0F, 0F, 2, 1, 3); + tail.setRotationPoint(-1F, 5.5F - heightToRaise, 7F); + tail.setTextureSize(64, 64); + tail.mirror = true; + setRotation(tail, -0.4506874F, 0F, 0F); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //top4hornRight.render(f5); + //top4hornLeft.render(f5); + //top3hornRight.render(f5); + //top3hornLeft.render(f5); + //top2hornLeft.render(f5); + //top2hornRight.render(f5); + //top1hornRight.render(f5); + //top1hornLeft.render(f5); + //hornLeft.render(f5); + //hornRight.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Constant Animation Rotations */ + leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + + /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math + .log(par3 + 1))); + + earLeft.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1))); + earRight.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1)));*/ + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + //HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + //HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + HEADROT.rotateAngleX = f4 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); + } + + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/c166edfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/c166edfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 857c34b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/c166edfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluStairs; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/d0acd5e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/d0acd5e5c42100141fce95f06aba7e85 deleted file mode 100644 index 25e6fc5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/d0acd5e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.potion.effects; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.PotionEffect; - -public class PotionCurse extends PotionZulu { - - public PotionCurse(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(2, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - - /* Get Active Potion effect Collection from Entity */ - Collection potionEffects = effectedEntity.getActivePotionEffects(); - - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - /* Check if we Should Try to Get a PotionEffect, proportional to Potion Strength */ - if ((par2 + 1) * 25 + 25 - effectedEntity.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToAct = numOfElemenents > 0 ? effectedEntity.worldObj.rand.nextInt(numOfElemenents) : 0; - Iterator iterator = potionEffects.iterator(); - - /* Get Specific Element and assuming its not the Current Potion ID, mark it for Removal */ - int i = 0; - PotionEffect potionEffectToPerform = null; - while (iterator.hasNext() && i <= elementToAct) { - potionEffectToPerform = (PotionEffect) iterator.next(); - if (i == elementToAct && !effectedEntity.worldObj.isRemote && potionEffectToPerform != null - && potionEffectToPerform.getPotionID() != id) { - potionEffectToPerform.performEffect(effectedEntity); - break; - } - i++; - } - } - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f08e326e8d2100141bd6a937048980ed b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f08e326e8d2100141bd6a937048980ed deleted file mode 100644 index 4a2e5ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f08e326e8d2100141bd6a937048980ed +++ /dev/null @@ -1,232 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f12900f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f12900f6c42100141fce95f06aba7e85 deleted file mode 100644 index c6d3da0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f12900f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f1a4ffffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f1a4ffffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c21dff8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f1a4ffffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f1ca60e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f1ca60e5c42100141fce95f06aba7e85 deleted file mode 100644 index 10d0405..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6a/f1ca60e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.models.ModelEagle; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/01c9d2a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/01c9d2a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c5486e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/01c9d2a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/119b92f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/119b92f5c42100141fce95f06aba7e85 deleted file mode 100644 index b82465b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/119b92f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBlueFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/30188c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/30188c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 840c92b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/30188c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/32298dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/32298dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6003006..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/32298dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/401c899dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/401c899dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2aa1c81..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/401c899dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.block.Block; - -import com.google.common.base.Optional; - -public enum BlockList { - instance; - public static Optional palmHoloTree = Optional.absent(); // Not Used? - - public static Optional aloeVera = Optional.absent(); - public static Optional wateredDirt = Optional.absent(); - public static Optional tumbleweed = Optional.absent(); - public static Optional jasper = Optional.absent(); - - public static Optional palmTreeLog = Optional.absent(); - public static Optional palmTreePlank = Optional.absent(); - public static Optional palmTreeSlab = Optional.absent(); - public static Optional palmTreeDoubleSlab = Optional.absent(); - public static Optional palmTreeStairs = Optional.absent(); - public static Optional palmTreeLeaves = Optional.absent(); - public static Optional palmTreeSapling = Optional.absent(); - public static Optional coconut = Optional.absent(); - - public static Optional nightBloom = Optional.absent(); - public static Optional creeperBlossom = Optional.absent(); - public static Optional quickSand = Optional.absent(); - - public static Optional spike = Optional.absent(); - public static Optional campfire = Optional.absent(); - public static Optional mobHeads = Optional.absent(); - public static Optional tombstone = Optional.absent(); - - public static Optional universalFlowerPot = Optional.absent(); - public static Optional customBrewingStand = Optional.absent(); - public static Optional limitedMobSpawner = Optional.absent(); - public static Optional brewingStandSingle = Optional.absent(); - public static Optional brewingStandTriple = Optional.absent(); - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/6053d2ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/6053d2ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6de97bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/6053d2ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/807696f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/807696f6c42100141fce95f06aba7e85 deleted file mode 100644 index bf463ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/807696f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,247 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -import com.ngb.projectzulu.common.core.packets.PacketTameParticle; -import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -import com.ngb.projectzulu.common.mobs.packets.PacketNameSync; -import com.ngb.projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/908ee6dd5e2300141615d74fdd8749f5 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/908ee6dd5e2300141615d74fdd8749f5 deleted file mode 100644 index f0cdb83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/908ee6dd5e2300141615d74fdd8749f5 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a0974ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a0974ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 628bb47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a0974ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a15558f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a15558f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5309b52..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a15558f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a1bfe8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a1bfe8e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5b67eb8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/a1bfe8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionBlindness extends SubItemPotionGeneric { - - public SubItemPotionBlindness(Item itemID, int subID) { - super(itemID, subID, "potion.blindness"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 2, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.blindness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c05cbffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c05cbffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 396f1cf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/c05cbffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.command.IEntitySelector; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAINearestAttackableTarget extends EntityAITarget{ - EntityLivingBase targetEntity; - Class targetClass; - int targetChance; - private final IEntitySelector entitySelector; - EnumSet setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/f02c2de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/f02c2de4c42100141fce95f06aba7e85 deleted file mode 100644 index c87ec0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6b/f02c2de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAloeVeraSeeds; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/0076b400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/0076b400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a681a02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/0076b400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,217 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; - -public abstract class EntityGenericCreature extends EntityAerial { - private PathEntity pathToEntity; - - public boolean hasPath() { - return this.pathToEntity != null; - } - - /** The Entity this EntityCreature is set to attack. */ - protected Entity entityToAttack; - - public Entity getEntityToAttack() { - return this.entityToAttack; - } - - public void setTarget(Entity par1Entity) { - this.entityToAttack = par1Entity; - } - - private float maximumHomeDistance = -1.0F; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); - private boolean field_110180_bt; - // Cooldown instituted on the entity when it attempts to find a path but fails. - private int leashPathCooldown = 0; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0f); - - /** - * returns true if a creature has attacked recently only used for creepers and skeletons - */ - /* Do I need this? */ - // protected boolean hasAttacked = false; - - /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick = 0; - - public int getFleeTick() { - return fleeingTick; - } - - public void setFleeTick(int fleeingTick) { - this.fleeingTick = fleeingTick; - } - - /* Entity State Variables */ - protected int animTime = 0; - - public int getAnimTime() { - return animTime; - } - - public void setAnimTime(int animTime) { - this.animTime = animTime; - } - - protected int angerLevel = 0; - - public int getAngerLevel() { - return angerLevel; - } - - public void setAngerLevel(int angerLevel) { - this.angerLevel = angerLevel; - } - - protected EntityStates entityState = EntityStates.idle; - - public EntityStates getEntityState() { - return entityState; - } - - public EntityGenericCreature(World par1World) { - super(par1World); - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - attackTime = Math.max(attackTime - 1, 0); - fleeingTick = Math.max(fleeingTick - 1, 0); - angerLevel = Math.max(angerLevel - 1, 0); - } - - @Override - public void onUpdate() { - super.onUpdate(); - leashPathCooldown = Math.max(leashPathCooldown - 1, 0); - } - - @Override - protected void updateLeashedState() { - super.updateLeashedState(); - - if (this.getLeashed() && this.getLeashedToEntity() != null - && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity entity = this.getLeashedToEntity(); - this.setHomeArea((int) entity.posX, (int) entity.posY, (int) entity.posZ, 5); - float f = this.getDistanceToEntity(entity); - - if (this instanceof EntityGenericTameable && ((EntityGenericTameable) this).isSitting()) { - if (f > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/02c9d2a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/02c9d2a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f410cb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/02c9d2a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public interface TerrainFeature { - - /** - * The ordinal declaration of this ENUM determines priority during feature generation. Value declared first gets - * precedent. - */ - enum Size { - /* Feature is larger than a single chunk */ - LARGE, - /* Is approximately the size of a chunk */ - MEDIUM, - /* Size is less than a chunk, but more than a block */ - SMALL, - /* Spans a single or a couple blocks */ - TINY - } - - public enum FeatureDirection { - /* Structure should be centered on Current Block */ - CENTERED, - /* Structure should be centered along X but generate along -Z axis away from this block */ - NORTH, - /* Structure should be centered along X but generate along +Z axis away from this block */ - SOUTH, - /* Structure should be centered along Z but generate along -X axis away from this block */ - WEST, - /* Structure should be centered along Z but generate along +X axis away from this block */ - EAST; - } - - public abstract String getFeatureName(); - - public abstract boolean isEnabled(); - - public abstract Size getFeatureSize(); - - public abstract void initialize(File modConfigDirectory); - - /** - * From the World and Chunk. Generates an array of positions to attempt to generate the feature at. - * - * Each Point should be able to spawn - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @return - */ - public abstract ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ); - - /** - * Determines if the Feature can generate at the specified coordinates - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @param genBlockCoords Coordinates to generate at - * @param random - * @return - */ - public abstract boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random, FeatureDirection direction); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/102e1ca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/102e1ca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f6e8ace..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/102e1ca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/110418ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/110418ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d65ed89..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/110418ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,184 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import projectzulu.common.core.RenderHelper; -import projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/11cf93a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/11cf93a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 189c642..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/11cf93a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/129328f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/129328f9c42100141fce95f06aba7e85 deleted file mode 100644 index c178d4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/129328f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,309 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/12ebc6f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/12ebc6f8c42100141fce95f06aba7e85 deleted file mode 100644 index e2883e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/12ebc6f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import com.ngb.projectzulu.common.mobs.models.ModelMummyPharaoh; -import com.ngb.projectzulu.common.mobs.renders.RenderMummyPharaoh; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/32ff279fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/32ff279fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f8600cb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/32ff279fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityOstrich; -import projectzulu.common.mobs.models.ModelOstrich; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/414e519ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/414e519ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b941a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/414e519ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,330 +0,0 @@ -package projectzulu.common.core; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - - -public class ObfuscationHelper { - - /** - * Helper used to See if we are unObfuscated by checking for a known non-Obfuscated name - * return true if unObfuscated (eclipse), false if obfuscated (Minecraft) - * @param list - */ - public static boolean isUnObfuscated(Field[] fieldList, String desired){ - for (int i = 0; i < fieldList.length; i++) { - if(fieldList[i].getName().equals(desired)){ - return true; - } - } - return false; - } - - public static boolean isUnObfuscated(Class regularClass, String regularClassName){ - return regularClass.getSimpleName().equals(regularClassName); - } - - public static Object invokeMethod(String eclipseName, String seargeName, Class containingClass, - Object containterInstance, Object... args) { - try { - Method method; - method = getIntanceOfMethod(eclipseName, seargeName, containterInstance); - if (method == null) { - throw new NoSuchMethodException(); - } - method.setAccessible(true); - return method.invoke(containterInstance, args); - } catch (NoSuchMethodException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (InvocationTargetException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } - return null; - } - - private static Method getIntanceOfMethod(String eclipseName, String seargeName, Object containterInstance, Class... topClassToLook) { - Class classToSearch = containterInstance.getClass(); - while (classToSearch.getSuperclass() != null) { - for (Method method : classToSearch.getDeclaredMethods()) { - if (eclipseName.equalsIgnoreCase(method.getName()) || seargeName.equalsIgnoreCase(method.getName())) { - return method; - } - } - classToSearch = classToSearch.getSuperclass(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get Static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Class containingClass, Class type){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(null)); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Object containterInstance, Class type){ - return getFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Get Non-Static Field - */ - public static T getFieldFromReflection(String srgName, String sourceName, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(srgName, containterInstance.getClass(), containterInstance, type); - } catch (NoSuchFieldException e) { - return getFieldFromReflection(sourceName, containterInstance.getClass(), containterInstance, type); - } - } - - public static T getFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(fieldName, containingClass, containterInstance, type); - } catch (NoSuchFieldException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", - fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Object containterInstance, Class type) - throws NoSuchFieldException { - return getCatchableFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, Class type) - throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(containterInstance)); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value) throws NoSuchFieldException{ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - - public static Class getDeclaredClass(String className, Class containingClass){ - for (Class declaredClass : containingClass.getDeclaredClasses()) { - if(declaredClass.getSimpleName().equals(className)){ - return declaredClass; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/50206be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/50206be4c42100141fce95f06aba7e85 deleted file mode 100644 index 72744fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/50206be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,163 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.terrain.TerrainFeature; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/7133d4a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/7133d4a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2a2ad6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/7133d4a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRedFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedFinchDeclaration extends SpawnableDeclaration { - - public RedFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/811e6d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/811e6d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1e94ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/811e6d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandSingle extends BlockBrewingStandBase { - - public BlockBrewingStandSingle(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new TileEntityBrewingSingle(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/91f7f8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/91f7f8f8c42100141fce95f06aba7e85 deleted file mode 100644 index e62996f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/91f7f8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/a07eeae3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/a07eeae3c42100141fce95f06aba7e85 deleted file mode 100644 index 53dfefa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/a07eeae3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.api; - -import projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/c0fd36ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/c0fd36ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 13a01bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/c0fd36ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e1be9ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e1be9ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 71d3a24..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6c/e1be9ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/315f15e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/315f15e4c42100141fce95f06aba7e85 deleted file mode 100644 index f99f450..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/315f15e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelElephantHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - - public ModelElephantHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); -// setTextureOffset("EARLEFROT.earlef", 55, 41); -// setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 12F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -6F, 8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); -// EARLEFROT = new ModelRenderer(this, "EARLEFROT"); -// EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); -// setRotation(EARLEFROT, 0F, 1.22173F, 0F); -// EARLEFROT.mirror = true; -// EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARLEFROT); -// EARRIGROT = new ModelRenderer(this, "EARRIGROT"); -// EARRIGROT.setRotationPoint(7F, -0.5F, -4F); -// setRotation(EARRIGROT, 0F, -1.22173F, 0F); -// EARRIGROT.mirror = true; -// EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - TRUNK1ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK2ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK3ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK4ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK5ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK6ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK7ROT.rotateAngleX = (float) (45*Math.PI/180); - -// switch ((int)skullState) { -// case 1: -// NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); -// break; -// -// default: -// NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); -// break; -// } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/4030569ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/4030569ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65a6d4e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/4030569ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/50cbdd55322000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/50cbdd55322000141dbfc2e92eb0e949 deleted file mode 100644 index df7912b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/50cbdd55322000141dbfc2e92eb0e949 +++ /dev/null @@ -1,23 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void preinit(FMLPreInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Blocks.obsidian), - new Object[]{"AAA", "AAA", "AAA", "AAA", "A", Items.cookie }); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/61fd15fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/61fd15fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 29b6a08..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/61fd15fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/71d792e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/71d792e5c42100141fce95f06aba7e85 deleted file mode 100644 index 2831bbc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/71d792e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,190 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/8078cfa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/8078cfa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f8600cb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/8078cfa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityOstrich; -import projectzulu.common.mobs.models.ModelOstrich; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/816cc6ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/816cc6ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index fba617d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/816cc6ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockNightBloom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/8223049fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/8223049fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index edb277b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/8223049fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIWander extends EntityAIBase -{ - private EntityCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/a1b964fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/a1b964fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 24e3c7a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/a1b964fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/c0f8b69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/c0f8b69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6650835..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/c0f8b69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityHauntedArmor; - -public class HauntedArmorWithMeta extends BlockWithMeta { - - public HauntedArmorWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityHauntedArmor mob = new EntityHauntedArmor(world, position.posX + 0.5, position.posY, - position.posZ + 0.5, true); - mob.onSpawnWithEgg(null); - mob.setPersistenceRequired(true); - world.spawnEntityInWorld(mob); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/d0354ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/d0354ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index aef922f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/d0354ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/e1370cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/e1370cf6c42100141fce95f06aba7e85 deleted file mode 100644 index 2bea598..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6d/e1370cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00c799f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00c799f5c42100141fce95f06aba7e85 deleted file mode 100644 index 58347d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/00c799f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityArmadillo; -import com.ngb.projectzulu.common.mobs.models.ModelArmadillo; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ArmadilloDeclaration extends SpawnableDeclaration { - - public ArmadilloDeclaration() { - super("Armadillo", 0, EntityArmadillo.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 2, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (116 << 16) + (64 << 8) + 33; - eggColor2 = (60 << 16) + (51 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/31e97be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/31e97be4c42100141fce95f06aba7e85 deleted file mode 100644 index 6d6e322..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/31e97be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,132 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/32a772ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/32a772ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77a91fe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/32a772ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/504ae49fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/504ae49fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c6c5291..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/504ae49fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,220 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEnd implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - return getWallBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall); - } else { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/510270e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/510270e4c42100141fce95f06aba7e85 deleted file mode 100644 index b829ba7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/510270e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,60 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/70bb769fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/70bb769fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9089f09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/70bb769fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,349 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/715c62e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/715c62e6c42100141fce95f06aba7e85 deleted file mode 100644 index 4ba3899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/715c62e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/809133a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/809133a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8917d74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/809133a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,143 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a1a8639fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a1a8639fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9da4186..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a1a8639fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -public class RenderGenericLiving extends RenderLiving implements RenderWrapper { - - public final ResourceLocation livingTexture; - - public RenderGenericLiving(ModelBase modelBase, float shadowSize, ResourceLocation livingTexture) { - super(modelBase, shadowSize); - this.livingTexture = livingTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return livingTexture; - } - - @Override - public Render getRender() { - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a1a8eef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a1a8eef6c42100141fce95f06aba7e85 deleted file mode 100644 index 92324ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/a1a8eef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/b0a63201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/b0a63201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41a9502..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/b0a63201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMimic; -import projectzulu.common.mobs.models.ModelMimic; -import projectzulu.common.mobs.renders.RenderMimic; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MimicDeclaration extends EggableDeclaration { - - public MimicDeclaration() { - super("Mimic", 11, EntityMimic.class, null); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - shouldDespawn = false; - - eggColor1 = (171 << 16) + (121 << 8) + 45; - eggColor2 = (143 << 16) + (105 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 5); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/c199bd9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/c199bd9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f5e9a65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/c199bd9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBearHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBearHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 20F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d00daea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d00daea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 836549e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d00daea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlueFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d030b8fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d030b8fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4f1bbd7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6e/d030b8fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/0059a9bbc12100141ef3ba53df1d1c5a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/0059a9bbc12100141ef3ba53df1d1c5a deleted file mode 100644 index eea3460..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/0059a9bbc12100141ef3ba53df1d1c5a +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.compress(var2); //decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/00ada2fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/00ada2fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2ba5e41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/00ada2fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/11e6339fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/11e6339fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 30f2faf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/11e6339fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,182 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityBear; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/213af0f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/213af0f7c42100141fce95f06aba7e85 deleted file mode 100644 index 19ca43d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/213af0f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectLabyrinth; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/316b7cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/316b7cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ebcf6e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/316b7cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,66 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/41f117f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/41f117f9c42100141fce95f06aba7e85 deleted file mode 100644 index 1a368de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/41f117f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,353 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - 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(vec3, vec31); - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/504281fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/504281fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6524af5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/504281fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/61d0dda1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/61d0dda1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 688e868..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/61d0dda1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBlackBear extends ModelBear { - - public ModelBlackBear() { - super(0); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.0f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/71cc77fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/71cc77fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3fbe308..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/71cc77fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,127 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.core.ProjectZuluLog; - - -public class ParsingHelper { - - /** - * Attempt to Parse an Integer. Performs no filters. - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static int parseInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Integer. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static int parseFilteredInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Long. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static Long parseFilteredLong(String value, Long fallBack, String fieldName) { - try { - return Long.parseLong(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an long. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an long. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Float. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static float parseFilteredFloat(String value, float fallBack, String fieldName) { - try { - return Float.parseFloat(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Double. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static double parseFilteredDouble(String value, double fallBack, String fieldName) { - try { - return Double.parseDouble(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Boolean - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static boolean parseBoolean(String value, boolean fallBack, String fieldName) { - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for a boolean. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for a boolean. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } else { - return Boolean.parseBoolean(value); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/805a7df4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/805a7df4c42100141fce95f06aba7e85 deleted file mode 100644 index e7a552d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/805a7df4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public interface Blueprint { - - /** - * - * @param pieceLoc X,Y,Z Coordinate of Piece within Cell - * @param cellSize - * @param maxHeight - * @param xIndex - * @param zIndex - * @param random - * @param cellIndexDirection - * @return - */ - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection); - - /** - * Used to Search Architect list for a specific Building Type - * - * Type insensitive. Should be unique. - */ - public abstract String getIdentifier(); - - public abstract int getWeight(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/80ee5101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/80ee5101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0e54461..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/80ee5101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,596 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/812da3a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/812da3a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65979d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/812da3a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/a161c6fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/a161c6fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cec3595..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/a161c6fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -//package com.ngb.projectzulu.common.mobs.entityai; -// -//import net.minecraft.command.IEntitySelector; -//import net.minecraft.entity.EntityLiving; -//import projectzulu.common.mobs.EntityGenericCreature; -//import projectzulu.common.mobs.EntityStates; -// -//public class EntityZuluAINearestRevengeTarget extends EntityAINearestAttackableTarget{ -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5){ -// super(par1EntityLiving, par2Class, par3, par4, par5); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5, boolean par6){ -// super(par1EntityLiving, par2Class, par3, par4, par5, par6); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ -// super(par1, par2, par3, par4, par5, par6, par7IEntitySelector); -// } -// -// /** -// * Returns whether the EntityAIBase should begin execution. -// */ -// public boolean shouldExecute() { -// /* getAITarget acts as Tempory target timer, as it only lasts a few seconds, Reminder: getAttackTarget is the persistent form */ -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.shouldExecute(); -// } -// return false; -// } -// -// @Override -// public boolean continueExecuting() { -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.continueExecuting(); -// } -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/c260d601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/c260d601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index edf9557..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/c260d601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/d01cebfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/d01cebfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d5696d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/d01cebfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreePlank; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e0c14101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e0c14101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 061b5c8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e0c14101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import projectzulu.common.mobs.models.ModelTreeEnt; -import projectzulu.common.mobs.renders.RenderSnow; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e1c3aba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e1c3aba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77f61c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e1c3aba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBeaver; -import projectzulu.common.mobs.models.ModelBeaver; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BeaverDeclaration extends SpawnableDeclaration { - - public BeaverDeclaration() { - super("Beaver", 15, EntityBeaver.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (54 << 16) + (36 << 8) + 9; - eggColor2 = (67 << 16) + (45 << 8) + 11; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e1f667e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e1f667e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4b0ddc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/e1f667e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGorilla; -import projectzulu.common.mobs.models.ModelGorilla; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GorillaDeclaration extends SpawnableDeclaration { - - public GorillaDeclaration() { - super("Gorilla", 25, EntityGorilla.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (25 << 16) + (25 << 8) + 25; - eggColor2 = (93 << 16) + (93 << 8) + 93; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f06567f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f06567f8c42100141fce95f06aba7e85 deleted file mode 100644 index 5946778..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f06567f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionHarm; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionHeal; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionNightVision; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionPoison; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0da30b3652300141cbf9363b5b13b15 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0da30b3652300141cbf9363b5b13b15 deleted file mode 100644 index 1340621..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/6f/f0da30b3652300141cbf9363b5b13b15 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityYellowFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class YellowFinchDeclaration extends SpawnableDeclaration { - - public YellowFinchDeclaration() { - super("Yellow Finch", 22, EntityYellowFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_yellow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/0015f3e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/0015f3e4c42100141fce95f06aba7e85 deleted file mode 100644 index b1ed4fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/0015f3e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/115f85e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/115f85e4c42100141fce95f06aba7e85 deleted file mode 100644 index d222aa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/115f85e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityUniversalFlowerPotRenderer extends TileEntitySpecialRenderer { - private RenderBlocks blockRenderer = new RenderBlocks(); - private RenderItem itemRenderer = new RenderItem(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - - renderTileEntityUniversalFlowerPotAt((TileEntityUniversalFlowerPot) tileEntity, xRenderCoord, yRenderCoord, - zRenderCoord, var8); - } - - private void renderTileEntityUniversalFlowerPotAt(TileEntityUniversalFlowerPot tileEntity, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float var8) { - - ItemStack itemStackToRender = tileEntity.getStackInSlot(0); - - if (itemStackToRender != null) { - Item itemToRender = itemStackToRender.getItem(); - - /* Try to See if I should render as Block */ - if (itemToRender != null && itemToRender instanceof ItemBlock - && Block.getBlockFromItem(itemToRender).getRenderType() != -1) { - Block blockToRender = Block.getBlockFromItem(itemToRender); - int meta = itemStackToRender.getItemDamage() > 16 ? 16 : itemStackToRender.getItemDamage() < 0 ? 0 - : itemStackToRender.getItemDamage(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glPushMatrix(); - float scaleBlock = (float) (0.29f / (blockToRender.getBlockBoundsMaxX() - blockToRender - .getBlockBoundsMinX())); - float scaleY = (float) (scaleBlock * (blockToRender.getBlockBoundsMaxY() - blockToRender - .getBlockBoundsMinY())); - - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.2 + scaleY), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleBlock, scaleBlock, scaleBlock); - - float brightness = 15f; - this.blockRenderer.renderBlockAsItem(blockToRender, meta, brightness); - GL11.glPopMatrix(); - return; - } - - /* Finally, try to render as Item */ - if (itemToRender != null) { - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(tileEntity.getWorldObj(), xRenderCoord, yRenderCoord, - zRenderCoord, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 0.6f; - GL11.glPushMatrix(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - - } - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/21148fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/21148fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a45a598..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/21148fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/518e40f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/518e40f6c42100141fce95f06aba7e85 deleted file mode 100644 index 766ba0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/518e40f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/519079a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/519079a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cf86e68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/519079a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/60dd3800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/60dd3800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65e6f16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/60dd3800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,129 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData() - .func_150283_g(nodeList.get(clickedIndex).getData().getId()), nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/71e39bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/71e39bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 334db18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/71e39bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,173 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelRhino extends ModelBase { - float heightToRaise = 9f; - float renderScale = 1.6f; - - ModelRenderer LEG3ROT; - ModelRenderer LEG4ROT; - ModelRenderer LEG2ROT; - ModelRenderer HEADROT; - ModelRenderer LEG1ROT; - ModelRenderer TAILROT; - ModelRenderer BODYROT; - - public ModelRhino() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG3ROT.leg3", 48, 13); - setTextureOffset("LEG3ROT.toe31", 0, 0); - setTextureOffset("LEG3ROT.toe32", 0, 0); - setTextureOffset("LEG3ROT.toe33", 0, 0); - setTextureOffset("LEG4ROT.leg4", 68, 13); - setTextureOffset("LEG4ROT.toe41", 0, 0); - setTextureOffset("LEG4ROT.toe42", 0, 0); - setTextureOffset("LEG4ROT.toe43", 0, 0); - setTextureOffset("LEG2ROT.leg2", 68, 0); - setTextureOffset("LEG2ROT.toe21", 0, 0); - setTextureOffset("LEG2ROT.toe22", 0, 0); - setTextureOffset("LEG2ROT.toe23", 0, 0); - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - setTextureOffset("LEG1ROT.toe11", 0, 0); - setTextureOffset("LEG1ROT.toe12", 0, 0); - setTextureOffset("LEG1ROT.toe13", 0, 0); - setTextureOffset("LEG1ROT.leg1", 48, 0); - setTextureOffset("TAILROT.tail", 0, 25); - setTextureOffset("BODYROT.leg1dec", 20, 25); - setTextureOffset("BODYROT.leg2dec", 20, 25); - setTextureOffset("BODYROT.body", 0, 32); - - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG3ROT.addBox("toe31", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe32", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe33", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG4ROT.addBox("toe41", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe42", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe43", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(4F, 15F - heightToRaise, -5F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2.5F, 1F, -2.5F, 5, 8, 5); - LEG2ROT.addBox("toe21", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe22", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe23", 1.5F, 8F, -3.5F, 1, 1, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 9F - heightToRaise, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-4F, 15F - heightToRaise, -5F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("toe11", -2.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe12", -0.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe13", 1.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("leg1", -2.5F, 1F, -2F, 5, 8, 5); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 9F - heightToRaise, 12F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.5F, -0.5F, 0F, 1, 1, 6); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F - heightToRaise, -8F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("leg1dec", -7F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("leg2dec", 1F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("body", -7F, -7F, 0F, 14, 12, 20); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 6.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(renderScale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - GL11.glPopMatrix(); - } else { - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - HEADROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Constant Animation Rotations */ - LEG1ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - TAILROT.rotateAngleX = (float) (-90 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/819999f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/819999f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1073f83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/819999f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,1046 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import com.ngb.projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/b0db55a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/b0db55a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e446697..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/b0db55a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/e05507f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/e05507f6c42100141fce95f06aba7e85 deleted file mode 100644 index 19dc8d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/e05507f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/f0a4a59dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/f0a4a59dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9f416c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7/f0a4a59dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/100418ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/100418ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index fe891c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/100418ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/10cf93a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/10cf93a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0e74eb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/10cf93a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,114 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/400052a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/400052a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 05a40e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/400052a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/40354700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/40354700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 236b80c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/40354700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/70395fe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/70395fe4c42100141fce95f06aba7e85 deleted file mode 100644 index 3496413..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/70395fe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,419 +0,0 @@ -package projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/80cb61f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/80cb61f9c42100141fce95f06aba7e85 deleted file mode 100644 index dfc7ba1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/80cb61f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/80e97af4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/80e97af4c42100141fce95f06aba7e85 deleted file mode 100644 index 0ae9abc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/80e97af4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MimicWithMeta; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintDeadEndChest implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY == 1) { - if (random.nextInt(8) == 0) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else if (random.nextInt(8) == 1) { - return new MimicWithMeta(); - } - } - - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "deadend"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a1fdb9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a1fdb9f9c42100141fce95f06aba7e85 deleted file mode 100644 index c53b39c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/a1fdb9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,150 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - player.posY + player.getEyeHeight(), player.posZ), - worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - entity.posZ)) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/b1ede9f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/b1ede9f6c42100141fce95f06aba7e85 deleted file mode 100644 index d179fd8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/b1ede9f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemWateredDirt extends ItemBlock { - - public ItemWateredDirt(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "soil_1"; - break; - } - case 1: { - name = "soil_2"; - break; - } - case 2: { - name = "soil_3"; - break; - } - case 3: { - name = "soil_4"; - break; - } - case 4: { - name = "sand_1"; - break; - } - case 5: { - name = "sand_2"; - break; - } - case 6: { - name = "sand_3"; - break; - } - case 7: { - name = "sand_4"; - break; - } - default: - name = "ore"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/c07abafec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/c07abafec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3e0c3dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/c07abafec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,114 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/d0cf4d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/d0cf4d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d66a581..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/d0cf4d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e07a8656bdab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e07a8656bdab00141ee9bf3050c1025b new file mode 100644 index 0000000..2e1c96c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e07a8656bdab00141ee9bf3050c1025b @@ -0,0 +1,289 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(6); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.grass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(50) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e187449fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e187449fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1d46da4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/e187449fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/f02fc801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/f02fc801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b34956..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/f02fc801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.api.BlockList; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/f186aa9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/f186aa9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cbd8e09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/70/f186aa9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/0112c6f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/0112c6f6c42100141fce95f06aba7e85 deleted file mode 100644 index e32c264..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/0112c6f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerUniversalFlowerPot extends Container{ - protected TileEntityUniversalFlowerPot tileEntity; - - public ContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntityUniversalFlowerPot){ - this.tileEntity = tileEntityUniversalFlowerPot; - - // The Slot constructor takes the IInventory and the slot number in that it binds to - // and the x-y coordinates it resides on-screen - addSlotToContainer(new Slot(tileEntity, 0, 79, 17)); - - // Commonly used vanilla code that adds the player's inventory - bindPlayerInventory(inventoryPlayer); - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return tileEntity.isUseableByPlayer(player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { - ItemStack stack = null; - Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) - if (slotObject != null && slotObject.getHasStack()) { - ItemStack stackInSlot = slotObject.getStack(); - stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity - //this assumes only 1 slot, for inventories with > 1 slots, check out the Chest Container. - if (slot == 0) { - if (!mergeItemStack(stackInSlot, 1, inventorySlots.size(), true)) { - return null; - } - //places it into the tileEntity is possible since its in the player inventory - } else if (!mergeItemStack(stackInSlot, 0, 1, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slotObject.putStack(null); - } else { - slotObject.onSlotChanged(); - } - } - - return stack; - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/2117edf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/2117edf5c42100141fce95f06aba7e85 deleted file mode 100644 index dbf68d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/2117edf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,105 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/308e259fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/308e259fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 68b5fde..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/308e259fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMammoth; -import projectzulu.common.mobs.models.ModelMammoth; -import projectzulu.common.mobs.renders.RenderMammoth; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/31a785f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/31a785f9c42100141fce95f06aba7e85 deleted file mode 100644 index 8168abf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/31a785f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,5 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -public enum ListType { - NONE, Creature, Sound; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/4046e7a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/4046e7a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2831bbc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/4046e7a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,190 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/4076eb9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/4076eb9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9affe18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/4076eb9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,95 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY % 2 == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "cemeterytomb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/41d3abf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/41d3abf6c42100141fce95f06aba7e85 deleted file mode 100644 index 6da58f1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/41d3abf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,25 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public interface EntityDeclaration { - public abstract boolean shouldExist(); - - /** - * Returns the Entities Unique Identifier. Typically the Entity name, i.e. "Alligator" or "Red Finch" - */ - public abstract String getIdentifier(); - public abstract void loadCreaturesFromConfig(Configuration config); - public abstract void loadBiomesFromConfig(Configuration config); - public abstract void loadCustomMobData(File configDirectory); - public abstract void registerEntity(); - public abstract void registerEgg(); - public abstract void addSpawn(); - - @SideOnly(Side.CLIENT) - public abstract void registerModelAndRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/5031809fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/5031809fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 581f7d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/5031809fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionIncendiary extends PotionZulu { - - public PotionIncendiary(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(1, 2); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int par2) { - super.performEffect(par1EntityLiving, par2); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int par3, double par4) { - par2EntityLiving.setFire((int) (2 + 1.5 * par3)); - super.affectEntity(par1EntityLiving, par2EntityLiving, par3, par4); - } - - @Override - public boolean isInstant() { - return true; - } - - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c06c71e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c06c71e5c42100141fce95f06aba7e85 deleted file mode 100644 index a8ab7da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c06c71e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0d018f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0d018f8c42100141fce95f06aba7e85 deleted file mode 100644 index aed0942..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c0d018f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c255ec9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c255ec9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b199ab3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c255ec9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c2e97cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c2e97cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 71cd7da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/71/c2e97cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotBrewingStandSingleIngredient extends Slot { - /** The brewing stand this slot belongs to. */ - final ContainerBrewingStandSingle brewingStand; - - public SlotBrewingStandSingleIngredient(ContainerBrewingStandSingle par1ContainerBrewingStand, - IInventory par2IInventory, int par3, int par4, int par5) { - super(par2IInventory, par3, par4, par5); - this.brewingStand = par1ContainerBrewingStand; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - if (par1ItemStack == null) { - return false; - } - - return PotionIngredients.isPotionIngredient(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 64; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00ce69a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00ce69a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 98a7f14..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/00ce69a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockWateredDirt; -import projectzulu.common.blocks.ItemWateredDirt; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/211c5300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/211c5300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ceb4169..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/211c5300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30605d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30605d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 28bc461..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/30605d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,524 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityVulture; - -public class ModelVulture extends ModelBase { - ModelRenderer FEETROT; - ModelRenderer BODYROT; - - ModelRenderer rightfootfronttal2; - ModelRenderer rightfootfronttal1; - ModelRenderer rigfootbacktal; - ModelRenderer rightfootbase; - ModelRenderer rightfoottoe1; - ModelRenderer rightfoottoe2; - ModelRenderer rightleg; - - ModelRenderer leftfootfronttal2; - ModelRenderer leftfootfronttal1; - ModelRenderer leftfootbacktal; - ModelRenderer leftfootbase; - ModelRenderer leftfoottoe1; - ModelRenderer leftfoottoe2; - ModelRenderer leftleg; - - ModelRenderer LEFTWING; - ModelRenderer wingleft4; - ModelRenderer wingleft3; - ModelRenderer wingleft2; - ModelRenderer wingleft1; - - ModelRenderer RIGTHWING; - ModelRenderer wingrig4; - ModelRenderer wingrig3; - ModelRenderer wingrig2; - ModelRenderer wingrig1; - - ModelRenderer NECKROT1; - ModelRenderer NECKROT2; - ModelRenderer NECKROT3; - - ModelRenderer neck1; - ModelRenderer neck2; - ModelRenderer neck3; - - ModelRenderer HEADROT; - ModelRenderer mouthbot; - ModelRenderer mouthtop; - ModelRenderer mouthtal; - ModelRenderer head; - - ModelRenderer TAILROT; - ModelRenderer tailbase1; - ModelRenderer tailbase2; - - ModelRenderer neckfrill; - ModelRenderer chestpuff; - ModelRenderer Body; - - public ModelVulture() { - textureWidth = 64; - textureHeight = 32; - float xCorrection = -1.0f; - - FEETROT = new ModelRenderer(this, "FEETROT"); - FEETROT.setRotationPoint(0.5F - xCorrection, 18F, -6F); - setRotation(FEETROT, 0F, 0F, 0F); - FEETROT.mirror = true; - rightfootfronttal2 = new ModelRenderer(this, 39, 4); - rightfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal2); - rightfootfronttal2.setRotationPoint(2.5F, 12F, -1F); - rightfootfronttal2.setTextureSize(64, 32); - rightfootfronttal2.mirror = true; - setRotation(rightfootfronttal2, 0F, 0F, 0F); - rightfootfronttal1 = new ModelRenderer(this, 39, 4); - rightfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfootfronttal1); - rightfootfronttal1.setRotationPoint(4.5F, 12F, -1F); - rightfootfronttal1.setTextureSize(64, 32); - rightfootfronttal1.mirror = true; - setRotation(rightfootfronttal1, 0F, 0F, 0F); - leftfootfronttal2 = new ModelRenderer(this, 39, 4); - leftfootfronttal2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal2); - leftfootfronttal2.setRotationPoint(-1.5F, 12F, -1F); - leftfootfronttal2.setTextureSize(64, 32); - leftfootfronttal2.mirror = true; - setRotation(leftfootfronttal2, 0F, 0F, 0F); - leftfootfronttal1 = new ModelRenderer(this, 39, 4); - leftfootfronttal1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootfronttal1); - leftfootfronttal1.setRotationPoint(0.5F, 12F, -1F); - leftfootfronttal1.setTextureSize(64, 32); - leftfootfronttal1.mirror = true; - setRotation(leftfootfronttal1, 0F, 0F, 0F); - leftfootbacktal = new ModelRenderer(this, 39, 4); - leftfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfootbacktal); - leftfootbacktal.setRotationPoint(-0.5F, 11F, 2F); - leftfootbacktal.setTextureSize(64, 32); - leftfootbacktal.mirror = true; - setRotation(leftfootbacktal, 0F, 0F, 0F); - rightfoottoe2 = new ModelRenderer(this, 32, 3); - rightfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe2); - rightfoottoe2.setRotationPoint(2.5F, 11F, -1F); - rightfoottoe2.setTextureSize(64, 32); - rightfoottoe2.mirror = true; - setRotation(rightfoottoe2, 0F, 0F, 0F); - leftfoottoe2 = new ModelRenderer(this, 32, 3); - leftfoottoe2.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe2); - leftfoottoe2.setRotationPoint(-1.5F, 11F, -1F); - leftfoottoe2.setTextureSize(64, 32); - leftfoottoe2.mirror = true; - setRotation(leftfoottoe2, 0F, 0F, 0F); - leftfootbase = new ModelRenderer(this, 32, 0); - leftfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(leftfootbase); - leftfootbase.setRotationPoint(-1.5F, 11F, 0F); - leftfootbase.setTextureSize(64, 32); - leftfootbase.mirror = true; - setRotation(leftfootbase, 0F, 0F, 0F); - leftfoottoe1 = new ModelRenderer(this, 32, 3); - leftfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(leftfoottoe1); - leftfoottoe1.setRotationPoint(0.5F, 11F, -1F); - leftfoottoe1.setTextureSize(64, 32); - leftfoottoe1.mirror = true; - setRotation(leftfoottoe1, 0F, 0F, 0F); - rigfootbacktal = new ModelRenderer(this, 39, 4); - rigfootbacktal.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rigfootbacktal); - rigfootbacktal.setRotationPoint(3.5F, 11F, 2F); - rigfootbacktal.setTextureSize(64, 32); - rigfootbacktal.mirror = true; - setRotation(rigfootbacktal, 0F, 0F, 0F); - rightfoottoe1 = new ModelRenderer(this, 32, 3); - rightfoottoe1.addBox(-2F, -7F, -1.5F, 1, 1, 1); - FEETROT.addChild(rightfoottoe1); - rightfoottoe1.setRotationPoint(4.5F, 11F, -1F); - rightfoottoe1.setTextureSize(64, 32); - rightfoottoe1.mirror = true; - setRotation(rightfoottoe1, 0F, 0F, 0F); - rightfootbase = new ModelRenderer(this, 32, 0); - rightfootbase.addBox(-2F, -7F, -1.5F, 3, 1, 2); - FEETROT.addChild(rightfootbase); - rightfootbase.setRotationPoint(2.5F, 11F, 0F); - rightfootbase.setTextureSize(64, 32); - rightfootbase.mirror = true; - setRotation(rightfootbase, 0F, 0F, 0F); - rightleg = new ModelRenderer(this, 20, 27); - rightleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(rightleg); - rightleg.setRotationPoint(3.5F, 7F, 1F); - rightleg.setTextureSize(64, 32); - rightleg.mirror = true; - setRotation(rightleg, 0F, 0F, 0F); - leftleg = new ModelRenderer(this, 16, 27); - leftleg.addBox(-2F, -7F, -1.5F, 1, 4, 1); - FEETROT.addChild(leftleg); - leftleg.setRotationPoint(-0.5F, 7F, 1F); - leftleg.setTextureSize(64, 32); - leftleg.mirror = true; - setRotation(leftleg, 0F, 0F, 0F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F - xCorrection, 17.5F, -6F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - - LEFTWING = new ModelRenderer(this, "LEFTWING"); - LEFTWING.setRotationPoint(-1.5F, -6F, 0F); - BODYROT.addChild(LEFTWING); - setRotation(LEFTWING, 0F, 0F, 0F); - LEFTWING.mirror = true; - wingleft4 = new ModelRenderer(this, 16, 18); - wingleft4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - LEFTWING.addChild(wingleft4); - wingleft4.setRotationPoint(0F, 12.5F, 0F); - wingleft4.setTextureSize(64, 32); - wingleft4.mirror = true; - setRotation(wingleft4, 0F, 0F, 0F); - wingleft3 = new ModelRenderer(this, 16, 11); - wingleft3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - LEFTWING.addChild(wingleft3); - wingleft3.setRotationPoint(0F, 10.5F, 0F); - wingleft3.setTextureSize(64, 32); - wingleft3.mirror = true; - setRotation(wingleft3, 0F, 0F, 0F); - wingleft2 = new ModelRenderer(this, 16, 5); - wingleft2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - LEFTWING.addChild(wingleft2); - wingleft2.setRotationPoint(0F, 8.5F, 0F); - wingleft2.setTextureSize(64, 32); - wingleft2.mirror = true; - setRotation(wingleft2, 0F, 0F, 0F); - wingleft1 = new ModelRenderer(this, 16, 0); - wingleft1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - LEFTWING.addChild(wingleft1); - wingleft1.setRotationPoint(0F, 6.5F, 0F); - wingleft1.setTextureSize(64, 32); - wingleft1.mirror = true; - setRotation(wingleft1, 0F, 0F, 0F); - - RIGTHWING = new ModelRenderer(this, "RIGTHWING"); - RIGTHWING.setRotationPoint(2F, -6F, 0F); - BODYROT.addChild(RIGTHWING); - setRotation(RIGTHWING, 0F, 0F, 0F); - RIGTHWING.mirror = true; - wingrig4 = new ModelRenderer(this, 16, 18); - wingrig4.addBox(-2F, -7F, -1.5F, 1, 2, 6); - RIGTHWING.addChild(wingrig4); - wingrig4.setRotationPoint(2.5F, 12.5F, 0F); - wingrig4.setTextureSize(64, 32); - wingrig4.mirror = true; - setRotation(wingrig4, 0F, 0F, 0F); - wingrig3 = new ModelRenderer(this, 16, 11); - wingrig3.addBox(-2F, -7F, -1.5F, 1, 2, 5); - RIGTHWING.addChild(wingrig3); - wingrig3.setRotationPoint(2.5F, 10.5F, 0F); - wingrig3.setTextureSize(64, 32); - wingrig3.mirror = true; - setRotation(wingrig3, 0F, 0F, 0F); - wingrig2 = new ModelRenderer(this, 16, 5); - wingrig2.addBox(-2F, -7F, -1.5F, 1, 2, 4); - RIGTHWING.addChild(wingrig2); - wingrig2.setRotationPoint(2.5F, 8.5F, 0F); - wingrig2.setTextureSize(64, 32); - wingrig2.mirror = true; - setRotation(wingrig2, 0F, 0F, 0F); - wingrig1 = new ModelRenderer(this, 16, 0); - wingrig1.addBox(-2F, -7F, -1.5F, 1, 2, 3); - RIGTHWING.addChild(wingrig1); - wingrig1.setRotationPoint(2.5F, 6.5F, 0F); - wingrig1.setTextureSize(64, 32); - wingrig1.mirror = true; - setRotation(wingrig1, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -7.5F, 0F); - BODYROT.addChild(NECKROT1); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - NECKROT1.addChild(NECKROT2); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - neck2 = new ModelRenderer(this, 8, 10); - neck2.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT2.addChild(neck2); - neck2.setRotationPoint(0F, 1F, 0F); - neck2.setTextureSize(64, 32); - neck2.mirror = true; - setRotation(neck2, 0F, 0F, 0F); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - NECKROT2.addChild(NECKROT3); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - NECKROT3.addChild(HEADROT); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - mouthbot = new ModelRenderer(this, 0, 25); - mouthbot.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADROT.addChild(mouthbot); - mouthbot.setRotationPoint(0F, 1F, -2F); - mouthbot.setTextureSize(64, 32); - mouthbot.mirror = true; - setRotation(mouthbot, 0F, 0F, 0F); - mouthtal = new ModelRenderer(this, 6, 25); - mouthtal.addBox(-1F, 0F, -0.5F, 2, 2, 1); - HEADROT.addChild(mouthtal); - mouthtal.setRotationPoint(0F, 0.5F, -4.5F); - mouthtal.setTextureSize(64, 32); - mouthtal.mirror = true; - setRotation(mouthtal, 0F, 0F, 0F); - mouthtop = new ModelRenderer(this, 0, 21); - mouthtop.addBox(-1F, -1.5F, -3F, 2, 1, 3); - HEADROT.addChild(mouthtop); - mouthtop.setRotationPoint(0F, 1F, -2F); - mouthtop.setTextureSize(64, 32); - mouthtop.mirror = true; - setRotation(mouthtop, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 16); - head.addBox(-1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - neck3 = new ModelRenderer(this, 8, 10); - neck3.addBox(-0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3.addChild(neck3); - neck3.setRotationPoint(0F, 0F, 0F); - neck3.setTextureSize(64, 32); - neck3.mirror = true; - setRotation(neck3, 0F, 0F, 0F); - neck1 = new ModelRenderer(this, 8, 10); - neck1.addBox(-0.5F, -3F, -0.5F, 1, 2, 1); - NECKROT1.addChild(neck1); - neck1.setRotationPoint(0F, 1F, 0F); - neck1.setTextureSize(64, 32); - neck1.mirror = true; - setRotation(neck1, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 1F); - BODYROT.addChild(TAILROT); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tailbase1.mirror = true; - tailbase1 = new ModelRenderer(this, 32, 8); - tailbase1.addBox(-1F, -0.5F, 0F, 2, 1, 2); - TAILROT.addChild(tailbase1); - tailbase1.setRotationPoint(0F, 0F, 0F); - tailbase1.setTextureSize(64, 32); - tailbase1.mirror = true; - setRotation(tailbase1, 0F, 0F, 0F); - tailbase1.mirror = false; - tailbase2 = new ModelRenderer(this, 32, 11); - tailbase2.addBox(-1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addChild(tailbase2); - tailbase2.setRotationPoint(0F, 0F, 2F); - tailbase2.setTextureSize(64, 32); - tailbase2.mirror = true; - setRotation(tailbase2, 0F, 0F, 0F); - neckfrill = new ModelRenderer(this, 0, 28); - neckfrill.addBox(0F, 0F, 0F, 2, 1, 2); - neckfrill.setRotationPoint(-1F, -7.5F, -1F); - BODYROT.addChild(neckfrill); - neckfrill.setTextureSize(64, 32); - neckfrill.mirror = true; - setRotation(neckfrill, 0F, 0F, 0F); - chestpuff = new ModelRenderer(this, 0, 10); - chestpuff.addBox(-2F, -7F, -1.5F, 3, 5, 1); - chestpuff.setRotationPoint(0.5F, 0.5F, -1F); - BODYROT.addChild(chestpuff); - chestpuff.setTextureSize(64, 32); - chestpuff.mirror = true; - setRotation(chestpuff, 0F, 0F, 0F); - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-2F, -7F, -1.5F, 5, 7, 3); - BODYROT.addChild(Body); - Body.setRotationPoint(-0.5F, 0.5F, 0F); - Body.setTextureSize(64, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - FEETROT.render(f5); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - FEETROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityVulture var5 = (EntityVulture) par1EntityLiving; - - if (var5.eFEETROT.isSetup == false) { - var5.eFEETROT.setup(FEETROT); - } - if (var5.eBODYROT.isSetup == false) { - var5.eBODYROT.setup(BODYROT); - } - - if (var5.eLEFTWING.isSetup == false) { - var5.eLEFTWING.setup(LEFTWING); - } - if (var5.ewingleft4.isSetup == false) { - var5.ewingleft4.setup(wingleft4); - } - if (var5.ewingleft3.isSetup == false) { - var5.ewingleft3.setup(wingleft3); - } - if (var5.ewingleft2.isSetup == false) { - var5.ewingleft2.setup(wingleft2); - } - if (var5.ewingleft1.isSetup == false) { - var5.ewingleft1.setup(wingleft1); - } - - if (var5.eRIGTHWING.isSetup == false) { - var5.eRIGTHWING.setup(RIGTHWING); - } - if (var5.ewingrig4.isSetup == false) { - var5.ewingrig4.setup(wingrig4); - } - if (var5.ewingrig3.isSetup == false) { - var5.ewingrig3.setup(wingrig3); - } - if (var5.ewingrig2.isSetup == false) { - var5.ewingrig2.setup(wingrig2); - } - if (var5.ewingrig1.isSetup == false) { - var5.ewingrig1.setup(wingrig1); - } - - if (var5.eNECKROT1.isSetup == false) { - var5.eNECKROT1.setup(NECKROT1); - } - if (var5.eNECKROT2.isSetup == false) { - var5.eNECKROT2.setup(NECKROT2); - } - if (var5.eNECKROT3.isSetup == false) { - var5.eNECKROT3.setup(NECKROT3); - } - - if (var5.eHEADROT.isSetup == false) { - var5.eHEADROT.setup(HEADROT); - } - if (var5.eTAILROT.isSetup == false) { - var5.eTAILROT.setup(TAILROT); - } - - if (var5.onGround) { - float animSpeed = 2.0f; - /* On Ground Idle Standing Animation */ - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), 0f); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+15 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+35 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 0); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 0); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (15 * Math.PI / 180f)); - - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - /* Attacking Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (45 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(-0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(+0.09f * animSpeed, (float) (+20 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(+0.09f * animSpeed, (float) (+40 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(-0.09f * animSpeed, (float) (15 * Math.PI / 180f), - (float) (40 * Math.PI / 180f)); - } else if (var5.getEntityState() == EntityStates.idle) { - /* Idle Flying Animation */ - float animSpeed = 2.0f; - FEETROT.rotateAngleX = var5.eFEETROT.rotateX(+0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (55 * Math.PI / 180f)); - NECKROT1.rotateAngleX = var5.eNECKROT1.rotateX(+0.09f * animSpeed, (float) (-30 * Math.PI / 180f), - (float) (+30 * Math.PI / 180f)); - NECKROT2.rotateAngleX = var5.eNECKROT2.rotateX(-0.09f * animSpeed, (float) (+5 * Math.PI / 180f), - (float) (+40 * Math.PI / 180f)); - NECKROT3.rotateAngleX = var5.eNECKROT3.rotateX(-0.09f * animSpeed, (float) (+10 * Math.PI / 180f), - (float) (+60 * Math.PI / 180f)); - - LEFTWING.rotateAngleZ = var5.eLEFTWING.rotateZ(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (90 * Math.PI / 180f), 2); - RIGTHWING.rotateAngleZ = var5.eRIGTHWING.rotateZ(-0.09f * animSpeed, (float) (-90 * Math.PI / 180f), - (float) (0 * Math.PI / 180f), 2); - - BODYROT.rotateAngleX = var5.eBODYROT.rotateX(+0.09f * animSpeed, (float) (0 * Math.PI / 180f), - (float) (60 * Math.PI / 180f)); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityVulture var5 = (EntityVulture) par7Entity; - float lookingDirectionX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.onGround) { - HEADROT.rotateAngleX = (float) (-70 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.attacking || var5.getEntityState() == EntityStates.following) { - HEADROT.rotateAngleX = (float) (-60 * Math.PI / 180f) + lookingDirectionX; - } else if (var5.getEntityState() == EntityStates.idle) { - HEADROT.rotateAngleX = (float) (-80 * Math.PI / 180f) + lookingDirectionX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/40d141e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/40d141e5c42100141fce95f06aba7e85 deleted file mode 100644 index 89c12e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/40d141e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,202 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/4130e1f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/4130e1f5c42100141fce95f06aba7e85 deleted file mode 100644 index a5a2abf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/4130e1f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/604424a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/604424a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 88bb27a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/604424a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,109 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/61945fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/61945fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e69462a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/61945fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetTreasureDeadEnd implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetTreasureDeadEnd() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "deadend"; - } - - @Override - public int getWeight() { - return 50; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - cells[buildCoords.x][buildCoords.y].rawState = 2; - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 && ArchitectBase.isDeadEnd(cells, buildCoords, 1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1) { - if (random.nextInt(5) == 0) { - PyramidFeature terrainFeature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), terrainFeature.chestLootChance, - terrainFeature.chestMaxLoot); - - } else if (random.nextInt(4) == 0) { - return new MimicWithMeta(); - } - } - return new BlockWithMeta(Blocks.air); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/708e9f00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/708e9f00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 495fc3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/708e9f00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/91f086e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/91f086e5c42100141fce95f06aba7e85 deleted file mode 100644 index 41f8886..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/91f086e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,140 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBeaver extends ModelBase { - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer HEADROT; - ModelRenderer TAILROT; - - public ModelBeaver() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - setTextureOffset("TAILROT.tail1", 0, 0); - setTextureOffset("TAILROT.tail2", 0, 3); - setTextureOffset("TAILROT.tail3", 0, 5); - setTextureOffset("TAILROT.tail4", 12, 0); - setTextureOffset("TAILROT.tail5", 12, 5); - - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -4F, -10F, 9, 8, 10); - body.setRotationPoint(0F, 18F, 7F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 8, 10); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - leg4.setRotationPoint(3.5F, 22F, 6F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 10); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - leg3.setRotationPoint(-3.5F, 22F, 6F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 10); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - leg1.setRotationPoint(-3.5F, 22F, -2F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 8, 10); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - leg2.setRotationPoint(3.5F, 22F, -2F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 18F, -3F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 1F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 3F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 3F, -5F, 1, 1, 1); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 7F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail1", -1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addBox("tail2", -2F, -0.5F, 2F, 4, 1, 1); - TAILROT.addBox("tail3", -2.5F, -0.5F, 3F, 5, 1, 1); - TAILROT.addBox("tail4", -3F, -0.5F, 4F, 6, 1, 4); - TAILROT.addBox("tail5", -2.5F, -0.5F, 8F, 5, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - HEADROT.render(f5); - TAILROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - TAILROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a0785fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a0785fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee7feb4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a0785fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Class Holds Entity Age Methods - * such as setting and saving age - */ -public class EntityGenericAgeable extends EntityGenericCreature{ - - public EntityGenericAgeable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Growing Age */ - this.dataWatcher.addObject(12, new Integer(0)); - } - /** - * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's - * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the - * Entity is considered a child. - */ - public int getGrowingAge() { return this.dataWatcher.getWatchableObjectInt(12); } - public void setGrowingAge(int par1) { this.dataWatcher.updateObject(12, Integer.valueOf(par1)); } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onUpdate() { - super.onUpdate(); - int var1 = this.getGrowingAge(); - - if (var1 < 0){ - ++var1; - this.setGrowingAge(var1); - } - else if (var1 > 0){ - --var1; - this.setGrowingAge(var1); - } - } - - @Override - public boolean isChild() { - return getGrowingAge() < 0; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a0dfbef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a0dfbef9c42100141fce95f06aba7e85 deleted file mode 100644 index 0f20b98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/a0dfbef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraftforge.common.config.Configuration; - -public class EntityProperties { - public final float maxHealth; - public final float attackDamage; - public final float moveSpeed; - public final float followRange; - public final float knockbackResistance; - public final float flightChance; - - public EntityProperties(float health, float strength, float moveSpeed) { - this(health, strength, moveSpeed, 0); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance) { - this(health, strength, moveSpeed, flightChance, 0.0f, 32.0f); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance, float knockback, float followRange) { - this.maxHealth = health; - this.attackDamage = strength; - this.moveSpeed = moveSpeed; - this.flightChance = flightChance; - this.knockbackResistance = knockback; - this.followRange = followRange; - } - - public EntityProperties createFromConfig(Configuration config, String entityName) { - float maxHealth = (float) config.get("MOB CONTROLS." + entityName, "maxHealth", this.maxHealth).getDouble( - this.maxHealth); - float attackDamage = (float) config.get("MOB CONTROLS." + entityName, "attackDamage", this.attackDamage) - .getDouble(this.attackDamage); - float moveSpeed = (float) config.get("MOB CONTROLS." + entityName, "moveSpeed", this.moveSpeed).getDouble( - this.moveSpeed); - float flightChance = (float) config.get("MOB CONTROLS." + entityName, "flightChance", this.flightChance) - .getDouble(this.flightChance); - float knockbackResistance = (float) config.get("MOB CONTROLS." + entityName, "knockbackResistance", - this.knockbackResistance).getDouble(this.knockbackResistance); - float followRange = (float) config.get("MOB CONTROLS." + entityName, "followRange", this.followRange) - .getDouble(this.followRange); - return new EntityProperties(maxHealth, attackDamage, moveSpeed, flightChance, knockbackResistance, followRange); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b042b5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b042b5f9c42100141fce95f06aba7e85 deleted file mode 100644 index 04ac8ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/b042b5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/f09c3ba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/f09c3ba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0c3ad1f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/72/f09c3ba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/01cc30f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/01cc30f5c42100141fce95f06aba7e85 deleted file mode 100644 index 7e6b4f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/01cc30f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,439 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntitySandWorm; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/108279d1022100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/108279d1022100141769cb1ed0c338cd deleted file mode 100644 index dbbd6ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/108279d1022100141769cb1ed0c338cd +++ /dev/null @@ -1,234 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import net.minecraft.entity.*; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAIPanic; -//import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 0.38F)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/10e6339fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/10e6339fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4c72756..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/10e6339fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,277 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelArmadillo extends ModelBase { - public ModelRenderer WHOLE; - public ModelRenderer HEADPIECE; - public ModelRenderer REARRTR1; - public ModelRenderer REARRTR2; - public ModelRenderer REARRTR3; - - public ModelRenderer leg1; - public ModelRenderer leg2; - public ModelRenderer leg3; - public ModelRenderer leg4; - public ModelRenderer body2; - public ModelRenderer tail; - public ModelRenderer body1; - public ModelRenderer body3; - public ModelRenderer body4; - - public ModelRenderer chin; - public ModelRenderer head; - public ModelRenderer nose; - - public ModelArmadillo() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("WHOLE.dltfold0", 0, 0); - - WHOLE = new ModelRenderer(this, "WHOLE"); - WHOLE.setRotationPoint(0F, 18F, 0F); - // WHOLE.setRotationPoint(0F, 0F, 0F); - WHOLE.mirror = true; - setRotation(WHOLE, 0F, 0F, 0F); - - REARRTR1 = new ModelRenderer(this, "REARRTR1"); - WHOLE.addChild(REARRTR1); - REARRTR1.setRotationPoint(0F, -3F, -2F); - setRotation(REARRTR1, 0F, 0F, 0F); - REARRTR1.mirror = true; - body2 = new ModelRenderer(this, 32, 0); - body2.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR1.addChild(body2); - body2.setRotationPoint(0F, 3F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - REARRTR2 = new ModelRenderer(this, "REARRTR2"); - REARRTR1.addChild(REARRTR2); - REARRTR2.setRotationPoint(0F, -1F, 4F); - setRotation(REARRTR2, 0F, 0F, 0F); - REARRTR2.mirror = true; - body3 = new ModelRenderer(this, 32, 0); - body3.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR2.addChild(body3); - body3.setRotationPoint(0F, 4F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - REARRTR3 = new ModelRenderer(this, "REARRTR3"); - REARRTR2.addChild(REARRTR3); - REARRTR3.setRotationPoint(0F, 0F, 4F); - setRotation(REARRTR3, 0F, 0F, 0F); - REARRTR3.mirror = true; - tail = new ModelRenderer(this, 8, 14); - tail.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); - REARRTR3.addChild(tail); - tail.setRotationPoint(0F, 6F, 4F); - tail.setTextureSize(64, 32); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 32, 0); - body4.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR3.addChild(body4); - body4.setRotationPoint(0F, 4F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(REARRTR3); - // dltfold2.addChildModelRenderer(REARRTR2); - // dltfold0.addChildModelRenderer(REARRTR1); - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - WHOLE.addChild(HEADPIECE); - HEADPIECE.setRotationPoint(0F, 1F, -6F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - nose = new ModelRenderer(this, 12, 9); - nose.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADPIECE.addChild(nose); - nose.setRotationPoint(0F, 2F, -5F); - nose.setTextureSize(64, 32); - nose.mirror = true; - setRotation(nose, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 0); - head.addBox(-2.5F, -2.5F, -1.5F, 5, 5, 3); - HEADPIECE.addChild(head); - head.setRotationPoint(0F, 0F, -1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - chin = new ModelRenderer(this, 0, 8); - chin.addBox(-1.5F, -1.5F, -2.5F, 3, 3, 3); - HEADPIECE.addChild(chin); - chin.setRotationPoint(0F, 1F, -3F); - chin.setTextureSize(64, 32); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - // dltfold0.addChildModelRenderer(HEADPIECE); - body1 = new ModelRenderer(this, 32, 0); - body1.addBox(-4.5F, -4F, -2F, 9, 8, 4); - WHOLE.addChild(body1); - body1.setRotationPoint(0F, 0F, -4F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 15); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg4); - leg4.setRotationPoint(3F, 4F, 5F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 15); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg3); - leg3.setRotationPoint(-3F, 4F, 5F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 0, 15); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg2); - leg2.setRotationPoint(3F, 4F, -4F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 15); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg1); - leg1.setRotationPoint(-3F, 4F, -4F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // Something Should GO here - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - WHOLE.render(f5); - GL11.glPopMatrix(); - } else { - WHOLE.render(f5); - } - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - EntityArmadillo var5 = (EntityArmadillo) par7Entity; - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateX(+0.05f * 2.0f, 0f, (float) (145 * Math.PI / 180f)); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - // HEADPIECE.rotateAngleX = - // var5.eHEADPIECE.rotateX(-0.05f*animSpeed,0f,(float)(145*Math.PI/180f)); - this.HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateAngleX = Math.min(Math.max(par5, -180), +180) - * (float) (Math.PI / 180f); - this.HEADPIECE.rotateAngleY = var5.eHEADPIECE.rotateAngleY = Math.min(Math.max(par4, -30), +30) - * (float) (Math.PI / 180f); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityArmadillo var5 = (EntityArmadillo) par1EntityLiving; - - if (var5.eWHOLE.isSetup == false) { - var5.eWHOLE.setup(WHOLE); - } - if (var5.eHEADPIECE.isSetup == false) { - var5.eHEADPIECE.setup(HEADPIECE); - } - if (var5.eREARRTR1.isSetup == false) { - var5.eREARRTR1.setup(REARRTR1); - } - if (var5.eREARRTR2.isSetup == false) { - var5.eREARRTR2.setup(REARRTR2); - } - if (var5.eREARRTR3.isSetup == false) { - var5.eREARRTR3.setup(REARRTR3); - } - if (var5.etail.isSetup == false) { - var5.etail.setup(tail); - } - if (var5.eleg3.isSetup == false) { - var5.eleg3.setup(leg3); - } - if (var5.eleg4.isSetup == false) { - var5.eleg4.setup(leg4); - } - - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - float animSpeed = 2.0f; - if (var5.isCharging() == true) { - animSpeed = 5.0f; - /* Make Complete Body Circle */ - if (var5.eWHOLE.rotateAngleX == (float) ((390 + 360) * Math.PI / 180f)) { - var5.eWHOLE.rotateAngleX -= 360 * Math.PI / 180; - } - WHOLE.rotateAngleX = var5.eWHOLE - .rotateX(+0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - } else { - animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(+0.09f * animSpeed, 0f, (float) (390 * Math.PI / 180f)); - } - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(+0.1f, (float) (0 * Math.PI / 180f), (float) (90 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(-0.5f * animSpeed, 2.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(-0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(-0.5f * animSpeed, -4f, 4f); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - float animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(-0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - /* Rotate Face Inward */ - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(-0.1f * animSpeed, (float) (-15 * Math.PI / 180f), - (float) (30 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(+0.5f * animSpeed, 0.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(+0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(+0.5f * animSpeed, -4f, 4f); - - leg1.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg2.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - leg3.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg4.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/31e3f0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/31e3f0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 19b2f62..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/31e3f0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,222 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/503baaf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/503baaf8c42100141fce95f06aba7e85 deleted file mode 100644 index 541e36f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/503baaf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,213 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/50a2829fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/50a2829fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 826e268..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/50a2829fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/51ff42f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/51ff42f6c42100141fce95f06aba7e85 deleted file mode 100644 index df8b132..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/51ff42f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,91 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/60f63ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/60f63ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 47a2259..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/60f63ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempBlock { - - /** - * Factor that adds to the current Player Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Block is Nearby - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHeatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/71ac409ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/71ac409ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1fdf612..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/71ac409ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/d08bb19dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/d08bb19dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 05d1d4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/d08bb19dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/d1c0a2e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/d1c0a2e6c42100141fce95f06aba7e85 deleted file mode 100644 index 347c932..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/d1c0a2e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectPyramid; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e10708f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e10708f8c42100141fce95f06aba7e85 deleted file mode 100644 index 66ab9bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e10708f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,176 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e1539de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e1539de4c42100141fce95f06aba7e85 deleted file mode 100644 index 4ded76e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e1539de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.core; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.potion.brewingstands.PotionIngredients.IngredientProperty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemGenerics extends Item implements IngredientProperty { - - public enum Properties { - /* Generic Items */ - PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - - /* Potion Effect Ingredients */ - BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( - "Antennae", 23, true), ShinyBauble("Shiny Bauble", 24, true), Talon("Talon", 25, true), Bark("Bark", - 27, true), SmallHeart("Small Heart", 28, true), LargeHeart("Large Heart", 29, true), Gill("Gill", 30, - true), Ectoplasm("Ectoplasm", 31), FrogLegs("Frog Legs", 32, true), RabbitsFoot("Rabbits Feet", 33, - true), PricklyPowder("Prickly Powder", 34, true), PowderSlush("Powder Slush", 35, true), GlowingGoo( - "Glowing Goo", 36, true), SmallUnhealthyHeart("Small Unhealthy Heart", 37, true), LargeUnhealthyHeart( - "Large Unhealthy Heart", 38, true); - - public final String displayName; - public final boolean isIngredient; - public final int meta; - - public int meta() { - return meta; - } - - @SideOnly(Side.CLIENT) - private IIcon icon; - - Properties(String name, int meta, boolean isIngredient) { - this.displayName = name; - this.meta = meta; - this.isIngredient = isIngredient; - } - - Properties(String name, int iconIndex) { - this(name, iconIndex, false); - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Properties getPropertyByMeta(int meta) { - for (Properties property : Properties.values()) { - if (property.meta == meta) { - return property; - } - } - return null; - } - } - - public ItemGenerics() { - super(); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Properties.getPropertyByMeta(par1).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - for (Properties type : Properties.values()) { - type.setIcon(par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + type.toString().toLowerCase())); - } - } - - @Override - public boolean isIngredient(ItemStack ingredient) { - Properties.getPropertyByMeta(ingredient.getItemDamage()); - return true; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - for (final Properties property : Properties.values()) { - if (property.meta == itemStack.getItemDamage()) { - return "item.".concat(property.displayName.toLowerCase().replaceAll("\\s", "")); - } - } - return ""; - } - - @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (final Properties property : Properties.values()) { - par3List.add(new ItemStack(item, 1, property.meta)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e20fcce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e20fcce5c42100141fce95f06aba7e85 deleted file mode 100644 index 9089f09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/73/e20fcce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,349 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10f5f4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10f5f4f7c42100141fce95f06aba7e85 deleted file mode 100644 index f2f88c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/10f5f4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/2017edf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/2017edf5c42100141fce95f06aba7e85 deleted file mode 100644 index 5c4388b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/2017edf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/304a50fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/304a50fac42100141fce95f06aba7e85 deleted file mode 100644 index 7df639e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/304a50fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import net.minecraft.block.Block; - -import com.google.common.base.Optional; - -public enum BlockList { - instance; - public static Optional palmHoloTree = Optional.absent(); // Not Used? - - public static Optional aloeVera = Optional.absent(); - public static Optional wateredDirt = Optional.absent(); - public static Optional tumbleweed = Optional.absent(); - public static Optional jasper = Optional.absent(); - - public static Optional palmTreeLog = Optional.absent(); - public static Optional palmTreePlank = Optional.absent(); - public static Optional palmTreeSlab = Optional.absent(); - public static Optional palmTreeDoubleSlab = Optional.absent(); - public static Optional palmTreeStairs = Optional.absent(); - public static Optional palmTreeLeaves = Optional.absent(); - public static Optional palmTreeSapling = Optional.absent(); - public static Optional coconut = Optional.absent(); - - public static Optional nightBloom = Optional.absent(); - public static Optional creeperBlossom = Optional.absent(); - public static Optional quickSand = Optional.absent(); - - public static Optional spike = Optional.absent(); - public static Optional campfire = Optional.absent(); - public static Optional mobHeads = Optional.absent(); - public static Optional tombstone = Optional.absent(); - - public static Optional universalFlowerPot = Optional.absent(); - public static Optional customBrewingStand = Optional.absent(); - public static Optional limitedMobSpawner = Optional.absent(); - public static Optional brewingStandSingle = Optional.absent(); - public static Optional brewingStandTriple = Optional.absent(); - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/30b7caf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/30b7caf4c42100141fce95f06aba7e85 deleted file mode 100644 index 958c266..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/30b7caf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/31ac09ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/31ac09ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index da1dc51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/31ac09ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/50934c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/50934c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7fe9312..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/50934c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraft.item.Item; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public ItemDeclaration(String name) { - this(name, 0); - } - - public ItemDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("item", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createItem(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerItem(); - if (!side.isServer()) { - clientRegisterItem(); - } - } - } - - protected abstract void registerItem(); - - protected void clientRegisterItem() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/50c5fdfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/50c5fdfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0e54461..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/50c5fdfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,596 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/61cb46a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/61cb46a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7d78a1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/61cb46a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionInvisibility extends SubItemPotionGeneric { - - public SubItemPotionInvisibility(Item itemID, int subID) { - super(itemID, subID, "potion.invisibility"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.invisibility); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/817e5ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/817e5ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 1b67d03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/817e5ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.ItemUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/81f78e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/81f78e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c4882c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/81f78e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import projectzulu.common.core.CreativePZGeneralTab; -import projectzulu.common.core.CreativePZPotionTab; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.EventHookContainerClass; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.PacketPipeline; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.ZuluGuiHandler; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/900367fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/900367fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d9df01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/900367fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/902601ffc5ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/902601ffc5ab00141ee9bf3050c1025b new file mode 100644 index 0000000..09ee7c7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/902601ffc5ab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + boolean bugRelease; + boolean stickSpawn; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/915b05fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/915b05fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 04c1645..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/915b05fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemFoodProjectZulu extends ItemFood { - /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; - - /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; - - /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; - - /** - * If this field is true, the food can be consumed even if the player don't need to eat. - */ - private boolean alwaysEdible; - - /** - * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect - */ - private int potionId; - - /** set by setPotionEffect */ - private int potionDuration; - - /** set by setPotionEffect */ - private int potionAmplifier; - - /** probably of the set potion effect occurring */ - private float potionEffectProbability; - - public ItemFoodProjectZulu(int par2, float par3, boolean par4, String name) { - super(par2, par3, par4); - itemUseDuration = 32; - healAmount = par2; - isWolfsFavoriteMeat = par4; - saturationModifier = par3; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - --par1ItemStack.stackSize; - par3EntityPlayer.getFoodStats().func_151686_a(this, par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); - this.func_77849_c(par1ItemStack, par2World, par3EntityPlayer); - return par1ItemStack; - } - - protected void func_77849_c(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/c11117fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/c11117fac42100141fce95f06aba7e85 deleted file mode 100644 index 1f01b41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/c11117fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import com.ngb.projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/c1b87401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/c1b87401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2420cc0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/c1b87401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import projectzulu.common.potion.subitem.SubItemPotionHarm; -import projectzulu.common.potion.subitem.SubItemPotionHeal; -import projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import projectzulu.common.potion.subitem.SubItemPotionNightVision; -import projectzulu.common.potion.subitem.SubItemPotionPoison; -import projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/f242d99ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/f242d99ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb6b027..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/74/f242d99ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/01ec342bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/01ec342bc52100141fce95f06aba7e85 deleted file mode 100644 index 2900eb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/01ec342bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/10a2322bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/10a2322bc52100141fce95f06aba7e85 deleted file mode 100644 index 72c2cc9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/10a2322bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/115463a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/115463a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6650835..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/115463a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityHauntedArmor; - -public class HauntedArmorWithMeta extends BlockWithMeta { - - public HauntedArmorWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityHauntedArmor mob = new EntityHauntedArmor(world, position.posX + 0.5, position.posY, - position.posZ + 0.5, true); - mob.onSpawnWithEgg(null); - mob.setPersistenceRequired(true); - world.spawnEntityInWorld(mob); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/11819bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/11819bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5392607..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/11819bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityGreenFinch extends EntityFinch{ - - public EntityGreenFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/4035ed9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/4035ed9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2c03436..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/4035ed9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/51c07d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/51c07d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7f31f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/51c07d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,52 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHeal2 extends PotionZulu { - - public PotionHeal2(int par1, boolean par2) { - super(par1, par2, 16262179); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - par1EntityLiving.heal(amplifier * 3); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/608869e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/608869e6c42100141fce95f06aba7e85 deleted file mode 100644 index 6c2dd42..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/608869e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60bc10a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60bc10a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b585ce1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/60bc10a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/805f6ba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/805f6ba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c04ac8a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/805f6ba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/907229f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/907229f8c42100141fce95f06aba7e85 deleted file mode 100644 index 0e25c9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/907229f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; -import com.ngb.projectzulu.common.world2.blueprint.cathedral.BPSetCathedral; - -public class ArchitectCathedral extends ArchitectBase { - - public ArchitectCathedral(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetCathedral()); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - set = stockpile.getRandomApplicable(cells, buildCoords); - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/a23ce1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/a23ce1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b722a42..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/a23ce1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityLizard; -import projectzulu.common.mobs.models.ModelLizard; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/c26156fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/c26156fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 63ca643..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/c26156fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/f0a996ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/f0a996ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54598fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/75/f0a996ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/10d939fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/10d939fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f87c383..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/10d939fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/115557e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/115557e5c42100141fce95f06aba7e85 deleted file mode 100644 index 734f12b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/115557e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,42 +0,0 @@ -//package projectzulu.common.mobs.entityai; -// -//import net.minecraft.command.IEntitySelector; -//import net.minecraft.entity.EntityLiving; -//import projectzulu.common.mobs.EntityGenericCreature; -//import projectzulu.common.mobs.EntityStates; -// -//public class EntityZuluAINearestRevengeTarget extends EntityAINearestAttackableTarget{ -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5){ -// super(par1EntityLiving, par2Class, par3, par4, par5); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5, boolean par6){ -// super(par1EntityLiving, par2Class, par3, par4, par5, par6); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ -// super(par1, par2, par3, par4, par5, par6, par7IEntitySelector); -// } -// -// /** -// * Returns whether the EntityAIBase should begin execution. -// */ -// public boolean shouldExecute() { -// /* getAITarget acts as Tempory target timer, as it only lasts a few seconds, Reminder: getAttackTarget is the persistent form */ -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.shouldExecute(); -// } -// return false; -// } -// -// @Override -// public boolean continueExecuting() { -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.continueExecuting(); -// } -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/2074979dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/2074979dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2be9e10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/2074979dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,264 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/316d57a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/316d57a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bce8efc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/316d57a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempBlock { - - /** - * Factor that adds to the current Player Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Block is Nearby - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHeatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/50044f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/50044f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7e219a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/50044f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/51be9ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/51be9ee5c42100141fce95f06aba7e85 deleted file mode 100644 index c035fc1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/51be9ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,351 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/702f31e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/702f31e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5d96fbb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/702f31e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/90a7c4f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/90a7c4f5c42100141fce95f06aba7e85 deleted file mode 100644 index 441b7cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/90a7c4f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ae24a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ae24a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eaab348..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/b0ae24a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/d1a5d101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/d1a5d101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ab2ff9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/d1a5d101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectOasis; -import projectzulu.common.world2.randomizer.EdgeRandomizer; -import projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/d1f71c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/d1f71c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f5aaff6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/d1f71c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.item.ItemSlab; -import net.minecraft.item.ItemStack; - -public class ItemZuluSlab extends ItemSlab { - - private static BlockSlab halfBlock; - private static BlockSlab doubleSlab; - private final boolean isFullBlock; - - /** - * Setup the half/double Slab instances required by ItemSlab This is a workaround as Forge does not allow Blocks to - * registered with an instance of an itemClass but an Item.class which only allow itemID constructor - */ - public static void initialise(BlockSlab halfBlock, BlockSlab doubleSlab) { - ItemZuluSlab.halfBlock = halfBlock; - ItemZuluSlab.doubleSlab = doubleSlab; - } - - public ItemZuluSlab(Block block) { - super(block, (BlockSlab) halfBlock, (BlockSlab) doubleSlab, block == doubleSlab); - isFullBlock = block == doubleSlab; - } - - /** - * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have - * different names based on their damage or NBT. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) { - return isFullBlock ? doubleSlab.func_150002_b(par1ItemStack.getItemDamage()) : super - .getUnlocalizedName(par1ItemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/f0fe03fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/f0fe03fac42100141fce95f06aba7e85 deleted file mode 100644 index fd1928d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/76/f0fe03fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeLog; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/109b92f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/109b92f5c42100141fce95f06aba7e85 deleted file mode 100644 index bb8a64c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/109b92f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBoar; -import com.ngb.projectzulu.common.mobs.models.ModelBoar; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/201c5300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/201c5300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee5ef75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/201c5300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/41bf539ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/41bf539ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3a3f71c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/41bf539ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,111 +0,0 @@ -//package projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import projectzulu.common.core.packets.PacketPlaySound; -//import projectzulu.common.core.packets.PacketStreamSound; -//import projectzulu.common.dungeon.packets.PacketMobSpawner; -//import projectzulu.common.mobs.packets.PacketAnimTime; -//import projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/51999f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/51999f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa12d36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/51999f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/7037417febac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/7037417febac0014196dc3517d78505a new file mode 100644 index 0000000..efc63be --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/7037417febac0014196dc3517d78505a @@ -0,0 +1,334 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelCamel extends ModelBase +{ + float heightToRaise = 33f; + float renderScale = 1.0f; + //fields + //fields + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer HEADbump; + ModelRenderer HEAD; + ModelRenderer neckTop; + ModelRenderer neckBase; + ModelRenderer humpMain; + ModelRenderer humpMain2; + ModelRenderer saddleBase; + ModelRenderer saddleHorn1; + ModelRenderer saddleHorn2; + ModelRenderer Body; + ModelRenderer hip1; + ModelRenderer Leg1toProt; + ModelRenderer Leg1BotRot; + ModelRenderer hip2; + ModelRenderer Leg2toProt; + ModelRenderer Leg2BotRot; + ModelRenderer hip3; + ModelRenderer Leg3toProt; + ModelRenderer Leg3BotRot; + ModelRenderer hip4; + ModelRenderer Leg4toProt; + ModelRenderer Leg4BotRot; + ModelRenderer tail; + + public ModelCamel() + { + textureWidth = 128; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -3F, -4F, 5, 4, 7); + HEAD.setRotationPoint(0F, 3F - heightToRaise, -15F); + HEAD.setTextureSize(128, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.2268928F, 0F, 0F); + HEADbump = new ModelRenderer(this, 105, 42); + HEADbump.addBox(-2F, -2F, -3F, 3, 2, 6); + //HEADbump.setRotationPoint(1F, 1.5F, -15.5F); + HEADbump.setRotationPoint(1F, -1.5F, -0.5F); + HEADbump.setTextureSize(128, 64); + HEADbump.mirror = true; + setRotation(HEADbump, 0.296706F, 0F, 0F); + HEAD.addChild(HEADbump); + earLeft = new ModelRenderer(this, 60, 6); + earLeft.addBox(0F, -3F, -1F, 1, 4, 1); + //earLeft.setRotationPoint(1.5F, 1F, -13F); + earLeft.setRotationPoint(1.5F, -1.0F, 2.5F); + earLeft.setTextureSize(128, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, 0.5235988F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 60, 1); + earRight.addBox(-1F, -3F, -1F, 1, 4, 1); + //earRight.setRotationPoint(-0.5F, 1F, -13F); + earRight.setRotationPoint(-0.5F, -1.0F, 2.5F); + earRight.setTextureSize(128, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, -0.5235988F); + HEAD.addChild(earRight); + + neckTop = new ModelRenderer(this, 29, 1); + neckTop.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + neckTop.setRotationPoint(0.5F, 1.8F - heightToRaise , -14F); + neckTop.setTextureSize(128, 64); + neckTop.mirror = true; + setRotation(neckTop, 0.6457718F, 0F, 0F); + neckBase = new ModelRenderer(this, 43, 1); + neckBase.addBox(-1.5F, 0F, -1.5F, 3, 6, 4); + neckBase.setRotationPoint(0.5F, 6F - heightToRaise, -11.5F); + neckBase.setTextureSize(128, 64); + neckBase.mirror = true; + setRotation(neckBase, 1.117011F, 0F, 0F); + humpMain = new ModelRenderer(this, 1, 41); + humpMain.addBox(-3.5F, -2F, -2F, 8, 4, 9); + humpMain.setRotationPoint(0F, 3F - heightToRaise, -0.5F); + humpMain.setTextureSize(128, 64); + humpMain.mirror = true; + setRotation(humpMain, 0F, 0F, 0F); + humpMain2 = new ModelRenderer(this, 37, 42); + humpMain2.addBox(-3F, -2F, -2F, 7, 4, 7); + humpMain2.setRotationPoint(0F, 0.75F - heightToRaise, 0.5F); + humpMain2.setTextureSize(128, 64); + humpMain2.mirror = true; + setRotation(humpMain2, 0F, 0F, 0F); + saddleBase = new ModelRenderer(this, 68, 52); + saddleBase.addBox(-3.5F, -2F, -2F, 6, 1, 5); + saddleBase.setRotationPoint(1F, 4F - heightToRaise, -5F); + saddleBase.setTextureSize(128, 64); + saddleBase.mirror = true; + setRotation(saddleBase, 0F, 0F, 0F); + saddleHorn1 = new ModelRenderer(this, 67, 1); + saddleHorn1.addBox(-1F, -3F, -1F, 1, 5, 1); + saddleHorn1.setRotationPoint(1F, 1F - heightToRaise, -6F); + saddleHorn1.setTextureSize(128, 64); + saddleHorn1.mirror = true; + setRotation(saddleHorn1, 0.3346075F, 0F, 0F); + saddleHorn2 = new ModelRenderer(this, 73, 5); + saddleHorn2.addBox(-2F, -1F, -1F, 4, 1, 1); + saddleHorn2.setRotationPoint(0.5F, 0F - heightToRaise, -7F); + saddleHorn2.setTextureSize(128, 64); + saddleHorn2.mirror = true; + setRotation(saddleHorn2, 0F, 0F, 0F); + Body = new ModelRenderer(this, 1, 14); + Body.addBox(-3.5F, -2F, -10F, 9, 9, 16); + Body.setRotationPoint(-0.5F, 5F - heightToRaise, 3F); + Body.setTextureSize(128, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + hip1 = new ModelRenderer(this, 68, 42); + hip1.addBox(-1F, -3F, -1F, 4, 4, 4); + hip1.setRotationPoint(-4F, 12F - heightToRaise, -5.5F); + hip1.setTextureSize(128, 64); + hip1.mirror = true; + setRotation(hip1, 0.0698132F, 0F, 0F); + Leg1toProt = new ModelRenderer(this, 65, 13); + Leg1toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg1toProt.setRotationPoint(-3F, 12F, -4.5F); + Leg1toProt.setRotationPoint(1F, 0F, 0.5F); + Leg1toProt.setTextureSize(128, 64); + Leg1toProt.mirror = true; + setRotation(Leg1toProt, 0.0698132F, 0F, 0F); + hip1.addChild(Leg1toProt); + Leg1BotRot = new ModelRenderer(this, 65, 25); + Leg1BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg1BotRot.setRotationPoint(-3F, 17F, -4F); + Leg1BotRot.setRotationPoint(0F, 6F, 0F); + Leg1BotRot.setTextureSize(128, 64); + Leg1BotRot.mirror = true; + setRotation(Leg1BotRot, -0.0698132F, 0F, 0F); + Leg1toProt.addChild(Leg1BotRot); + hip2 = new ModelRenderer(this, 68, 42); + hip2.addBox(-1F, -1F, -1F, 4, 4, 4); + hip2.setRotationPoint(3F, 10F - heightToRaise, -5.5F); + hip2.setTextureSize(128, 64); + hip2.mirror = true; + setRotation(hip2, 0.0698132F, 0F, 0F); + Leg2toProt = new ModelRenderer(this, 52, 13); + Leg2toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg2toProt.setRotationPoint(4F, 11F, -4.5F); + Leg2toProt.setRotationPoint(1F, 2F, 0.5F); + Leg2toProt.setTextureSize(128, 64); + Leg2toProt.mirror = true; + setRotation(Leg2toProt, 0.0698132F, 0F, 0F); + hip2.addChild(Leg2toProt); + Leg2BotRot = new ModelRenderer(this, 52, 25); + Leg2BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg2BotRot.setRotationPoint(4F, 17F, -4F); + Leg2BotRot.setRotationPoint(0F, 6F, 0F); + Leg2BotRot.setTextureSize(128, 64); + Leg2BotRot.mirror = true; + setRotation(Leg2BotRot, -0.0698132F, 0F, 0F); + Leg2toProt.addChild(Leg2BotRot); + hip3 = new ModelRenderer(this, 87, 42); + hip3.addBox(-1F, -1F, -1F, 4, 5, 4); + hip3.setRotationPoint(-4F, 9F - heightToRaise, 5F); + hip3.setTextureSize(128, 64); + hip3.mirror = true; + setRotation(hip3, 0.0698132F, 0F, 0F); + Leg3toProt = new ModelRenderer(this, 95, 13); + Leg3toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg3toProt.setRotationPoint(-3F, 12F, 6F); + Leg3toProt.setRotationPoint(1F, 2F, 1F); + Leg3toProt.setTextureSize(128, 64); + Leg3toProt.mirror = true; + setRotation(Leg3toProt, 0.0872665F, 0F, 0F); + hip3.addChild(Leg3toProt); + Leg3BotRot = new ModelRenderer(this, 95, 25); + Leg3BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg3BotRot.setRotationPoint(-3F, 17F, 6.5F); + Leg3BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg3BotRot.setTextureSize(128, 64); + Leg3BotRot.mirror = true; + setRotation(Leg3BotRot, -0.0698132F, 0F, 0F); + Leg3toProt.addChild(Leg3BotRot); + + hip4 = new ModelRenderer(this, 87, 42); + hip4.addBox(-1F, -1F, -1F, 4, 5, 4); + hip4.setRotationPoint(3F, 9F - heightToRaise, 5F); + hip4.setTextureSize(128, 64); + hip4.mirror = true; + setRotation(hip4, 0.0698132F, 0F, 0F); + Leg4toProt = new ModelRenderer(this, 81, 13); + Leg4toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg4toProt.setRotationPoint(4F, 12F, 6F); + Leg4toProt.setRotationPoint(1F, 2F, 1F); + Leg4toProt.setTextureSize(128, 64); + Leg4toProt.mirror = true; + setRotation(Leg4toProt, 0.0872665F, 0F, 0F); + hip4.addChild(Leg4toProt); + Leg4BotRot = new ModelRenderer(this, 81, 25); + Leg4BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg4BotRot.setRotationPoint(4F, 17F, 6.5F); + Leg4BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg4BotRot.setTextureSize(128, 64); + Leg4BotRot.mirror = true; + setRotation(Leg4BotRot, -0.0698132F, 0F, 0F); + Leg4toProt.addChild(Leg4BotRot); + tail = new ModelRenderer(this, 109, 13); + tail.addBox(-1F, -1F, 0F, 2, 7, 2); + tail.setRotationPoint(0F, 7F - heightToRaise, 7.6F); + tail.setTextureSize(128, 64); + tail.mirror = true; + setRotation(tail, 0.5585054F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + //Leg1toProt.render(f5); + //Leg1BotRot.render(f5); + hip2.render(renderScale * f5); + //Leg2toProt.render(f5); + //Leg2BotRot.render(f5); + hip3.render(renderScale * f5); + //Leg3toProt.render(f5); + //Leg3BotRot.render(f5); + hip4.render(renderScale * f5); + //Leg4toProt.render(f5); + //Leg4BotRot.render(f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + hip2.render(renderScale * f5); + hip3.render(renderScale * f5); + hip4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Tail Rotation */ + //NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 + //* MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + /* Tail Rotation */ + tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + /* Leg Animation */ + hip1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + hip2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + Leg1BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg2BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + hip3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + hip4.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + Leg3BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg4BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + } + + } diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/80b794f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/80b794f8c42100141fce95f06aba7e85 deleted file mode 100644 index 98837f1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/80b794f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/b0f78c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/b0f78c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3cb2e80..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/b0f78c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/c0dad5f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/c0dad5f4c42100141fce95f06aba7e85 deleted file mode 100644 index c7def6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/c0dad5f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/d0de9de6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/d0de9de6c42100141fce95f06aba7e85 deleted file mode 100644 index c6ecb6e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/d0de9de6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/f1cff7e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/f1cff7e4c42100141fce95f06aba7e85 deleted file mode 100644 index 0c3ad1f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/77/f1cff7e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/0121fcf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/0121fcf7c42100141fce95f06aba7e85 deleted file mode 100644 index 922f40b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/0121fcf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomMid extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomMid(boolean inverted) { - super(inverted); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (inverted) { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(piecePos.posX + 1) == 0) { - return true; - } - } else { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(cellSize - 1 - piecePos.posX + 1) == 0) { - return true; - } - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randomMid"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/01b505a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/01b505a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 625408c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/01b505a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/208b1ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/208b1ce4c42100141fce95f06aba7e85 deleted file mode 100644 index fa832ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/208b1ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,195 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelMammothHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer TUSKLEFROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer NOSEROT1; - private ModelRenderer NOSEROT2; - private ModelRenderer NOSEROT3; - private ModelRenderer NOSEROT4; - private ModelRenderer NOSEROT5; - private ModelRenderer NOSEROT6; - private ModelRenderer NOSEROT7; - private ModelRenderer NOSEROT8; - private ModelRenderer NOSEROT9; - private ModelRenderer EARRIGROT; - private ModelRenderer EARLEFROT; - - public ModelMammothHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 16F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5) - { - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NOSEROT1.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (0.0*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - default: - NOSEROT1.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - } - - TUSKRIGROT.rotateAngleY = (float) (-22.5*Math.PI/180); - TUSKLEFROT.rotateAngleY = (float) (22.5*Math.PI/180); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/400a9af4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/400a9af4c42100141fce95f06aba7e85 deleted file mode 100644 index 2bdd096..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/400a9af4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class MobSpawnerWithMeta extends BlockWithMeta { - - String mobName; - - public MobSpawnerWithMeta(String mobName) { - super(Blocks.mob_spawner); - this.mobName = mobName; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - /* Create Mob Spawner */ - world.setBlock(position.posX, position.posY, position.posZ, block); - TileEntityMobSpawner tileEntityMobSpawner = (TileEntityMobSpawner) world.getTileEntity(position.posX, - position.posY, position.posZ); - - if (tileEntityMobSpawner != null) { - tileEntityMobSpawner.func_145881_a().setEntityName(mobName); - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/4012e6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/4012e6f5c42100141fce95f06aba7e85 deleted file mode 100644 index 0d59bc0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/4012e6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/41ba47f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/41ba47f6c42100141fce95f06aba7e85 deleted file mode 100644 index 82b7e16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/41ba47f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/513438e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/513438e5c42100141fce95f06aba7e85 deleted file mode 100644 index ac94f9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/513438e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/60f87efec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/60f87efec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0a6482b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/60f87efec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,321 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/8080399ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/8080399ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8d64f28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/8080399ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.util; - -import com.google.common.base.CharMatcher; - -public class StringHelper { - - public static String simplifyStringNameForDisplay(String string, int characterLimit, String splitString){ - /* Remove Surpluous Creature Data (ProjectZulu.Armadillo) */ - String[] stringParts = string.split(splitString); - String displayName; - /* Shorten Name to Declared Number of Character */ - if(stringParts.length > 0){ - displayName = stringParts[stringParts.length-1]; - }else{ - displayName = string; - } - - if(displayName.length() > characterLimit){ - displayName = displayName.substring(0, characterLimit); - } - return displayName; - } - - public static String toTitleCase(String string){ - return string.toUpperCase().replace(string.toUpperCase().substring(1), string.substring(1).toLowerCase()); - } - - public static int parseInteger(String integer, String regexRetain){ - return Integer.parseInt(CharMatcher.anyOf(regexRetain).retainFrom(integer)); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a020c1a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a020c1a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 52be4ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a020c1a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseRandom; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a0c1c79fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a0c1c79fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 973398f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a0c1c79fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetDoorway; -import projectzulu.common.world2.blueprint.BPSetHallway; -import projectzulu.common.world2.blueprint.BPSetHallwaySpawner; -import projectzulu.common.world2.blueprint.BPSetPyramidEdge; -import projectzulu.common.world2.blueprint.BPSetStairs; -import projectzulu.common.world2.blueprint.BPSetTreasureDeadEnd; -import projectzulu.common.world2.blueprint.BPSetWall; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectPyramid extends ArchitectBase { - - public final BPSetStairs stairSet = new BPSetStairs(); - public final BPSetPyramidEdge edge = new BPSetPyramidEdge(); - public final BPSetDoorway door = new BPSetDoorway(); - - public ArchitectPyramid(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetWall()); - stockpile.addBlueprintSet(new BPSetTreasureDeadEnd()); - stockpile.addBlueprintSet(new BPSetHallway()); - stockpile.addBlueprintSet(new BPSetHallwaySpawner()); - stockpile.addBlueprintSet(stairSet); - stockpile.addBlueprintSet(edge); - stockpile.addBlueprintSet(door); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - /* If is Wall, use Wall Cell */ - BlueprintSet set; - if (door.isApplicable(cells, buildCoords, random)) { - set = door; - } else if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] bottomCells, MazeCell[][] topCells) { - for (int topX = 0; topX < topCells.length; topX++) { - for (int topZ = 0; topZ < topCells[0].length; topZ++) { - Point buildCoords = new Point(topX, topZ); - if (stairSet.attemptAssignBlueprint(bottomCells, topCells, buildCoords, random)) { - return; - } - } - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a0ecbff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a0ecbff5c42100141fce95f06aba7e85 deleted file mode 100644 index 1e5b104..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a0ecbff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a1f156f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a1f156f5c42100141fce95f06aba7e85 deleted file mode 100644 index 3c26f4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/a1f156f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBrownBear extends ModelBear { - - public ModelBrownBear() { - super(7); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.4f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/b01a1bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/b01a1bf8c42100141fce95f06aba7e85 deleted file mode 100644 index c22b282..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/b01a1bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/b2a481f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/b2a481f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2062c1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/b2a481f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandTriple extends BlockBrewingStandBase { - - public BlockBrewingStandTriple(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int par2) { - return new TileEntityBrewingTriple(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/c0530de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/c0530de5c42100141fce95f06aba7e85 deleted file mode 100644 index 880a9b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/c0530de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,92 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d03040a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d03040a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 07c0aa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d03040a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d0dcf0f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d0dcf0f4c42100141fce95f06aba7e85 deleted file mode 100644 index 6031b91..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d0dcf0f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d11339e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d11339e4c42100141fce95f06aba7e85 deleted file mode 100644 index bcfe6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d11339e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutSeed; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d1ccabf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d1ccabf9c42100141fce95f06aba7e85 deleted file mode 100644 index bf463ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/d1ccabf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,247 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -import com.ngb.projectzulu.common.core.packets.PacketTameParticle; -import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -import com.ngb.projectzulu.common.mobs.packets.PacketNameSync; -import com.ngb.projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/e0a559f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/e0a559f4c42100141fce95f06aba7e85 deleted file mode 100644 index 163f0a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/e0a559f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,325 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/e17da1f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/e17da1f7c42100141fce95f06aba7e85 deleted file mode 100644 index 2e2c924..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/78/e17da1f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockAloeVera; -import com.ngb.projectzulu.common.blocks.ItemAloeVera; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/006a452b052100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/006a452b052100141769cb1ed0c338cd deleted file mode 100644 index 8c027f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/006a452b052100141769cb1ed0c338cd +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; -//import projectzulu.common.mobs.entityai.RandomPositionGenerator; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/0274079ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/0274079ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b67d03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/0274079ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.ItemUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/118e91f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/118e91f9c42100141fce95f06aba7e85 deleted file mode 100644 index 995119d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/118e91f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,124 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandSpawnEntity extends CommandBase{ - @Override - public String getCommandName(){ - return "spawnentity"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel(){ - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender){ - return "commands.spawnentity.usage"; - } - - /** - * Command stringArgs : /spawnentity [targetPlayer] [entityName] - * Command stringArgs == 2: /spawnentity @p entityName - * Command stringArgs == 5: /spawnentity @p entityName - * Command stringArgs == 7: /spawnentity @p entityName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs){ - if(stringArgs.length < 2){ - throw new WrongUsageException("commands.spawnentity.usage", new Object[0]); - }else{ - double spawnTargetX = 0; - double spawnTargetY = 0; - double spawnTargetZ = 0; - float rotYaw = 0; - float rotPitch = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if(targetPlayer == null){ - throw new PlayerNotFoundException(); - } - - Entity spawnableEntity = EntityList.createEntityByName(stringArgs[1], targetPlayer.worldObj); - if(spawnableEntity == null){ - System.out.println("Entity is Null"); - throw new WrongUsageException("commands.spawnentity.noentity", new Object[0]); - } - - if(stringArgs.length == 2){ - spawnTargetX = (int)targetPlayer.posX; - spawnTargetY = (int)targetPlayer.posY; - spawnTargetZ = (int)targetPlayer.posZ; - }else if(stringArgs.length == 5 || stringArgs.length == 7){ - int indexOfPos = stringArgs.length - 3; - spawnTargetX = (int)parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - spawnTargetY = (int)parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, 0); - spawnTargetZ = (int)parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - if(stringArgs.length == 7){ - rotYaw = parseIntBounded(commandSender, stringArgs[2], 0, 360); - rotPitch = parseIntBounded(commandSender, stringArgs[3], 0, 360); - } - -// ProjectZuluLog.info("Placing Block at %s, %s, %s with Yaw %s and pitch %s", spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch ); - spawnableEntity.setLocationAndAngles(spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch); - targetPlayer.worldObj.spawnEntityInWorld(spawnableEntity); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr){ - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble){ - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, int lowerLimit, int upperLimit){ - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1){ - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords){ - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords){ - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0){ - if (targetPos < (double)lowerLimit){ - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(targetPos), Integer.valueOf(lowerLimit)}); - } - - if (targetPos > (double)upperLimit){ - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(targetPos), Integer.valueOf(upperLimit)}); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/20789700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/20789700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c9f545..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/20789700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/20d1b1e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/20d1b1e5c42100141fce95f06aba7e85 deleted file mode 100644 index e280e25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/20d1b1e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.mobs.models; -//package projectzulu.common.mobs; -// -//import net.minecraft.src.Entity; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.MathHelper; -//import net.minecraft.src.ModelBase; -//import net.minecraft.src.ModelRenderer; -// -//public class ModelZulu extends ModelBase -//{ -// -// public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.render(entity, f, f1, f2, f3, f4, f5); -// setRotationAngles(f, f1, f2, f3, f4, f5); -// if(this.isChild){ -// HEADROT.render(f5); -// BODYROT.render(f5); -// } -// -// } -// public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.setRotationAngles(f, f1, f2, f3, f4, f5); -// } -// -// -// -// @Override -// public void setLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4) { -// super.setLivingAnimations(par1EntityLiving, par2, par3, par4); -// } -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/406c48f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/406c48f8c42100141fce95f06aba7e85 deleted file mode 100644 index 0e5b448..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/406c48f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import net.minecraft.potion.Potion; - -public class ZuluPotionHelper{ - public static void setVanillaPotionProperties() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ - Potion potionToEdit = Potion.potionTypes[Potion.blindness.getId()]; - Method[] potionMethods = potionToEdit.getClass().getDeclaredMethods(); - int doubleCounter = 0; - for (int i = 0; i < potionMethods.length; i++) { - /* Look for setEffectiveness : It has 1 Parameter and it is a double : No other method fits that criteria */ - if(potionMethods[i].getParameterTypes().length == 1 && (potionMethods[i].getParameterTypes())[0].toString().equals("double")){ - potionMethods[i].setAccessible(true); - potionMethods[i].invoke(potionToEdit, 0.03D); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/407154a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/407154a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3217cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/407154a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockJasper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/414c72e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/414c72e4c42100141fce95f06aba7e85 deleted file mode 100644 index 50e4038..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/414c72e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.api.BlockList; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/613071f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/613071f5c42100141fce95f06aba7e85 deleted file mode 100644 index 3728933..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/613071f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityLizardSpit; -import com.ngb.projectzulu.common.mobs.renders.RenderLizardSpit; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/8037d19fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/8037d19fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb76021..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/8037d19fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/c0df529fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/c0df529fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b566a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/c0df529fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,872 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/e0c7faf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/e0c7faf4c42100141fce95f06aba7e85 deleted file mode 100644 index c6b8d2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/e0c7faf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHarm2 extends PotionZulu { - - public PotionHarm2(int par1, boolean par2) { - super(par1, par2, 4393481); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase entityLiving, int amplifier) { - if (!entityLiving.isEntityUndead()) { - entityLiving.attackEntityFrom(DamageSource.magic, amplifier * 3); - } else { - entityLiving.heal(amplifier * 3); - } - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (!par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f003b9f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f003b9f4c42100141fce95f06aba7e85 deleted file mode 100644 index f68cf8b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f003b9f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,164 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import com.ngb.projectzulu.common.blocks.FurPeltDeclaration; -import com.ngb.projectzulu.common.blocks.ItemBlockRecipeManager; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.terrain.AloeVeraFeature; -import com.ngb.projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import com.ngb.projectzulu.common.blocks.terrain.NightBloomFeature; -import com.ngb.projectzulu.common.blocks.terrain.PalmTreeFeature; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.PotionEvents; -import com.ngb.projectzulu.common.potion.EventHandleNullPotions; -import com.ngb.projectzulu.common.potion.PZExtraPotionDeclaration; -import com.ngb.projectzulu.common.potion.PZVanillaPotionDeclaration; -import com.ngb.projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f0ab71a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f0ab71a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a973faf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/79/f0ab71a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/209fe9e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/209fe9e4c42100141fce95f06aba7e85 deleted file mode 100644 index c69c938..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/209fe9e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/2117629ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/2117629ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b577ce5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/2117629ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/415abbfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/415abbfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3167702..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/415abbfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/71f768f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/71f768f9c42100141fce95f06aba7e85 deleted file mode 100644 index 9777abb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/71f768f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/72aa61e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/72aa61e4c42100141fce95f06aba7e85 deleted file mode 100644 index ccb92fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/72aa61e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,23 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/802ad7fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/802ad7fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3400199..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/802ad7fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGorilla; -import projectzulu.common.mobs.models.ModelGorilla; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GorillaDeclaration extends SpawnableDeclaration { - - public GorillaDeclaration() { - super("Gorilla", 25, EntityGorilla.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (25 << 16) + (25 << 8) + 25; - eggColor2 = (93 << 16) + (93 << 8) + 93; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8079c3e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8079c3e4c42100141fce95f06aba7e85 deleted file mode 100644 index 9548460..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/8079c3e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,129 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData() - .func_150283_g(nodeList.get(clickedIndex).getData().getId()), nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/80f07dbf9922001414aab7e331350948 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/80f07dbf9922001414aab7e331350948 deleted file mode 100644 index a1de53e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/80f07dbf9922001414aab7e331350948 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRedFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class YellowFinchDeclaration extends SpawnableDeclaration { - - public YellowFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/812d2ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/812d2ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 5506c54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/812d2ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,160 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9047daf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9047daf4c42100141fce95f06aba7e85 deleted file mode 100644 index 411eb90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/9047daf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDigspeed extends SubItemPotionHalfPower { - - public SubItemPotionDigspeed(Item itemID, int subID) { - super(itemID, subID, "Haste"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/a1ab1be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/a1ab1be5c42100141fce95f06aba7e85 deleted file mode 100644 index 6b3779b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/a1ab1be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,119 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isRideable() function - */ -public abstract class EntityGenericRideable extends EntityGenericBreedable{ - - public EntityGenericRideable(World par1World) { - super(par1World); - } - /* Toggles Whether the Child Class can be Ridden and used methods in this Class - * i.e. If false, will not be able to be saddled/mounted */ - public boolean isRideable(){ - return false; - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handles Whether the Entity Is Saddled */ - this.dataWatcher.addObject(21, Byte.valueOf((byte)0)); - } - - /** - * Returns true if the Entity is saddled. - */ - public boolean getSaddled() { - return (this.dataWatcher.getWatchableObjectByte(21) & 1) != 0; - } - - /** - * Set or remove the saddle of the Entity. - */ - public void setSaddled(boolean par1) { - if (par1) { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)1)); - } - else { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)0)); - } - } - - /** - * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden - * by a player and the player is holding a carrot-on-a-stick - */ - @Override - public boolean canBeSteered() { - ItemStack var1 = ((EntityPlayer) this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem().equals(Items.stick); - } - - /** - * Checks if Item should Cause the Horse to Continue Moving in the Direction it was already going - */ - public boolean shouldIgnorePlayerRot(){ - if(riddenByEntity != null && riddenByEntity instanceof EntityPlayer){ - ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem() != Items.stick; - } - return false; - } - - /** - * Sets the Player Rotation to Face the Direction of the Entity - */ - @Override - public boolean shouldRiderFaceForward(EntityPlayer player) { - return true; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - if (super.interact(par1EntityPlayer)) { - return true; - } - - if(isRideable()){ - /* If Saddled Get on/off Entity */ - if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { - par1EntityPlayer.mountEntity(this); - return true; - - /* If Not Saddled: Try to Saddle Entity */ - }else if(!getSaddled() && par1EntityPlayer.inventory.getCurrentItem() != null - && par1EntityPlayer.inventory.getCurrentItem().getItem() == Items.saddle ){ - setSaddled(true); - return true; - } - } - return false; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/b193e1e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/b193e1e5c42100141fce95f06aba7e85 deleted file mode 100644 index 98d0454..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/b193e1e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.PotionList; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.potion.effects.PotionCleansing; -import projectzulu.common.potion.effects.PotionCurse; -import projectzulu.common.potion.effects.PotionHarm2; -import projectzulu.common.potion.effects.PotionHeal2; -import projectzulu.common.potion.effects.PotionIncendiary; -import projectzulu.common.potion.effects.PotionSlowFall; -import projectzulu.common.potion.effects.PotionThorns; -import projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/b1c0b8f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/b1c0b8f5c42100141fce95f06aba7e85 deleted file mode 100644 index 00f15d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/b1c0b8f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c05f16f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c05f16f8c42100141fce95f06aba7e85 deleted file mode 100644 index fc4b802..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/c05f16f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/d10b75f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/d10b75f6c42100141fce95f06aba7e85 deleted file mode 100644 index da79298..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/d10b75f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandPlaceBlock extends CommandBase { - @Override - public String getCommandName() { - return "placeblock"; - } - - /** - * Return the required permission level for this command. - */ - @Override - public int getRequiredPermissionLevel() { - return 2; - } - - /** - * Command stringArgs : /placeblock [targetPlayer] [blockID] Command stringArgs == 2: /placeblock @p - * blockID Command stringArgs == 3: /placeblock @p blockID Command stringArgs == 5: /placeblock @p blockID - * Command stringArgs == 6: /placeblock @p blockID - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.placeblock.usage", new Object[0]); - } else { - int targetX = 0; - int targetY = 0; - int targetZ = 0; - int blockMeta = 0; - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - Block blockToPlace = Block.getBlockFromName(stringArgs[1]); - if (blockToPlace == null) { - throw new WrongUsageException("commands.placeblock.noblock", new Object[0]); - } - - if (stringArgs.length == 3 || stringArgs.length == 6) { - blockMeta = parseIntBounded(commandSender, stringArgs[2], 0, 4095); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - targetX = (int) targetPlayer.posX; - targetY = (int) targetPlayer.posY; - targetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - targetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - targetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, - 0); - targetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - targetPlayer.worldObj.setBlock(targetX, targetY, targetZ, blockToPlace, blockMeta, 3); - } - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spawnentity.usage"; - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f083d7a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f083d7a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2fbb6be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7a/f083d7a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.blocks.GuiAnimalName; -import projectzulu.common.blocks.tombstone.GuiTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.universalpot.ContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.GuiContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.dungeon.GuiLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; -import projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingBase; -import cpw.mods.fml.common.network.IGuiHandler; - -public class ZuluGuiHandler implements IGuiHandler { - - @Override - public Object getServerGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - - TileEntity tileEntityServer; - switch (GuiID.getGuiIDByID(guiID)) { - case FlowerPot: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityUniversalFlowerPot) { - return new ContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityServer); - } - case BrewingStand: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityBrewingBase) { - return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - default: - break; - } - return null; - - } - - @Override - public Object getClientGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tileEntityClient; - switch (GuiID.getGuiIDByID(guiID)) { - case Tombstone: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityTombstone) { - return new GuiTombstone((TileEntityTombstone) tileEntityClient); - } - break; - case FlowerPot: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityUniversalFlowerPot) { - return new GuiContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityClient); - } - break; - case AnimalName: - return new GuiAnimalName(world, player, x); - case MobSpawner: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityLimitedMobSpawner) { - return new GuiLimitedMobSpawner((TileEntityLimitedMobSpawner) tileEntityClient); - } - case BrewingStand: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityBrewingBase) { - return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - } - - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/026c9da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/026c9da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 55aa68f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/026c9da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,94 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIPanic extends EntityAIBase { - private EntityGenericCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getEntityState() != EntityStates.fleeing) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/111186e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/111186e6c42100141fce95f06aba7e85 deleted file mode 100644 index 8da9791..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/111186e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,186 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/21acb201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/21acb201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cc7ea5f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/21acb201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/4002c72bcfab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/4002c72bcfab00141ee9bf3050c1025b new file mode 100644 index 0000000..ae003dc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/4002c72bcfab00141ee9bf3050c1025b @@ -0,0 +1,52 @@ +package com.stek101.projectzulu.common.core; + + +public class DefaultProps { + + /* ModIDs, Dependencies, and Version */ + public static final String DesiredBefore = "after:ExtrabiomesXL@"; + public static final String VERSION_STRING = "1.7.10-1.4b"; + public static final int Version_Code = 1710135; + public static final String CoreModId = "ProjectZulu|Core"; + public static final String BlocksModId = "ProjectZulu|Block"; + public static final String MobsModId = "ProjectZulu|Mob"; + public static final String WorldModId = "ProjectZulu|World"; + public static final String DungeonModId = "ProjectZulu|Dungeon"; + public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; + + /* Packet Channels */ + public static final String defaultChannel = "Channel_Zulu"; + + /* Module Directory Keys */ + public static final String coreKey = "projectzulucore"; + public static final String mobKey = "projectzulumob"; + public static final String blockKey = "projectzulublock"; + public static final String worldKey = "projectzuluworld"; + public static final String dungeonKey = "projectzuludungeon"; + + /* Module Resource Directories */ + public static final String coreDiretory = "/mods/" + coreKey + "/"; + public static final String mobDiretory = "/mods/" + mobKey + "/"; + public static final String blockDiretory = "/mods/" + blockKey + "/"; + public static final String worldDiretory = "/mods/" + worldKey + "/"; + public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; + public static final String entitySoundDir = "mob/"; + public static final String entitySounds = entitySoundDir.replace("/", "."); + + /* Common Resource Sub-Directories */ + public static final String itemSubDir = "textures/blocks/"; + public static final String blockSubDir = "textures/blocks/"; +// public static final String blockSpriteSheet = blockDiretory + "/textures/blocks_projectzulu.png"; // TODO: Delete +// public static final String itemSpriteSheet = blockDiretory + "/textures/items_projectzulu.png"; // TODO: Delete + + /* Config Directories */ + public static final String configDirectory = "/Project Zulu/"; + public static final String customResourcesDirectory = "CustomResources/"; + public static final String streamingResourcesDirectory = "streaming/"; + public static final String soundResourcesDirectory = "sound/"; + public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; + public static final String moduleConfigFile = "ProjectZuluModules.cfg"; + public static final String tempConfigFile = "tempSettingsConfig.cfg"; + public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; + public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/41603fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/41603fe5c42100141fce95f06aba7e85 deleted file mode 100644 index f68843a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/41603fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/508e40f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/508e40f6c42100141fce95f06aba7e85 deleted file mode 100644 index 40ce1f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/508e40f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/509079a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/509079a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f390ed8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/509079a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,360 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - - //vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - - if (movingobjectposition != null) - { - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); - vec31 = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/806760f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/806760f5c42100141fce95f06aba7e85 deleted file mode 100644 index 8cad7cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/806760f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityVulture; -import com.ngb.projectzulu.common.mobs.models.ModelVulture; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/80fbc3ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/80fbc3ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6fd8db0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/80fbc3ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b14c58a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b14c58a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e2694c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b14c58a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,121 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b1f2f59ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b1f2f59ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 189c642..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/b1f2f59ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d1abe8fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d1abe8fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 624b63f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/d1abe8fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLog; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/e05834e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/e05834e4c42100141fce95f06aba7e85 deleted file mode 100644 index 117cbe3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/e05834e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/e0f0e3fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/e0f0e3fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9a2571..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/e0f0e3fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockJasper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/f20b05f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/f20b05f6c42100141fce95f06aba7e85 deleted file mode 100644 index d42b494..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7b/f20b05f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/016c9da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/016c9da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c041098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/016c9da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/21d1b1e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/21d1b1e5c42100141fce95f06aba7e85 deleted file mode 100644 index e11d92c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/21d1b1e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/5075dcf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/5075dcf5c42100141fce95f06aba7e85 deleted file mode 100644 index 7421432..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/5075dcf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/519a1ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/519a1ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b50e429..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/519a1ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.projectzulu.common; - -import projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/7052d406632300141086b96048d117bc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/7052d406632300141086b96048d117bc deleted file mode 100644 index ed043ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/7052d406632300141086b96048d117bc +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/71a29df6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/71a29df6c42100141fce95f06aba7e85 deleted file mode 100644 index 034866f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/71a29df6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/a0418bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/a0418bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 4b16818..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/a0418bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.BossHealthDisplayTicker; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import com.ngb.projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/c039b5a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/c039b5a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index da9b6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/c039b5a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFrog; -import projectzulu.common.mobs.models.ModelFrog; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/e0ed1001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/e0ed1001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 61a621f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7c/e0ed1001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBeaver; -import projectzulu.common.mobs.models.ModelBeaver; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BeaverDeclaration extends SpawnableDeclaration { - - public BeaverDeclaration() { - super("Beaver", 15, EntityBeaver.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (54 << 16) + (36 << 8) + 9; - eggColor2 = (67 << 16) + (45 << 8) + 11; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/10cafca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/10cafca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 500597d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/10cafca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,1046 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/11ded0fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/11ded0fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index fc1a690..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/11ded0fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAnkh; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/218b1ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/218b1ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 7b0cf84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/218b1ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,135 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelOstrichHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - - public ModelOstrichHead(){ - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 26F, -1F); - setRotation(BODYROT, -1.570796F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK1ROT.addChild(NECK3ROT); - BODYROT.addChild(NECK1ROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - switch ((int)skullState) { - case 1: - BODYROT.rotateAngleX = (float) (-90*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-10*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (25*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (30*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (40*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (30*Math.PI/180); - HEADROT.rotateAngleX = (float) (20*Math.PI/180); - break; - default: - BODYROT.rotateAngleX = (float) (0*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-35*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-30*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-25*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (-20*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (+25*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (+30*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (+35*Math.PI/180); - HEADROT.rotateAngleX = (float) (+50*Math.PI/180); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/60167afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/60167afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 487394d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/60167afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/606c3600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/606c3600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a70a9b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/606c3600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,345 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/61269de7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/61269de7c42100141fce95f06aba7e85 deleted file mode 100644 index e4020a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/61269de7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,84 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short length = par0DataInputStream.readShort(); - if (length < 0) - return null; - else { - byte[] compressed = new byte[length]; - par0DataInputStream.readFully(compressed); - return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed)); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/9063f3f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/9063f3f6c42100141fce95f06aba7e85 deleted file mode 100644 index 162677b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/9063f3f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemFoodProjectZulu extends ItemFood { - /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; - - /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; - - /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; - - /** - * If this field is true, the food can be consumed even if the player don't need to eat. - */ - private boolean alwaysEdible; - - /** - * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect - */ - private int potionId; - - /** set by setPotionEffect */ - private int potionDuration; - - /** set by setPotionEffect */ - private int potionAmplifier; - - /** probably of the set potion effect occurring */ - private float potionEffectProbability; - - public ItemFoodProjectZulu(int par2, float par3, boolean par4, String name) { - super(par2, par3, par4); - itemUseDuration = 32; - healAmount = par2; - isWolfsFavoriteMeat = par4; - saturationModifier = par3; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - --par1ItemStack.stackSize; - par3EntityPlayer.getFoodStats().func_151686_a(this, par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); - this.func_77849_c(par1ItemStack, par2World, par3EntityPlayer); - return par1ItemStack; - } - - protected void func_77849_c(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/91d722e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/91d722e5c42100141fce95f06aba7e85 deleted file mode 100644 index b338830..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/91d722e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/a03925a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/a03925a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 55aa04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/a03925a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingSingle extends TileEntityBrewingBase { - - public TileEntityBrewingSingle() { - brewingItemStacks = new ItemStack[2]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/d0330ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/d0330ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 2426a1c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7d/d0330ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0003059ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0003059ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee4d172..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0003059ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.spike.BlockSpikes; -import projectzulu.common.blocks.spike.RenderSpike; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/012608a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/012608a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c28ec15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/012608a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0174079ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0174079ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9756b5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/0174079ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockTumbleweed; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class TumbleweedDeclaration extends BlockDeclaration { - - public TumbleweedDeclaration() { - super("Tumbleweed"); - } - - @Override - protected boolean createBlock() { - BlockList.tumbleweed = Optional.of((new BlockTumbleweed()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tumbleweed.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/10e19c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/10e19c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7d78a1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/10e19c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionInvisibility extends SubItemPotionGeneric { - - public SubItemPotionInvisibility(Item itemID, int subID) { - super(itemID, subID, "potion.invisibility"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.invisibility); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/10e309f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/10e309f5c42100141fce95f06aba7e85 deleted file mode 100644 index 51f5566..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/10e309f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,349 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityBrewingBase extends TileEntity implements ISidedInventory { - - protected ItemStack[] brewingItemStacks = new ItemStack[4]; - - /** The itemstacks currently placed in the slots of the brewing stand */ - private int brewTime; - - /* an integer with each bit specifying whether that slot of the stand contains a potion */ - private int filledSlots; - - /* Ingredient Cache. Used to Check if an Ingredient has been Added or Removed */ - private Item ingredientID; - - /** - * Returns the name of the inventory. - */ - @Override - public String getInventoryName() { - return "container.brewing"; - } - - /** - * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's - * language. Otherwise it will be used directly. - */ - @Override - public boolean hasCustomInventoryName() { - return false; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[brewingItemStacks.length - 1].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[brewingItemStacks.length - 1].getItem(); - } - super.updateEntity(); - } - - public int getBrewTime() { - return this.brewTime; - } - - private boolean canBrew() { - if (brewingItemStacks.length > 1 && this.brewingItemStacks[brewingItemStacks.length - 1] != null - && this.brewingItemStacks[brewingItemStacks.length - 1].stackSize > 0) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - - if (!PotionIngredients.isPotionIngredient(ingredientStack)) { - return false; - } else { - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - return true; - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - return true; - } - } - } - } - return false; - } - - private void brewPotions() { - if (this.canBrew()) { - ItemStack ingredientStack = this.brewingItemStacks[brewingItemStacks.length - 1]; - for (int i = 0; i < brewingItemStacks.length - 1; ++i) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(brewingItemStacks[i])) { - SubItemPotion brewingSubPotion = SubItemPotionRegistry.INSTANCE.getPotion(brewingItemStacks[i]); - ItemStack resultPotion = brewingSubPotion != null ? brewingSubPotion.getPotionResult( - ingredientStack, brewingItemStacks[i]) : null; - if (resultPotion != null) { - brewingItemStacks[i].func_150996_a(resultPotion.getItem()); - brewingItemStacks[i].setItemDamage(resultPotion.getItemDamage()); - } - } else if (isWaterBottleOverride(ingredientStack, brewingItemStacks[i])) { - brewingItemStacks[i].func_150996_a(SubItemPotionList.BUBBLING.get().item); - brewingItemStacks[i].setItemDamage(SubItemPotionList.BUBBLING.get().subID); - } - } - - if (ingredientStack.getItem().hasContainerItem()) { - this.brewingItemStacks[brewingItemStacks.length - 1] = ingredientStack.getItem().getContainerItem( - brewingItemStacks[brewingItemStacks.length - 1]); - } else { - --this.brewingItemStacks[brewingItemStacks.length - 1].stackSize; - - if (this.brewingItemStacks[brewingItemStacks.length - 1].stackSize <= 0) { - this.brewingItemStacks[brewingItemStacks.length - 1] = null; - } - } - } - } - - /** - * Determines if the base regular Non-Potion Item that gets converted into a base Potion is present - * - * @param ingredient - * @param brewingStack - * @return - */ - private boolean isWaterBottleOverride(ItemStack ingredient, ItemStack brewingStack) { - if (brewingStack == null || ingredient == null || !ItemList.genericCraftingItems.isPresent()) { - return false; - } - - if (brewingStack.getItem() == Items.potionitem && brewingStack.getItemDamage() == 0) { - if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - if (SubItemPotionList.BUBBLING.isPresent()) { - return true; - } - } - } - return false; - } - - /** - * Returns the stack in slot i - */ - @Override - public ItemStack getStackInSlot(int par1) { - return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - */ - @Override - public ItemStack decrStackSize(int par1, int par2) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - */ - @Override - public ItemStack getStackInSlotOnClosing(int par1) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - ItemStack itemstack = this.brewingItemStacks[par1]; - this.brewingItemStacks[par1] = null; - return itemstack; - } else { - return null; - } - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - */ - @Override - public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - if (par1 >= 0 && par1 < this.brewingItemStacks.length) { - this.brewingItemStacks[par1] = par2ItemStack; - } - } - - /** - * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't - * this more of a set than a get?* - */ - @Override - public int getInventoryStackLimit() { - return 2; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - */ - @Override - public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false - : par1EntityPlayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - */ - @Override - public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return par1 == 3 ? PotionIngredients.isPotionIngredient(par2ItemStack) - : par2ItemStack.getItem() instanceof ItemPotion || par2ItemStack.getItem() == Items.glass_bottle; - } - - @SideOnly(Side.CLIENT) - public void setBrewTime(int par1) { - this.brewTime = par1; - } - - /** - * Get the size of the inventory relative to a specific side (integer) of the block. Related to Hopper. - */ - @Override - public int[] getAccessibleSlotsFromSide(int side) { - return side == 1 ? getIngredientSlotsForSide(side) : getPotionSlotsForSide(side); - } - - private int[] getPotionSlotsForSide(int side) { - int[] result = new int[brewingItemStacks.length - 1]; - for (int i = 0; i < result.length; i++) { - result[i] = i; - } - return result; - } - - private int[] getIngredientSlotsForSide(int side) { - return new int[] { brewingItemStacks.length - 1 }; - } - - /** - * Related to Hopper? - */ - @Override - public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { - return this.isItemValidForSlot(par1, par2ItemStack); - } - - /** - * Related to Hopper? - */ - @Override - public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", 10); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - - for (int i = 0; i < nbttaglist.tagCount(); ++i) { - NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); - byte b0 = nbttagcompound1.getByte("Slot"); - - if (b0 >= 0 && b0 < this.brewingItemStacks.length) { - this.brewingItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); - } - } - - this.brewTime = par1NBTTagCompound.getShort("BrewTime"); - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setShort("BrewTime", (short) this.brewTime); - NBTTagList nbttaglist = new NBTTagList(); - - for (int i = 0; i < this.brewingItemStacks.length; ++i) { - if (this.brewingItemStacks[i] != null) { - NBTTagCompound nbttagcompound1 = new NBTTagCompound(); - nbttagcompound1.setByte("Slot", (byte) i); - this.brewingItemStacks[i].writeToNBT(nbttagcompound1); - nbttaglist.appendTag(nbttagcompound1); - } - } - par1NBTTagCompound.setTag("Items", nbttaglist); - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - this.readFromNBT(tagCompound); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/20acb201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/20acb201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c01703d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/20acb201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30d2f69dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30d2f69dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b11728..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/30d2f69dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeDoubleSlabDeclaration extends BlockDeclaration { - - public PalmTreeDoubleSlabDeclaration() { - super("PalmTreeDoubleSlab", 2); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeDoubleSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreeSlab.get(), - BlockList.palmTreePlank.get())).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeDoubleSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/40cbbdfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/40cbbdfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4cca9a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/40cbbdfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,332 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/508eb59ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/508eb59ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1ccc1d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/508eb59ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityLimitedMobSpawnerRenderer extends TileEntitySpecialRenderer{ - public void renderTileEntityMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner, double xCoord, double yCoord, double zCoord, float par8){ - GL11.glPushMatrix(); - GL11.glTranslatef((float)xCoord + 0.5F, (float)yCoord, (float)zCoord + 0.5F); - Entity var9 = limitedMobSpawner.getMobEntity(); - - if (var9 != null){ - var9.setWorld(limitedMobSpawner.getWorldObj()); - float var10 = 0.4375F; - GL11.glTranslatef(0.0F, 0.4F, 0.0F); - GL11.glRotatef((float)(limitedMobSpawner.yaw2 + (limitedMobSpawner.yaw - limitedMobSpawner.yaw2) * (double)par8) * 10.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.4F, 0.0F); - GL11.glScalef(var10, var10, var10); - var9.setLocationAndAngles(xCoord, yCoord, zCoord, 0.0F, 0.0F); - RenderManager.instance.renderEntityWithPosYaw(var9, 0.0D, 0.0D, 0.0D, 0.0F, par8); - } - - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity par1TileEntity, double xCoord, double yCoord, double zCoord, float par8){ - this.renderTileEntityMobSpawner((TileEntityLimitedMobSpawner)par1TileEntity, xCoord, yCoord, zCoord, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/51f2152bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/51f2152bc52100141fce95f06aba7e85 deleted file mode 100644 index 3f682c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/51f2152bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,14 +0,0 @@ -package projectzulu.common; - -public class CommonProxyProjectZulu { - - public int addArmor(String armor) { - return 0; - } - - public void bossHealthTicker() { - } - - public void registerModelsAndRender() { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/91c5349ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/91c5349ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3023684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/91c5349ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderUniversalFlowerPot implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - // TODO: Render Universal Pot - renderer.renderStandardBlock(par1Block, par2, par3, par4); - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - IIcon var8 = par1Block.getBlockTextureFromSide(0); - float var9 = (var7 >> 16 & 255) / 255.0F; - float var10 = (var7 >> 8 & 255) / 255.0F; - float var11 = (var7 & 255) / 255.0F; - float var12; - float var14; - - if (EntityRenderer.anaglyphEnable) { - var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; - var9 = var12; - var10 = var13; - var11 = var14; - } - - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); - var12 = 0.1865F; - renderer.renderFaceXPos(par1Block, par2 - 0.5F + var12, par3, par4, var8); - renderer.renderFaceXNeg(par1Block, par2 + 0.5F - var12, par3, par4, var8); - renderer.renderFaceZPos(par1Block, par2, par3, par4 - 0.5F + var12, var8); - renderer.renderFaceZNeg(par1Block, par2, par3, par4 + 0.5F - var12, var8); - renderer.renderFaceYNeg(Blocks.dirt, par2, par3 - 0.35F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - renderer.renderFaceYPos(Blocks.dirt, par2, par3 - 0.5F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/b0476af4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/b0476af4c42100141fce95f06aba7e85 deleted file mode 100644 index c876caa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/b0476af4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/b0868a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/b0868a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 48d5627..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/b0868a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d00ea2e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d00ea2e4c42100141fce95f06aba7e85 deleted file mode 100644 index c9eef49..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/d00ea2e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,126 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.base.Optional; - -public class OptionalItemStack { - enum OptionalType { - BLOCK, ITEM, OREDIC; - } - - private OptionalType type = OptionalType.BLOCK; - private Optional itemBlock; - private int meta; - private int stackSize; - - public OptionalItemStack(Optional itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - - if (itemBlock.isPresent()) { - if (itemBlock.get() instanceof Item) { - type = OptionalType.ITEM; - } else if (itemBlock.get() instanceof Block) { - type = OptionalType.BLOCK; - } else if (itemBlock.get() instanceof String) { - type = OptionalType.OREDIC; - } - } else { - itemBlock = Optional.absent(); - } - } - - /* Item */ - public OptionalItemStack(Item itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.ITEM); - } - - /* Block */ - public OptionalItemStack(Block itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.BLOCK); - } - - /* Ore Dictionary String */ - public OptionalItemStack(String itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.OREDIC); - } - - /** Optional Parameter With Supplied Type */ - public OptionalItemStack(Optional itemBlock, OptionalType type) { - this(itemBlock, 1, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, OptionalType type) { - this(itemBlock, stackSize, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta, OptionalType type) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - this.type = type; - } - - public boolean isPresent() { - return itemBlock != null && itemBlock.isPresent(); - } - - public ItemStack createItemStack() { - switch (type) { - case BLOCK: - return new ItemStack((Block) (itemBlock.get()), stackSize, meta); - case ITEM: - return new ItemStack((Item) (itemBlock.get()), stackSize, meta); - default: - throw new IllegalStateException("Cannot create ItemStack for OptionalType"); - } - } - - public Object createRecipeObject() { - switch (type) { - case BLOCK: - case ITEM: - return createItemStack(); - case OREDIC: - return itemBlock.get(); - default: - throw new IllegalStateException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0b908fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0b908fac42100141fce95f06aba7e85 deleted file mode 100644 index babf4e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e0b908fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockJasper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class JasperDeclaration extends BlockDeclaration { - - public JasperDeclaration() { - super("Jasper"); - } - - @Override - protected boolean createBlock() { - BlockList.jasper = Optional.of((new BlockJasper()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.jasper.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e17198e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e17198e4c42100141fce95f06aba7e85 deleted file mode 100644 index c218251..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e17198e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; - -public interface ItemBlockDeclaration { - - public enum Type { - Block, Item; - } - - public abstract Type getType(); - - public abstract int getRegisterPass(); - - /** - * Loads ands saves the ItemBlock from the configuration filed. - * - * Called twice. Once for ItemBlocks already in the Config and again for new Items. Pass is indicated by readOnly - * boolean. - * - * @param config Configuration file to read save from - * @param readOnly Boolean indicating this is the pass for ItemBlock already in the Configuration file - */ - public abstract void createWithConfig(Configuration config, boolean readOnly); - - /** - * Registers the Created Block with the Environment - * - * i.e GameRegistry - */ - public abstract void register(Side side); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e1dfe29ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e1dfe29ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 421f59e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e1dfe29ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,116 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e1e9109ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e1e9109ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a02d752..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/e1e9109ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/f049acfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/f049acfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c7a2e26..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/f049acfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/f0a325a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/f0a325a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb76d8d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7e/f0a325a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/0004c101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/0004c101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e8a6fdd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/0004c101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,334 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00780701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00780701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cec3595..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/00780701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -//package com.ngb.projectzulu.common.mobs.entityai; -// -//import net.minecraft.command.IEntitySelector; -//import net.minecraft.entity.EntityLiving; -//import projectzulu.common.mobs.EntityGenericCreature; -//import projectzulu.common.mobs.EntityStates; -// -//public class EntityZuluAINearestRevengeTarget extends EntityAINearestAttackableTarget{ -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5){ -// super(par1EntityLiving, par2Class, par3, par4, par5); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5, boolean par6){ -// super(par1EntityLiving, par2Class, par3, par4, par5, par6); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ -// super(par1, par2, par3, par4, par5, par6, par7IEntitySelector); -// } -// -// /** -// * Returns whether the EntityAIBase should begin execution. -// */ -// public boolean shouldExecute() { -// /* getAITarget acts as Tempory target timer, as it only lasts a few seconds, Reminder: getAttackTarget is the persistent form */ -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.shouldExecute(); -// } -// return false; -// } -// -// @Override -// public boolean continueExecuting() { -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.continueExecuting(); -// } -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/008b8ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/008b8ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 65979d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/008b8ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/013d33f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/013d33f5c42100141fce95f06aba7e85 deleted file mode 100644 index 77cea2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/013d33f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,169 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/019ac2e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/019ac2e5c42100141fce95f06aba7e85 deleted file mode 100644 index bd79ea2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/019ac2e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/0221fcf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/0221fcf7c42100141fce95f06aba7e85 deleted file mode 100644 index ddfe4d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/0221fcf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeDiagonal extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeDiagonal(boolean inverted) { - super(inverted); - } - - /** - * BPOasisEdgeDiagonal G GG GGG - */ - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ - (!inverted ? piecePos.posX : cellSize - 1 - piecePos.posX) >= 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "diagonal"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10d7fd9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10d7fd9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2bb5234..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/10d7fd9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluStairs; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/2003959dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/2003959dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 53dfefa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/2003959dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.api; - -import projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/2017629ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/2017629ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1133821..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/2017629ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -/** - * Terrain Feature that is Restricted by Biome - */ -public abstract class BiomeFeature extends BaseFeature { - - /** List of Biome Package Names that this Feature can Spawn in */ - protected ArrayList biomesToSpawn = new ArrayList(); - - public BiomeFeature(String featureName, Size size) { - super(featureName, size); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - return biomesToSpawn.contains(getBiomePackageName(world.getBiomeGenForCoords(genBlockCoords.posX, - genBlockCoords.posZ))); - } - return false; - } - - protected abstract Collection getDefaultBiomeList(); - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - Collection defaultBiomesToSpawn = getDefaultBiomeList(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - if (config.getFeatureProperty(this, "GeneratingBiomes", - getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i]), - defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName)).getBoolean(false)) { - biomesToSpawn.add(getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i])); - } - } - } - - private String getBiomePackageName(BiomeGenBase biome) { - return biome.getClass().getName() + "." + biome.biomeName; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/20b018f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/20b018f5c42100141fce95f06aba7e85 deleted file mode 100644 index cb84299..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/20b018f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/20b48d00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/20b48d00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 57ac02f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/20b48d00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/219fe9e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/219fe9e4c42100141fce95f06aba7e85 deleted file mode 100644 index 897b6f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/219fe9e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/41d04da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/41d04da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5466309..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/41d04da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/612370f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/612370f9c42100141fce95f06aba7e85 deleted file mode 100644 index a87969e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/612370f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c148f2fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c148f2fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 45bcf4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/c148f2fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemScale; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/d07a0aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/d07a0aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a5aa7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/d07a0aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/d14fa0e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/d14fa0e6c42100141fce95f06aba7e85 deleted file mode 100644 index 0302188..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/d14fa0e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectLabyrinth; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/f04c03f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/f04c03f8c42100141fce95f06aba7e85 deleted file mode 100644 index 5d9fb30..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/f04c03f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/f17934f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/f17934f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3626cd1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/7f/f17934f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,121 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/104fd3fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/104fd3fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6333318..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/104fd3fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/208dfb9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/208dfb9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4262051..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/208dfb9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/406f75e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/406f75e6c42100141fce95f06aba7e85 deleted file mode 100644 index 673132a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/406f75e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/5089a9f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/5089a9f6c42100141fce95f06aba7e85 deleted file mode 100644 index 7da6b47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/5089a9f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,120 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/51934c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/51934c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c379644..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/51934c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/51c5fdfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/51c5fdfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77da7e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/51c5fdfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,213 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60d0dda1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60d0dda1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41f8886..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/60d0dda1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,140 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBeaver extends ModelBase { - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer HEADROT; - ModelRenderer TAILROT; - - public ModelBeaver() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - setTextureOffset("TAILROT.tail1", 0, 0); - setTextureOffset("TAILROT.tail2", 0, 3); - setTextureOffset("TAILROT.tail3", 0, 5); - setTextureOffset("TAILROT.tail4", 12, 0); - setTextureOffset("TAILROT.tail5", 12, 5); - - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -4F, -10F, 9, 8, 10); - body.setRotationPoint(0F, 18F, 7F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 8, 10); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - leg4.setRotationPoint(3.5F, 22F, 6F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 10); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - leg3.setRotationPoint(-3.5F, 22F, 6F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 10); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - leg1.setRotationPoint(-3.5F, 22F, -2F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 8, 10); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - leg2.setRotationPoint(3.5F, 22F, -2F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 18F, -3F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 1F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 3F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 3F, -5F, 1, 1, 1); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 7F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail1", -1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addBox("tail2", -2F, -0.5F, 2F, 4, 1, 1); - TAILROT.addBox("tail3", -2.5F, -0.5F, 3F, 5, 1, 1); - TAILROT.addBox("tail4", -3F, -0.5F, 4F, 6, 1, 4); - TAILROT.addBox("tail5", -2.5F, -0.5F, 8F, 5, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - HEADROT.render(f5); - TAILROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - TAILROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/714d2ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/714d2ce5c42100141fce95f06aba7e85 deleted file mode 100644 index 3f5b6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/714d2ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,167 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/907735a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/907735a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b0cf84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/907735a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,135 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelOstrichHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - - public ModelOstrichHead(){ - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 26F, -1F); - setRotation(BODYROT, -1.570796F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK1ROT.addChild(NECK3ROT); - BODYROT.addChild(NECK1ROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - switch ((int)skullState) { - case 1: - BODYROT.rotateAngleX = (float) (-90*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-10*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (25*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (30*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (40*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (30*Math.PI/180); - HEADROT.rotateAngleX = (float) (20*Math.PI/180); - break; - default: - BODYROT.rotateAngleX = (float) (0*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-35*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-30*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-25*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (-20*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (+25*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (+30*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (+35*Math.PI/180); - HEADROT.rotateAngleX = (float) (+50*Math.PI/180); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/90acd09dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/90acd09dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 09736a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/90acd09dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - - - -public class ModelTreeEntHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer NOSEROT; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer BACKTREESTEM6; - - public ModelTreeEntHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("BODYROT.mosscb2", 0, 28); - setTextureOffset("BODYROT.mosscb", 0, 20); - setTextureOffset("HEADROT.head", 88, 0); - setTextureOffset("HEADROT.brow5", 98, 18); - setTextureOffset("HEADROT.brow4", 98, 18); - setTextureOffset("HEADROT.brow3", 98, 18); - setTextureOffset("HEADROT.brow2", 106, 17); - setTextureOffset("HEADROT.brow1", 106, 13); - setTextureOffset("NOSEROT.nose1", 90, 16); - setTextureOffset("NOSEROT.nose2", 94, 20); - setTextureOffset("NOSEROT.nose3", 90, 22); - setTextureOffset("BACKTREESTEM5.backtreestem5", 32, 28); - setTextureOffset("BACKTREESTEM5.backtreesleaves5", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreesleaves6", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreestem6", 32, 28); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 24F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 0F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("mosscb2", -3.5F, -3F, 1F, 7, 3, 4); - BODYROT.addBox("mosscb", -4.5F, -3F, -3F, 9, 3, 4); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2.5F, -9F, -2.5F, 5, 12, 4); - HEADROT.addBox("brow5", 1.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow4", -0.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow3", -2.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow2", -2.5F, -3.5F, -3.5F, 5, 3, 1); - HEADROT.addBox("brow1", -2.5F, -7.5F, -3.5F, 5, 2, 1); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - NOSEROT.addBox("nose1", -0.5F, 0F, -2.5F, 1, 1, 2); - NOSEROT.addBox("nose2", -0.5F, 1F, -2.5F, 1, 1, 1); - NOSEROT.addBox("nose3", -1F, 2F, -3F, 2, 2, 2); - HEADROT.addChild(NOSEROT); - BODYROT.addChild(HEADROT); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BACKTREESTEM5.setRotationPoint(3F, -3F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - BACKTREESTEM5.addBox("backtreestem5", -0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addBox("backtreesleaves5", -3F, -7F, -3F, 6, 3, 6); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BACKTREESTEM6.setRotationPoint(-3F, -3F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - BACKTREESTEM6.addBox("backtreesleaves6", -3F, -7F, -3F, 6, 3, 6); - BACKTREESTEM6.addBox("backtreestem6", -0.5F, -4F, -0.5F, 1, 4, 1); - BODYROT.addChild(BACKTREESTEM6); - CENTERROT.addChild(BODYROT); - } - - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BACKTREESTEM5.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM5.rotateAngleZ = (float)(+20*Math.PI/180f); - - BACKTREESTEM6.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM6.rotateAngleZ = (float)(-20*Math.PI/180f); - - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/90c028f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/90c028f6c42100141fce95f06aba7e85 deleted file mode 100644 index 5b695b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/90c028f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/b2a6c1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/b2a6c1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3976acd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/b2a6c1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/c0b27b00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/c0b27b00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8567684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/c0b27b00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,206 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/c15f16f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/c15f16f8c42100141fce95f06aba7e85 deleted file mode 100644 index 3e05ee2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/c15f16f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/e0eea3f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/e0eea3f7c42100141fce95f06aba7e85 deleted file mode 100644 index 1765f3e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/e0eea3f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/e182ad9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/e182ad9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca7a128..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/e182ad9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a temperature Item - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempItem { - - /** - * Factor that adds to the current Player Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public Float getPlayerTempContributionFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public Float getLocationTemperatureFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate when the Item is in hand - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/f0b8729ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/f0b8729ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cddd77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8/f0b8729ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,322 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/10665500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/10665500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7158ec7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/10665500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/30323b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/30323b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a1b950d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/30323b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; -import projectzulu.common.mobs.renders.RenderMummyPharaoh; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/31f1ad01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/31f1ad01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8a28ab9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/31f1ad01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/61b26df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/61b26df9c42100141fce95f06aba7e85 deleted file mode 100644 index f89fb38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/61b26df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/70b8a3a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/70b8a3a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8e06422..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/70b8a3a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisPool implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta water = new BlockWithMeta(Blocks.water); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return water; - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisPool"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/80a33ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/80a33ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 66987f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/80a33ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemAloeVera extends ItemBlock { - - public ItemAloeVera(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "base_1"; - break; - } - case 1: { - name = "base_2"; - break; - } - case 2: { - name = "base_3"; - break; - } - case 3: { - name = "base_4"; - break; - } - case 4: { - name = "flower_1"; - break; - } - case 5: { - name = "flower_2"; - break; - } - case 6: { - name = "flower_3"; - break; - } - case 7: { - name = "flower_4"; - break; - } - case 8: { - name = "flower_5"; - break; - } - default: - name = "base_1"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/904731a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/904731a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f7fe156..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/904731a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class EntityPZPotion extends EntityPotion { - - private ItemStack potionStack; - - public EntityPZPotion(World par1World) { - super(par1World); - } - - public EntityPZPotion(World world, EntityLivingBase living, ItemStack itemStack) { - super(world, living, itemStack); - potionStack = itemStack; - } - - public EntityPZPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { - super(par1World, par2, par4, par6, par8ItemStack); - potionStack = par8ItemStack; - } - - @Override - public int getPotionDamage() { - return potionStack != null ? potionStack.getItemDamage() : 0; - } - - @Override - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { - if (!this.worldObj.isRemote && potionStack.getItem() != null && potionStack.getItem() instanceof ItemPotion) { - @SuppressWarnings("unchecked") - List effectList = ((ItemPotion) potionStack.getItem()).getEffects(potionStack); - - if (effectList != null && !effectList.isEmpty()) { - AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - @SuppressWarnings("unchecked") - List entityList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, - axisalignedbb); - - if (entityList != null && !entityList.isEmpty()) { - Iterator iterator = entityList.iterator(); - - while (iterator.hasNext()) { - EntityLivingBase entityliving = iterator.next(); - double squareDistance = this.getDistanceSqToEntity(entityliving); - - if (squareDistance < 16.0D) { - double distanceFactor = 1.0D - Math.sqrt(squareDistance) / 4.0D; - - if (entityliving == par1MovingObjectPosition.entityHit) { - distanceFactor = 1.0D; - } - - Iterator iterator1 = effectList.iterator(); - - while (iterator1.hasNext()) { - PotionEffect potioneffect = iterator1.next(); - int potionID = potioneffect.getPotionID(); - - if (Potion.potionTypes[potionID].isInstant()) { - Potion.potionTypes[potionID].affectEntity(this.getThrower(), entityliving, - potioneffect.getAmplifier(), distanceFactor); - } else { - int potionDuration = (int) (distanceFactor * potioneffect.getDuration() + 0.5D); - - if (potionDuration > 20) { - entityliving.addPotionEffect(new PotionEffect(potionID, potionDuration, - potioneffect.getAmplifier())); - } - } - } - } - } - } - } - - this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), - (int) Math.round(this.posZ), potionStack.getItemDamage()); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - if (par1NBTTagCompound.hasKey("Potion")) { - potionStack = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); - } - - if (potionStack == null) { - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - if (potionStack != null) { - par1NBTTagCompound.setTag("Potion", potionStack.writeToNBT(new NBTTagCompound())); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/906fd2fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/906fd2fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8d0efb5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/906fd2fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityElephant; -import projectzulu.common.mobs.models.ModelElephant; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/a0d594a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/a0d594a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6d6e322..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/a0d594a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,132 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c06e4cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c06e4cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 18e3ee7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c06e4cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c16422a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c16422a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b51432b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/c16422a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e06676a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e06676a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c2dd42..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e06676a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0b23cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0b23cf5c42100141fce95f06aba7e85 deleted file mode 100644 index c81a2ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e0b23cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummy extends ModelBiped { - - /** - * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms - * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how - * "far" arms and legs can swing at most. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e1163ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e1163ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 6697240..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e1163ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e161e6fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e161e6fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f30a301..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/80/e161e6fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeDoubleSlabDeclaration extends BlockDeclaration { - - public PalmTreeDoubleSlabDeclaration() { - super("PalmTreeDoubleSlab", 2); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeDoubleSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreeSlab.get(), - BlockList.palmTreePlank.get())).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeDoubleSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/009795f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/009795f7c42100141fce95f06aba7e85 deleted file mode 100644 index 5e127d1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/009795f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemCoconutSeed; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/013032f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/013032f9c42100141fce95f06aba7e85 deleted file mode 100644 index cfc8111..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/013032f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,241 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Reminder: This is technically a 'Flying' Entity - */ -public class EntityFollower extends EntityLiving { - - EntityMaster masterEntity; - int followerIndex = -1; - - public int getFollowerIndex() { - return followerIndex; - } - - private Vec3 targetPosition = Vec3.createVectorHelper(0, 0, 0); - - public void setTargetPosition(Vec3 targetPosition) { - this.targetPosition = targetPosition; - } - - float targetRotation; - - public void setTargetRotation(float targetRotation) { - this.targetRotation = wrapAngleTo360(targetRotation); - } - - boolean shouldBeDying = false; - - /* Client Side Variable that Controls if it should Sync its Contents with Client Master */ - boolean isClientSetup = false; - - public EntityFollower(World par1World) { - super(par1World); - noClip = true; - setSize(0.65f, 0.5f); - } - - public EntityFollower(World par1World, double parx, double pary, double parz, EntityMaster masterEntity, - int followerIndex) { - this(par1World); - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.followerIndex = followerIndex; - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns False so that Entity doesn't Suffocate while in a wall - */ - @Override - public boolean isEntityInsideOpaqueBlock() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - - /* - * Note that the Client Side Entity will exists for several ticks before the masterEntity is Synced from server, - * So we only Check if should SetDead on Server - * - * Also, onReload, the Server will re-create its Children, this the old Children must dye. - */ - if (masterEntity == null && ticksExisted > 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/10d7f9f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/10d7f9f7c42100141fce95f06aba7e85 deleted file mode 100644 index 9836e84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/10d7f9f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisPool implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta water = new BlockWithMeta(Blocks.water); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return water; - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisPool"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/119328f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/119328f9c42100141fce95f06aba7e85 deleted file mode 100644 index dbf68d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/119328f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,105 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/11ebc6f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/11ebc6f8c42100141fce95f06aba7e85 deleted file mode 100644 index d4be09a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/11ebc6f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRabbit; -import com.ngb.projectzulu.common.mobs.models.ModelRabbit; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RabbitDeclaration extends SpawnableDeclaration { - - public RabbitDeclaration() { - super("Rabbit", 21, EntityRabbit.class, EnumCreatureType.creature); - setSpawnProperties(15, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (239 << 16) + (179 << 8) + 83; - eggColor2 = (237 << 16) + (208 << 8) + 166; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.RabbitsFoot.meta(), 8); - customMobData.entityProperties = new EntityProperties(10f, 1.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/120418ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/120418ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75a70a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/120418ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; - -public class SlotBrewingStandSinglePotion extends Slot { - /** The player that has this container open. */ - private EntityPlayer player; - - public SlotBrewingStandSinglePotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, - int par5) { - super(par2IInventory, par3, par4, par5); - this.player = par1EntityPlayer; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return canHoldPotion(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 1; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack itemStack) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack)) { - this.player.addStat(AchievementList.potion, 1); - } - - super.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - /** - * Returns true if this itemstack can be filled with a potion - */ - public static boolean canHoldPotion(ItemStack itemStack) { - return itemStack != null - && (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack) || itemStack.getItem() == Items.potionitem - && itemStack.getItemDamage() == 0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/201583e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/201583e4c42100141fce95f06aba7e85 deleted file mode 100644 index 4d3ac86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/201583e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiContainerUniversalFlowerPot extends GuiContainer { - public final static ResourceLocation FLOWERPOT_GUI = new ResourceLocation(DefaultProps.coreKey, - "gui/FlowerPotGUI.png"); - - public GuiContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntity) { - super(new ContainerUniversalFlowerPot(inventoryPlayer, tileEntity)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Flower Pot", 8, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(FLOWERPOT_GUI); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/20c9edf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/20c9edf7c42100141fce95f06aba7e85 deleted file mode 100644 index 50ac433..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/20c9edf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/3175c19ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/3175c19ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e446697..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/3175c19ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/415d879fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/415d879fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 98d0454..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/415d879fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.PotionList; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.potion.effects.PotionCleansing; -import projectzulu.common.potion.effects.PotionCurse; -import projectzulu.common.potion.effects.PotionHarm2; -import projectzulu.common.potion.effects.PotionHeal2; -import projectzulu.common.potion.effects.PotionIncendiary; -import projectzulu.common.potion.effects.PotionSlowFall; -import projectzulu.common.potion.effects.PotionThorns; -import projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/42d6d8e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/42d6d8e4c42100141fce95f06aba7e85 deleted file mode 100644 index 48d5627..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/42d6d8e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/713b3af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/713b3af8c42100141fce95f06aba7e85 deleted file mode 100644 index 07f9153..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/713b3af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,543 +0,0 @@ -//package com.ngb.projectzulu.common.temperature; -// -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.src.BiomeGenBase; -//import net.minecraft.src.Block; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.EntityPlayer; -//import net.minecraft.src.EntityPlayerMP; -//import net.minecraft.src.Material; -//import net.minecraft.src.NBTTagCompound; -//import net.minecraft.src.Potion; -//import net.minecraft.src.PotionEffect; -//import net.minecraft.src.World; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class TemperatureTickerAttempt2 implements ITickHandler, IPlayerTracker{ -// -// public static final int tempDataWatcher = 18; -// -// /* Player Tempurature HashMaps */ -// private static float playerTemperature = 0; -//// private static Map temperatureMap = new HashMap(); -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// private static Map playerLocTempMap = new HashMap(); -// -//// private static Map playerOuterTempModifierMap = new HashMap(); -// -//// private static float[] blockTempMod = new float[4096]; -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private static float defaultTemperature = 0; -// -// private short DirtyFlag = 0; -// public TemperatureTickerAttempt2(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( lastWorldNameMap.containsKey( player.getEntityName() ) ){ -//// playerTemperature = temperatureMap.get( player.getEntityName() ); -// playerTemperature = getTempFromDataWatcher(player, tempDataWatcher); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -//// System.out.println("Should be Reading :".concat(worldName).concat(lastWorldName) ); -// -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// -//// System.out.println( "SETUP" ); -// -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// -//// /* Read From File */ -//// if ( HasPendingRead() ){ -//// readNBTFromFile(player); -//// ClearPendingRead(); -////// System.out.println( "READ" ); -//// } -// -// } -// -// /* Get Outside Temperature */ -// Float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// Float unTouchedPlayerLocationTemperature = playerLocationTemperature; -// Float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -//// playerLocationTemperature -= 0.1f*Math.abs(worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature()); -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -//// playerLocationTemperature += item.getAddToPlayTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -//// playerTemperature += item.getAddToLocTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// useFastHeatTransfer = currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 100 - (int)playerTemperatureDegrees)); -// -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Set Temperature To Datawatcher on Server Side */ -// if(player instanceof EntityPlayerMP){ -// updateTempInDataWatcher(player, tempDataWatcher, playerTemperature); -// } -// -// /* Save Temperature To Map*/ -//// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -//// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -//// if(player instanceof EntityPlayerMP){ -//// -//// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -//// DataOutputStream data = new DataOutputStream(bytes); -////// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -//// try { -//// data.writeFloat(playerTemperature); -//// } catch (Exception e) { -//// e.printStackTrace(); -//// } -//// -//// Packet250CustomPayload packet = new Packet250CustomPayload(); -//// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -//// packet.data = bytes.toByteArray(); -//// packet.length = packet.data.length; -//// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -////// System.out.println( player.getEntityName().concat("Sent Packet ")); -//// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// try -// { -// -////// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// // File file = new File(ModLoader.getMinecraftInstance().getMinecraftDir() + "/saves/" + ModLoader.getMinecraftInstance().theWorld.saveHandler.getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// if(!file.exists()) -//// { -//// file.createNewFile(); -//// } -//// FileOutputStream fileoutputstream = new FileOutputStream(file); -//// NBTTagCompound nbttagcompound = new NBTTagCompound(); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), getTempFromDataWatcher(player, tempDataWatcher) ); -// -//// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), playerTemperature); -// -//// CompressedStreamTools.writeCompressed(nbttagcompound, fileoutputstream); -//// fileoutputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// try -// { -//// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// -//// if(!file.exists()) -//// { -//// return; -//// } -//// FileInputStream fileinputstream = new FileInputStream(file); -//// NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// if (nbttagcompound.hasKey( player.getEntityName().concat("zulu_temperature_a") )){ -// updateTempInDataWatcher(player, tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -// -//// player.getDataWatcher().updateObject(tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -//// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") ); -// } -// -//// fileinputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -//// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -//// -//// /* Get Relevent Data From DataStream */ -//// float tempTemp = playerTemperature; -//// try { -//// tempTemp = data.readFloat(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// } -//// -//// /* Make Sure Player Exists, then Assign data to map */ -//// if(temperatureMap.containsKey(sender.getEntityName())){ -//// temperatureMap.put(sender.getEntityName(), tempTemp); -////// System.out.println( sender.getEntityName().concat("Received Packet ")); -//// -//// } -//// -//// -//// } -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -//// temperatureMap.put(player.getEntityName(), 0.0f); -// -// lastWorldNameMap.put(player.getEntityName(), ""); -// player.getDataWatcher().addObject(tempDataWatcher, (int)playerTemperature); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -//// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// -// } -// -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell) && !player.worldObj.isRemote){ -// player.getDataWatcher().updateObject(tempDataWatcher, defaultTemperature); -//// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -//// System.out.println("Player Respawned"); -// -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) getTempFromDataWatcher(player, tempDataWatcher); -//// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static void updateTempInDataWatcher(EntityPlayer player, int index, float value){ -// player.getDataWatcher().updateObject(index, (int)value); -// } -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static Float getTempFromDataWatcher(EntityPlayer player, int index){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) player.getDataWatcher().getWatchableObjectInt(index); -// } -// return 0f; -// } -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/915a8501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/915a8501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 46c5462..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/915a8501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/b07989a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/b07989a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f1b984a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/b07989a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d27eb0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d27eb0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dfda6f6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/d27eb0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityElephant; -import projectzulu.common.mobs.models.ModelElephant; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/e1780af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/e1780af8c42100141fce95f06aba7e85 deleted file mode 100644 index ae6a990..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/e1780af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,225 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/f26f06fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/f26f06fac42100141fce95f06aba7e85 deleted file mode 100644 index 908ef13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/81/f26f06fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.heads.BlockMobHeads; -import com.ngb.projectzulu.common.blocks.heads.ItemMobHeads; -import com.ngb.projectzulu.common.blocks.heads.TileEntityMobHeads; -import com.ngb.projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/10d087e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/10d087e4c42100141fce95f06aba7e85 deleted file mode 100644 index 8d64f28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/10d087e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.util; - -import com.google.common.base.CharMatcher; - -public class StringHelper { - - public static String simplifyStringNameForDisplay(String string, int characterLimit, String splitString){ - /* Remove Surpluous Creature Data (ProjectZulu.Armadillo) */ - String[] stringParts = string.split(splitString); - String displayName; - /* Shorten Name to Declared Number of Character */ - if(stringParts.length > 0){ - displayName = stringParts[stringParts.length-1]; - }else{ - displayName = string; - } - - if(displayName.length() > characterLimit){ - displayName = displayName.substring(0, characterLimit); - } - return displayName; - } - - public static String toTitleCase(String string){ - return string.toUpperCase().replace(string.toUpperCase().substring(1), string.substring(1).toLowerCase()); - } - - public static int parseInteger(String integer, String regexRetain){ - return Integer.parseInt(CharMatcher.anyOf(regexRetain).retainFrom(integer)); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/111d8ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/111d8ff9c42100141fce95f06aba7e85 deleted file mode 100644 index c3a2e07..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/111d8ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,345 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/307a589ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/307a589ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb54ce0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/307a589ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/3245bda0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/3245bda0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7e219a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/3245bda0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/40ccaae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/40ccaae5c42100141fce95f06aba7e85 deleted file mode 100644 index 4fc8215..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/40ccaae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,222 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelPenguin extends ModelBase { - private ModelRenderer BODYROT; - private ModelRenderer TAILROT; - private ModelRenderer HEADROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer WINGLEFROT; - private ModelRenderer LEGLEFROT; - private ModelRenderer FOOTLEFROT; - private ModelRenderer TOELEF2ROT; - private ModelRenderer TOELEF1ROT; - private ModelRenderer TOELEF3ROT; - private ModelRenderer LEGRIGROT; - private ModelRenderer FOOTRIGROT; - private ModelRenderer TOERIG2ROT; - private ModelRenderer TOERIG1ROT; - private ModelRenderer TOERIG3ROT; - - public ModelPenguin() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 13); - setTextureOffset("BODYROT.bodydec", 37, 0); - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - setTextureOffset("TAILROT.tail3", 50, 11); - setTextureOffset("TAILROT.tail2", 40, 11); - setTextureOffset("TAILROT.tail1", 30, 11); - setTextureOffset("WINGRIGROT.wingrig", 44, 15); - setTextureOffset("WINGLEFROT.winglef", 30, 15); - setTextureOffset("LEGLEFROT.leglef", 52, 0); - setTextureOffset("TOELEF2ROT.toelefbase2", 56, 7); - setTextureOffset("TOELEF2ROT.toelefclaw2", 60, 19); - setTextureOffset("TOELEF2ROT.toeleftop2", 58, 16); - setTextureOffset("TOELEF1ROT.toelefbase1", 56, 7); - setTextureOffset("TOELEF1ROT.toelefclaw1", 60, 19); - setTextureOffset("TOELEF1ROT.toeleftop1", 58, 16); - setTextureOffset("TOELEF3ROT.toelefbase3", 56, 7); - setTextureOffset("TOELEF3ROT.toelefclaw3", 60, 19); - setTextureOffset("TOELEF3ROT.toeleftop3", 58, 16); - setTextureOffset("LEGRIGROT.legrig", 52, 0); - setTextureOffset("TOERIG2ROT.toerigbase2", 56, 7); - setTextureOffset("TOERIG2ROT.toerigclaw2", 60, 19); - setTextureOffset("TOERIG2ROT.toerigtop2", 58, 16); - setTextureOffset("TOERIG1ROT.toerigbase1", 56, 7); - setTextureOffset("TOERIG1ROT.toerigclaw1", 60, 19); - setTextureOffset("TOERIG1ROT.toerigtop1", 58, 16); - setTextureOffset("TOERIG3ROT.toerigbase3", 56, 7); - setTextureOffset("TOERIG3ROT.toerigclaw3", 60, 19); - setTextureOffset("TOERIG3ROT.toerigtop3", 58, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -4.5F, -10F, -4F, 9, 13, 6); - BODYROT.addBox("bodydec", -3F, -7.5F, -5F, 6, 9, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -10F, -1.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tail3.mirror = true; - TAILROT.addBox("tail3", -1F, 1F, 2F, 2, 1, 3); - // tail3.mirror = false; - TAILROT.addBox("tail2", -1.5F, 0F, 0F, 3, 2, 2); - TAILROT.addBox("tail1", -2F, -1F, -1F, 4, 3, 1); - BODYROT.addChild(TAILROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(4.5F, -10F, -1F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGRIGROT); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-4.5F, -10F, -1F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGLEFROT); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-3F, 3F, -0.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("leglef", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTLEFROT = new ModelRenderer(this, "FOOTLEFROT"); - FOOTLEFROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTLEFROT, 0F, 0F, 0F); - FOOTLEFROT.mirror = true; - TOELEF2ROT = new ModelRenderer(this, "TOELEF2ROT"); - TOELEF2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOELEF2ROT, 0F, 0F, 0F); - TOELEF2ROT.mirror = true; - TOELEF2ROT.addBox("toelefbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF2ROT.addBox("toelefclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF2ROT.addBox("toeleftop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF2ROT); - TOELEF1ROT = new ModelRenderer(this, "TOELEF1ROT"); - TOELEF1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOELEF1ROT, 0F, 0F, 0F); - TOELEF1ROT.mirror = true; - TOELEF1ROT.addBox("toelefbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF1ROT.addBox("toelefclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF1ROT.addBox("toeleftop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF1ROT); - TOELEF3ROT = new ModelRenderer(this, "TOELEF3ROT"); - TOELEF3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOELEF3ROT, 0F, 0F, 0F); - TOELEF3ROT.mirror = true; - TOELEF3ROT.addBox("toelefbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF3ROT.addBox("toelefclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF3ROT.addBox("toeleftop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF3ROT); - LEGLEFROT.addChild(FOOTLEFROT); - BODYROT.addChild(LEGLEFROT); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(3F, 3F, -0.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("legrig", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTRIGROT = new ModelRenderer(this, "FOOTRIGROT"); - FOOTRIGROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTRIGROT, 0F, 0F, 0F); - FOOTRIGROT.mirror = true; - TOERIG2ROT = new ModelRenderer(this, "TOERIG2ROT"); - TOERIG2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOERIG2ROT, 0F, 0F, 0F); - TOERIG2ROT.mirror = true; - TOERIG2ROT.addBox("toerigbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG2ROT.addBox("toerigclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG2ROT.addBox("toerigtop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG2ROT); - TOERIG1ROT = new ModelRenderer(this, "TOERIG1ROT"); - TOERIG1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOERIG1ROT, 0F, 0F, 0F); - TOERIG1ROT.mirror = true; - TOERIG1ROT.addBox("toerigbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG1ROT.addBox("toerigclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG1ROT.addBox("toerigtop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG1ROT); - TOERIG3ROT = new ModelRenderer(this, "TOERIG3ROT"); - TOERIG3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOERIG3ROT, 0F, 0F, 0F); - TOERIG3ROT.mirror = true; - TOERIG3ROT.addBox("toerigbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG3ROT.addBox("toerigclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG3ROT.addBox("toerigtop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG3ROT); - LEGRIGROT.addChild(FOOTRIGROT); - BODYROT.addChild(LEGRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -20), +20) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGRIGROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODYROT.rotateAngleZ = MathHelper.cos(par2 * 0.6662F * 2f) * 0.1F * par3; - - TAILROT.rotateAngleX = (float) (-20 * Math.PI / 180 + (MathHelper.cos(par2 * 0.6662F * 2f) * 0.5F * par3)); - - WINGRIGROT.rotateAngleZ = -Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - WINGLEFROT.rotateAngleZ = Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - - TOELEF1ROT.rotateAngleY = (float) (10 * Math.PI / 180); - TOERIG3ROT.rotateAngleY = (float) (-10 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a0b2919ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a0b2919ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f01f77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a0b2919ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a15aeff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a15aeff8c42100141fce95f06aba7e85 deleted file mode 100644 index aa20503..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a15aeff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIWander extends EntityAIBase -{ - private EntityCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a1d088f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a1d088f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6937438..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/a1d088f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class RenderSnow extends RenderGenericLiving { - public final ResourceLocation snowTexture; - - public RenderSnow(ModelBase modelBase, float shadowSize, ResourceLocation livingLocation, - ResourceLocation snowTexture) { - super(modelBase, shadowSize, livingLocation); - this.snowTexture = snowTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (BiomeDictionary.isBiomeOfType(entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ), - Type.FROZEN)) { - return snowTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/c173e3f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/c173e3f8c42100141fce95f06aba7e85 deleted file mode 100644 index a38d948..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/c173e3f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityEagle; -import com.ngb.projectzulu.common.mobs.models.ModelEagle; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/d05ba9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/d05ba9f9c42100141fce95f06aba7e85 deleted file mode 100644 index eaab901..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/82/d05ba9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/01dd48f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/01dd48f4c42100141fce95f06aba7e85 deleted file mode 100644 index 061728a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/01dd48f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,95 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY % 2 == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "cemeterytomb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/107a39a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/107a39a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 53e4882..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/107a39a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,206 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/10ac8cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/10ac8cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 0ac1b68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/10ac8cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,322 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/10d75700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/10d75700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 63ca643..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/10d75700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/208fa800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/208fa800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1bb5af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/208fa800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/300952f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/300952f8c42100141fce95f06aba7e85 deleted file mode 100644 index 958c266..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/300952f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/31d7e7ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/31d7e7ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 36f8937..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/31d7e7ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60291850f32000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60291850f32000141769cb1ed0c338cd deleted file mode 100644 index 3f208a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60291850f32000141769cb1ed0c338cd +++ /dev/null @@ -1,5 +0,0 @@ -package smalldeadguy.elementalcreepers; - -public @interface NetworkMod { - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60a664e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60a664e6c42100141fce95f06aba7e85 deleted file mode 100644 index a61d1a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/60a664e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/712e3da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/712e3da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 60edb43..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/712e3da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/808b3aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/808b3aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2825a0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/808b3aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,127 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.core.ProjectZuluLog; - - -public class ParsingHelper { - - /** - * Attempt to Parse an Integer. Performs no filters. - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static int parseInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Integer. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static int parseFilteredInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Long. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static Long parseFilteredLong(String value, Long fallBack, String fieldName) { - try { - return Long.parseLong(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an long. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an long. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Float. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static float parseFilteredFloat(String value, float fallBack, String fieldName) { - try { - return Float.parseFloat(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Double. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static double parseFilteredDouble(String value, double fallBack, String fieldName) { - try { - return Double.parseDouble(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Boolean - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static boolean parseBoolean(String value, boolean fallBack, String fieldName) { - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for a boolean. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for a boolean. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } else { - return Boolean.parseBoolean(value); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/81cb4effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/81cb4effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 71d72ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/81cb4effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public interface Blueprint { - - /** - * - * @param pieceLoc X,Y,Z Coordinate of Piece within Cell - * @param cellSize - * @param maxHeight - * @param xIndex - * @param zIndex - * @param random - * @param cellIndexDirection - * @return - */ - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection); - - /** - * Used to Search Architect list for a specific Building Type - * - * Type insensitive. Should be unique. - */ - public abstract String getIdentifier(); - - public abstract int getWeight(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/90942801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/90942801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11e18ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/90942801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a04862fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a04862fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 40c7f32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a04862fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a0a3b5ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a0a3b5ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f8b3bc2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a0a3b5ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a15545ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a15545ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 897309e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/a15545ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b0544df5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b0544df5c42100141fce95f06aba7e85 deleted file mode 100644 index ede6613..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b0544df5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,178 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityFox; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b0b83bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b0b83bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 80f3042..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b0b83bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b224be9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b224be9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a61d1a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/b224be9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/c0cb859ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/c0cb859ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b8088e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/c0cb859ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,93 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/d1d142f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/d1d142f9c42100141fce95f06aba7e85 deleted file mode 100644 index 49f041a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/d1d142f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/e0d778a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/e0d778a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 146cbb6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/e0d778a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/f12796e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/f12796e4c42100141fce95f06aba7e85 deleted file mode 100644 index 9cc6afe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/f12796e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.core; - - -public enum GuiID { - Tombstone(0), - FlowerPot(1), - AnimalName(2), - MobSpawner(3), - BrewingStand(4), - Unknown(-1); - - private int iD; - private GuiID(int iD) { - this.iD = iD; - } - - public int getID(){ - return iD; - } - - public static GuiID getGuiIDByID(int iD){ - for (GuiID guiID : GuiID.values()) { - if(guiID.iD == iD){ - return guiID; - } - } - return Unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/f16a73a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/f16a73a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fd1d328..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/83/f16a73a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/200fa1f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/200fa1f4c42100141fce95f06aba7e85 deleted file mode 100644 index 1edf044..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/200fa1f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; - -/* Helper Class to contain both BlockID and Meta in a single Structure */ -public class BlockWithMeta extends WeightedRandom.Item { - public final Block block; - public final int meta; - - public BlockWithMeta(Block block) { - this(block, 0); - } - - public BlockWithMeta(Block block, int meta) { - this(block, meta, 1); - } - - public BlockWithMeta(Block block, int meta, int weight) { - super(weight); - this.block = block; - this.meta = meta; - } - - /** - * Helper Function to Place Block/TileEntity/Spawner. Overridden in child to make use of specific knowledge, i.e. A - * Chests Loot Chance - */ - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (block != null) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/211583e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/211583e4c42100141fce95f06aba7e85 deleted file mode 100644 index 3023684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/211583e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderUniversalFlowerPot implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - // TODO: Render Universal Pot - renderer.renderStandardBlock(par1Block, par2, par3, par4); - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - IIcon var8 = par1Block.getBlockTextureFromSide(0); - float var9 = (var7 >> 16 & 255) / 255.0F; - float var10 = (var7 >> 8 & 255) / 255.0F; - float var11 = (var7 & 255) / 255.0F; - float var12; - float var14; - - if (EntityRenderer.anaglyphEnable) { - var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; - var9 = var12; - var10 = var13; - var11 = var14; - } - - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); - var12 = 0.1865F; - renderer.renderFaceXPos(par1Block, par2 - 0.5F + var12, par3, par4, var8); - renderer.renderFaceXNeg(par1Block, par2 + 0.5F - var12, par3, par4, var8); - renderer.renderFaceZPos(par1Block, par2, par3, par4 - 0.5F + var12, var8); - renderer.renderFaceZNeg(par1Block, par2, par3, par4 + 0.5F - var12, var8); - renderer.renderFaceYNeg(Blocks.dirt, par2, par3 - 0.35F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - renderer.renderFaceYPos(Blocks.dirt, par2, par3 - 0.5F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/21c9edf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/21c9edf7c42100141fce95f06aba7e85 deleted file mode 100644 index 5394f2d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/21c9edf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectPyramid; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/32984ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/32984ff8c42100141fce95f06aba7e85 deleted file mode 100644 index ed47f65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/32984ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/60add6f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/60add6f9c42100141fce95f06aba7e85 deleted file mode 100644 index 11c36e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/60add6f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,132 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/6160cfe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/6160cfe4c42100141fce95f06aba7e85 deleted file mode 100644 index a51477b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/6160cfe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/61877cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/61877cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 64db679..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/61877cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/70b1d3f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/70b1d3f7c42100141fce95f06aba7e85 deleted file mode 100644 index 66e0144..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/70b1d3f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,332 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80999d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80999d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 94bf039..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/80999d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/8105099fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/8105099fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4b7a193..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/8105099fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.models.ModelBlackBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/817d66a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/817d66a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ecaf279..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/817d66a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/91a9fda0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/91a9fda0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 255c580..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/91a9fda0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/a12e7e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/a12e7e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index dad277f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/a12e7e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDigspeed extends SubItemPotionHalfPower { - - public SubItemPotionDigspeed(Item itemID, int subID) { - super(itemID, subID, "Haste"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/a19ec49dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/a19ec49dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b352ddc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/a19ec49dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelFoxHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFoxHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/b0011500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/b0011500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 181b46d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/b0011500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.potion.brewingstands.PotionIngredients.IngredientProperty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemGenerics extends Item implements IngredientProperty { - - public enum Properties { - /* Generic Items */ - PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - - /* Potion Effect Ingredients */ - BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( - "Antennae", 23, true), ShinyBauble("Shiny Bauble", 24, true), Talon("Talon", 25, true), Bark("Bark", - 27, true), SmallHeart("Small Heart", 28, true), LargeHeart("Large Heart", 29, true), Gill("Gill", 30, - true), Ectoplasm("Ectoplasm", 31), FrogLegs("Frog Legs", 32, true), RabbitsFoot("Rabbits Feet", 33, - true), PricklyPowder("Prickly Powder", 34, true), PowderSlush("Powder Slush", 35, true), GlowingGoo( - "Glowing Goo", 36, true), SmallUnhealthyHeart("Small Unhealthy Heart", 37, true), LargeUnhealthyHeart( - "Large Unhealthy Heart", 38, true); - - public final String displayName; - public final boolean isIngredient; - public final int meta; - - public int meta() { - return meta; - } - - @SideOnly(Side.CLIENT) - private IIcon icon; - - Properties(String name, int meta, boolean isIngredient) { - this.displayName = name; - this.meta = meta; - this.isIngredient = isIngredient; - } - - Properties(String name, int iconIndex) { - this(name, iconIndex, false); - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Properties getPropertyByMeta(int meta) { - for (Properties property : Properties.values()) { - if (property.meta == meta) { - return property; - } - } - return null; - } - } - - public ItemGenerics() { - super(); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Properties.getPropertyByMeta(par1).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - for (Properties type : Properties.values()) { - type.setIcon(par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + type.toString().toLowerCase())); - } - } - - @Override - public boolean isIngredient(ItemStack ingredient) { - Properties.getPropertyByMeta(ingredient.getItemDamage()); - return true; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - for (final Properties property : Properties.values()) { - if (property.meta == itemStack.getItemDamage()) { - return "item.".concat(property.displayName.toLowerCase().replaceAll("\\s", "")); - } - } - return ""; - } - - @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (final Properties property : Properties.values()) { - par3List.add(new ItemStack(item, 1, property.meta)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/b06b47e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/b06b47e4c42100141fce95f06aba7e85 deleted file mode 100644 index 9b11728..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/b06b47e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeDoubleSlabDeclaration extends BlockDeclaration { - - public PalmTreeDoubleSlabDeclaration() { - super("PalmTreeDoubleSlab", 2); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeDoubleSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreeSlab.get(), - BlockList.palmTreePlank.get())).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeDoubleSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c096eaa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c096eaa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f92b50a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/c096eaa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; - -import org.lwjgl.util.Point; - -public class GuiSaveableTextField extends GuiTextField { - - public GuiSaveableTextField(FontRenderer fontRenderer, int xPos, int yPos, int width, int height) { - super(fontRenderer, xPos, yPos, width, height); - } - - public GuiSaveableTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(maxTextChars); - } - - public GuiSaveableTextField(GuiSaveableTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setText(oldTextFields.getText()); - setupTextField(maxTextChars); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/d229e59ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/d229e59ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a6c438d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/d229e59ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,404 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/e0a8dd00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/e0a8dd00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a58e5dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/e0a8dd00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/e0e90cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/e0e90cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 163f0a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/e0e90cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,325 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/f09a02f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/f09a02f6c42100141fce95f06aba7e85 deleted file mode 100644 index d47ccae..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/84/f09a02f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/1118f8f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/1118f8f9c42100141fce95f06aba7e85 deleted file mode 100644 index 703bcaf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/1118f8f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.BlockTombstone; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/11d51ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/11d51ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 9b05e6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/11d51ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelRhinoHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelRhinoHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 18F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/11fdb8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/11fdb8e5c42100141fce95f06aba7e85 deleted file mode 100644 index 9da4186..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/11fdb8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -public class RenderGenericLiving extends RenderLiving implements RenderWrapper { - - public final ResourceLocation livingTexture; - - public RenderGenericLiving(ModelBase modelBase, float shadowSize, ResourceLocation livingTexture) { - super(modelBase, shadowSize); - this.livingTexture = livingTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return livingTexture; - } - - @Override - public Render getRender() { - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/12f5f4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/12f5f4f7c42100141fce95f06aba7e85 deleted file mode 100644 index c718d5e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/12f5f4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import org.apache.commons.lang3.tuple.Pair; - -/** - * For usage see: {@link Pair} - */ -public class BoundaryPair { - private final K lower; - private final V upper; - - public static BoundaryPair createPair(K lower, V upper) { - return new BoundaryPair(lower, upper); - } - - public BoundaryPair(K lower, V upper) { - this.lower = lower; - this.upper = upper; - } - - public K getLowerLimit() { - return lower; - } - - public V getUpperLimit() { - return upper; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/40dd4af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/40dd4af8c42100141fce95f06aba7e85 deleted file mode 100644 index 3b454af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/40dd4af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWaterBreathing extends SubItemPotionGeneric { - - public SubItemPotionWaterBreathing(Item itemID, int subID) { - super(itemID, subID, "potion.waterBreathing"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.waterBreathing); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/5010b9fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/5010b9fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 91d5539..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/5010b9fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,230 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/711a70a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/711a70a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bc46923..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/711a70a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/80160afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/80160afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7ed9081..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/80160afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/81158a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/81158a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e9eee3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/81158a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/90f7e5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/90f7e5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41a9502..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/90f7e5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMimic; -import projectzulu.common.mobs.models.ModelMimic; -import projectzulu.common.mobs.renders.RenderMimic; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MimicDeclaration extends EggableDeclaration { - - public MimicDeclaration() { - super("Mimic", 11, EntityMimic.class, null); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - shouldDespawn = false; - - eggColor1 = (171 << 16) + (121 << 8) + 45; - eggColor2 = (143 << 16) + (105 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 5); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/a12dbef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/a12dbef7c42100141fce95f06aba7e85 deleted file mode 100644 index da536cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/a12dbef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelArmadilloHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADPIECE; - - public ModelArmadilloHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADPIECE.Ear2", 17, 0); - setTextureOffset("HEADPIECE.Ear1", 17, 0); - setTextureOffset("HEADPIECE.nose", 12, 9); - setTextureOffset("HEADPIECE.chin", 0, 8); - setTextureOffset("HEADPIECE.head", 0, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - HEADPIECE.setRotationPoint(0F, 0F, 2.5F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - HEADPIECE.addBox("Ear2", -4F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("Ear1", 2F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("nose", -0.5F, 1.5F, -7F, 1, 1, 2); - HEADPIECE.addBox("chin", -1.5F, -0.5F, -5.5F, 3, 3, 3); - HEADPIECE.addBox("head", -2.5F, -2.5F, -2.5F, 5, 5, 3); - CENTERROT.addChild(HEADPIECE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b0f3c129c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b0f3c129c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8aa85e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b0f3c129c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - /** The PathNavigate of our entity. */ - EntityLivingBase entityPathNavigate; - int fleeChance = 0; - /** Task Owner in the form of out Generic Creature, used to access Specialized information, such as Anger or EntityState */ - EntityGenericCreature genericTaskOwner; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityLiving, boolean shouldCallAllies, boolean shouldCheckSight) { - super(par1EntityLiving, 16.0F, shouldCheckSight); - this.shouldCallAllies = shouldCallAllies; - this.setMutexBits(1); - this.genericTaskOwner = par1EntityLiving; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.isSuitableTarget(this.taskOwner.getAITarget(), false); - - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return shouldExecute(); -// return this.taskOwner.getAITarget() != null && this.taskOwner.getAITarget() != this.entityPathNavigate; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.entityPathNavigate = this.taskOwner.getAITarget(); - - if (this.shouldCallAllies){ - List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - Iterator var2 = var1.iterator(); - - while (var2.hasNext()){ - EntityLiving var3 = (EntityLiving)var2.next(); - - if (this.taskOwner != var3 && var3.getAttackTarget() == null){ - var3.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - super.startExecuting(); - } - - @Override - public void updateTask() { - startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b19a40ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b19a40ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8017bb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b19a40ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b1f5ade4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b1f5ade4c42100141fce95f06aba7e85 deleted file mode 100644 index 1d5ba35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/b1f5ade4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,172 +0,0 @@ -package projectzulu.common.core; - -import java.util.EnumSet; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; - -public class RenderHelper { - - public static enum Surface { - TOP(0), BOTTOM(1), - - /* +x is RIGHT */ - RIGHT(2), LEFT(3), - - /* +z is FRONT */ - FRONT(4), BACK(5); - public final int index; - - Surface(int index) { - this.index = index; - } - } - - public static boolean renderRotated2D(IIcon icon, float iconScale, RenderBlocks renderer, double posX, double posY, - double posZ, double xWidth, double yHeight, double angle) { - - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double minU = icon.getMinU(); - double maxU = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / iconScale; - double minV = icon.getMinV(); - double maxV = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / iconScale; - - double yMin = posY; - - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, maxU, minV); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle) { - renderRotatedRectangle(icon, iconScale, renderer, posX, posY, posZ, xWidth, yHeight, zWidth, angle, - EnumSet.allOf(Surface.class)); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle, - EnumSet sidesToDraw) { - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double deltaU = icon.getMaxU() - icon.getMinU(); - double deltaV = icon.getMaxV() - icon.getMinV(); - double minU = icon.getMinU() + deltaU / 2 * (1 - 1 / iconScale); - double maxU = icon.getMaxU() - deltaU / 2 * (1 - 1 / iconScale); - double minV = icon.getMinV() + deltaV / 2 * (1 - 1 / iconScale); - double maxV = icon.getMaxV() - deltaV / 2 * (1 - 1 / iconScale); - - double yMin = posY; - - double intermedVarZ = -zWidth / 2; - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = -zWidth / 2; - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = -xWidth / 2; - double point3X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point3Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = +xWidth / 2; - double point4X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point4Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - for (Surface surface : sidesToDraw) { - switch (surface) { - case RIGHT: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case LEFT: - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - break; - case BACK: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case FRONT: - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - break; - case TOP: - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - break; - case BOTTOM: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - } - - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/c09948f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/c09948f5c42100141fce95f06aba7e85 deleted file mode 100644 index f87ea35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/c09948f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,262 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityHauntedArmor; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d0079e00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d0079e00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a94b6e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d0079e00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d1a411f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d1a411f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2235a79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d1a411f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,240 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d1a651fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d1a651fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11660b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/d1a651fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/e02399e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/e02399e6c42100141fce95f06aba7e85 deleted file mode 100644 index 370f9c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/e02399e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/e080cee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/e080cee5c42100141fce95f06aba7e85 deleted file mode 100644 index 55aa04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/85/e080cee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingSingle extends TileEntityBrewingBase { - - public TileEntityBrewingSingle() { - brewingItemStacks = new ItemStack[2]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/0044fff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/0044fff9c42100141fce95f06aba7e85 deleted file mode 100644 index b47235b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/0044fff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockQuickSand; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/418ab8a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/418ab8a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9cc6afe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/418ab8a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.core; - - -public enum GuiID { - Tombstone(0), - FlowerPot(1), - AnimalName(2), - MobSpawner(3), - BrewingStand(4), - Unknown(-1); - - private int iD; - private GuiID(int iD) { - this.iD = iD; - } - - public int getID(){ - return iD; - } - - public static GuiID getGuiIDByID(int iD){ - for (GuiID guiID : GuiID.values()) { - if(guiID.iD == iD){ - return guiID; - } - } - return Unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/61a83ffac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/61a83ffac42100141fce95f06aba7e85 deleted file mode 100644 index 48f404b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/61a83ffac42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/a0992d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/a0992d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6d6e322..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/a0992d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,132 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/c0a014fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/c0a014fac42100141fce95f06aba7e85 deleted file mode 100644 index 56d7b47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/c0a014fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockCoconut; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/e0162bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/e0162bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index dad277f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/e0162bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDigspeed extends SubItemPotionHalfPower { - - public SubItemPotionDigspeed(Item itemID, int subID) { - super(itemID, subID, "Haste"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/e0bec9e90a2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/e0bec9e90a2100141769cb1ed0c338cd deleted file mode 100644 index 67ef5f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/86/e0bec9e90a2100141769cb1ed0c338cd +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityCreature theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) this.targetEntity.posX, (double) this.targetEntity.posY, (double) this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/11b9029ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/11b9029ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 456469b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/11b9029ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/3093b8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/3093b8f8c42100141fce95f06aba7e85 deleted file mode 100644 index e9e5b40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/3093b8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,556 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityEagle; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/70be2ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/70be2ee5c42100141fce95f06aba7e85 deleted file mode 100644 index cf86e68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/70be2ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,200 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/802f6efec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/802f6efec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 95585fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/802f6efec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/82b794f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/82b794f8c42100141fce95f06aba7e85 deleted file mode 100644 index e5aacfc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/82b794f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/b210f19ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/b210f19ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a45a598..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/b210f19ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/c1821da0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/c1821da0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b3b1e35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/87/c1821da0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockWoodSlab; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockZuluSlab extends BlockWoodSlab { - - public static Block singleSlabID; - Block baseBlock; - - /** Single Slab Constructor */ - public BlockZuluSlab(Block baseBlock) { - super(false); - singleSlabID = this; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** Double Slab Constructor */ - public BlockZuluSlab(Block singleSlab, Block baseBlock) { - super(true); - singleSlabID = singleSlab; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - @Override - protected ItemStack createStackedBlock(int par1) { - return new ItemStack(singleSlabID, 2, par1 & 7); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return baseBlock.getIcon(par1, par2 & 7); - } - - @Override - public String func_150002_b(int par1) { - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(singleSlabID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/104d93f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/104d93f7c42100141fce95f06aba7e85 deleted file mode 100644 index f3d3fa5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/104d93f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockCreeperBlossom; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CreeperBlossomDeclaration extends BlockDeclaration { - - public CreeperBlossomDeclaration() { - super("CreeperBlossom"); - } - - @Override - protected boolean createBlock() { - BlockList.creeperBlossom = Optional.of(new BlockCreeperBlossom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.creeperBlossom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/11b198a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/11b198a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7bf932f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/11b198a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityGenericAnimal theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityGenericAnimal par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, - //this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); - Vec3.createVectorHelper((double)this.targetEntity.posX, (double)this.targetEntity.posY, (double)this.targetEntity.posZ)); - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/21673ff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/21673ff4c42100141fce95f06aba7e85 deleted file mode 100644 index 6b0deaa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/21673ff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/307f67f99dac0014171585e4f63f5ff8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/307f67f99dac0014171585e4f63f5ff8 new file mode 100644 index 0000000..d3597c5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/307f67f99dac0014171585e4f63f5ff8 @@ -0,0 +1,122 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate = 5; + private int stickSpawnRate = 5; + + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void preInit(FMLPreInitializationEvent event, File configDirectory) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + //displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + config.save(); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/407b7ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/407b7ef9c42100141fce95f06aba7e85 deleted file mode 100644 index dba2e6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/407b7ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/50916de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/50916de4c42100141fce95f06aba7e85 deleted file mode 100644 index 9ea7694..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/50916de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,104 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/704ff4fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/704ff4fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 287f42d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/704ff4fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,556 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/71756cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/71756cf5c42100141fce95f06aba7e85 deleted file mode 100644 index 8845642..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/71756cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityMummy; -import com.ngb.projectzulu.common.mobs.models.ModelMummy; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/90815ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/90815ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 2fcbea3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/90815ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/90d9019fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/90d9019fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cd28663..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/90d9019fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/a00a309ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/a00a309ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9359d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/a00a309ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,204 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityTombstone extends TileEntity { - /* List of Items this Tombstone will Empty Upon Right-Clicking */ - private ArrayList deathItems = new ArrayList(); - public int experience = 0; - private EntityXPOrb xpOrb = null; - - public EntityXPOrb getEntityOrb() { - if (hasDrops()) { - if (xpOrb == null) { - xpOrb = new EntityXPOrb(worldObj, xCoord, yCoord, zCoord, worldObj.rand.nextInt(5) + 1); - } - return xpOrb; - } - return null; - } - - public boolean addDrop(ItemStack itemDrop) { - return deathItems.add(itemDrop); - } - - public boolean hasDrops() { - return !deathItems.isEmpty() || experience > 0; - } - - /* Give items in Tombstone to Player */ - public void giveItemsToPlayer(EntityPlayer player) { - player.addExperience(experience); - experience = 0; - - Iterator unSortIterator = deathItems.iterator(); - boolean itemAdded = true; - while (unSortIterator.hasNext() && itemAdded) { - ItemStack deathItem = unSortIterator.next(); - itemAdded = player.inventory.addItemStackToInventory(deathItem); - if (itemAdded) { - unSortIterator.remove(); - } - } - } - - /** An array of four strings storing the lines of text on the sign. */ - public String[] signText; - public final int maxLines = 7; - public final int maxcharPerLine = 13; - - /** - * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only - * really used when the > < are going to be visible. - */ - public int lineBeingEdited = -1; - private boolean isEditable = true; - - public TileEntityTombstone() { - signText = new String[maxLines]; - for (int i = 0; i < signText.length; i++) { - signText[i] = ""; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - for (int i = 0; i < signText.length; i++) { - if (signText[i].length() > 0) { - tagCompound.setString("Text" + (i + 1), signText[i]); - } - } - tagCompound.setInteger("Experience", experience); - addItemsToCompound(tagCompound, "DeathItems", deathItems); - } - - private void addItemsToCompound(NBTTagCompound tileCompound, String itemTagName, List items) { - NBTTagList itemsTag = new NBTTagList(); - for (ItemStack itemStack : items) { - NBTTagCompound tag = new NBTTagCompound(); - itemStack.writeToNBT(tag); - itemsTag.appendTag(tag); - } - tileCompound.setTag(itemTagName, itemsTag); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - this.isEditable = false; - super.readFromNBT(tagCompound); - for (int i = 0; i < signText.length; ++i) { - this.signText[i] = tagCompound.getString("Text" + (i + 1)); - if (this.signText[i].length() > maxcharPerLine) { - this.signText[i] = this.signText[i].substring(0, maxcharPerLine); - } - } - experience = tagCompound.hasKey("Experience") ? tagCompound.getInteger("Experience") : 0; - deathItems = readItemsFromCompound(tagCompound, "DeathItems"); - } - - public ArrayList readItemsFromCompound(NBTTagCompound tileCompound, String itemTagName) { - ArrayList items = new ArrayList(); - if (tileCompound.hasKey(itemTagName)) { - NBTTagList itemsTag = (NBTTagList) tileCompound.getTag(itemTagName); - for (int i = 0; i < itemsTag.tagCount(); i++) { - ItemStack itemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) itemsTag.getCompoundTagAt(i)); - if (itemStack != null) { - items.add(itemStack); - } - } - } - return items; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - public void setSignString(String inputString) { - String[] words = inputString.split(" "); - int startWord = 0; - for (int currentLine = 0; currentLine < signText.length; currentLine++) { - StringBuilder currentLineText = new StringBuilder(maxcharPerLine); - /* Add Words until Line is full */ - for (int i = startWord; i < words.length; i++) { - String currentWord = getFilteredWord(words[i]); - - if (currentLineText.length() + (currentLineText.length() != 0 ? 1 : 0) + currentWord.length() <= maxcharPerLine) { - if (currentLineText.length() != 0) { - currentLineText.append(" "); - } - currentLineText.append(currentWord); - /* If This is the last line, we want to write the text */ - if (i + 1 >= words.length) { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i + 1; - break; - } - } else { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i; - break; - } - } - } - } - - /** - * Handlers filtering word if it is invalid in some way, such as truncating a word that is too long. - */ - private String getFilteredWord(String word) { - return word.length() > maxcharPerLine ? word.substring(0, maxcharPerLine - 2).concat(".") : word; - } - - @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() { - return 16384.0D; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/b184abe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/b184abe4c42100141fce95f06aba7e85 deleted file mode 100644 index 9f66582..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/b184abe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.minecraftforge.common.config.Configuration; - -public class ProjectZuluLog { - - private static Logger myLog; - public static boolean isSetup; - - public enum LogType { - SPAWNING, DEBUG; - public boolean isEnabled = false; - } - - public static void configureLogging(File configDirectory) { - if (!isSetup) { - isSetup = true; - myLog = Logger.getLogger("ProjectZulu|Core"); - myLog.setParent(Logger.getLogger("ForgeModLoader")); - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - for (LogType type : LogType.values()) { - if (type == LogType.DEBUG) { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", false, - "Master Switch For All Debug Printing (Not Fully Implemented)").getBoolean(false); - } else { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", true, - "Enables " + type + " Logging").getBoolean(true); - } - } - config.save(); - - } - } - - public static void log(Level level, String format, Object... data) { - myLog.log(level, String.format(format, data)); - } - - public static void info(String format, Object... data) { - log(Level.INFO, format, data); - } - - public static void warning(String format, Object... data) { - log(Level.WARNING, format, data); - } - - public static void severe(String format, Object... data) { - log(Level.SEVERE, format, data); - } - - public static void debug(Level level, String format, Object... data) { - if (LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } - - public static void log(LogType type, Level level, String format, Object... data) { - if (type.isEnabled || LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/c05219a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/c05219a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bd79ea2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/c05219a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/c178efa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/c178efa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6f34a22..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/c178efa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.dungeon.BlockLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/f25b39f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/f25b39f9c42100141fce95f06aba7e85 deleted file mode 100644 index 8a769e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/88/f25b39f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/0024cff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/0024cff4c42100141fce95f06aba7e85 deleted file mode 100644 index a45c23c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/0024cff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionJump extends SubItemPotionGeneric { - - public SubItemPotionJump(Item itemID, int subID) { - super(itemID, subID, "potion.jump"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.jump); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.feather) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.SLOWFALL.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.SLOWFALL.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/401e49fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/401e49fac42100141fce95f06aba7e85 deleted file mode 100644 index 705d638..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/401e49fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public abstract class BaseModule implements Module { - - @Override - public void registration(ItemBlockManager manager) { - } - - @Override - public void registration(CustomEntityManager manager) { - } - - @Override - public void registration(FeatureGenerator manager) { - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - } - - @Override - public void init(FMLInitializationEvent event, File configDirectory) { - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - } - - @Override - public void serverStart(FMLServerStartedEvent event, File configDirectory) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/614c02e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/614c02e4c42100141fce95f06aba7e85 deleted file mode 100644 index b3b1e35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/614c02e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockWoodSlab; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockZuluSlab extends BlockWoodSlab { - - public static Block singleSlabID; - Block baseBlock; - - /** Single Slab Constructor */ - public BlockZuluSlab(Block baseBlock) { - super(false); - singleSlabID = this; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** Double Slab Constructor */ - public BlockZuluSlab(Block singleSlab, Block baseBlock) { - super(true); - singleSlabID = singleSlab; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - @Override - protected ItemStack createStackedBlock(int par1) { - return new ItemStack(singleSlabID, 2, par1 & 7); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return baseBlock.getIcon(par1, par2 & 7); - } - - @Override - public String func_150002_b(int par1) { - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(singleSlabID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/621cfee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/621cfee5c42100141fce95f06aba7e85 deleted file mode 100644 index 0ccd04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/621cfee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/703b3e9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/703b3e9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 27a50c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/703b3e9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZPotionTab extends CreativeTabs { - - public CreativePZPotionTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - public Item getTabIconItem() { - return Items.potionitem; - } - - @Override - public int func_151243_f() { - return 3; - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu Potions"; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/801173fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/801173fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 93881fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/801173fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8067d59dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8067d59dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 66987f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8067d59dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemAloeVera extends ItemBlock { - - public ItemAloeVera(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "base_1"; - break; - } - case 1: { - name = "base_2"; - break; - } - case 2: { - name = "base_3"; - break; - } - case 3: { - name = "base_4"; - break; - } - case 4: { - name = "flower_1"; - break; - } - case 5: { - name = "flower_2"; - break; - } - case 6: { - name = "flower_3"; - break; - } - case 7: { - name = "flower_4"; - break; - } - case 8: { - name = "flower_5"; - break; - } - default: - name = "base_1"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/817b2df6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/817b2df6c42100141fce95f06aba7e85 deleted file mode 100644 index dfc7ba1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/817b2df6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8237d19fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8237d19fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5722f80..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/8237d19fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/90104affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/90104affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b1d31c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/90104affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.BPScatteredTombstonesAndFlowers; -import projectzulu.common.world2.blueprints.BlueprintCemetaryEdge; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain2; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb2; - -public class ArchitectCemetary extends ArchitectBase { - BlueprintSet edge = new BPSetGenericEdge(new BlueprintCemetaryEdge()); - - public ArchitectCemetary(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPScatteredTombstonesAndFlowers())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb2(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemetaryFountain(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintCemetaryFountain2())); - stockpile.addBlueprintSet(edge); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/92f7e5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/92f7e5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 32adadb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/92f7e5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMummy; -import projectzulu.common.mobs.models.ModelMummy; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/a0332ca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/a0332ca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 94bf039..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/a0332ca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/b11f27a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/b11f27a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6400d8d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/b11f27a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelArmadilloHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADPIECE; - - public ModelArmadilloHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADPIECE.Ear2", 17, 0); - setTextureOffset("HEADPIECE.Ear1", 17, 0); - setTextureOffset("HEADPIECE.nose", 12, 9); - setTextureOffset("HEADPIECE.chin", 0, 8); - setTextureOffset("HEADPIECE.head", 0, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - HEADPIECE.setRotationPoint(0F, 0F, 2.5F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - HEADPIECE.addBox("Ear2", -4F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("Ear1", 2F, -3F, -2F, 2, 1, 1); - HEADPIECE.addBox("nose", -0.5F, 1.5F, -7F, 1, 1, 2); - HEADPIECE.addBox("chin", -1.5F, -0.5F, -5.5F, 3, 3, 3); - HEADPIECE.addBox("head", -2.5F, -2.5F, -2.5F, 5, 5, 3); - CENTERROT.addChild(HEADPIECE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/b27a7de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/b27a7de5c42100141fce95f06aba7e85 deleted file mode 100644 index 41eae85..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/b27a7de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRabbit; -import projectzulu.common.mobs.models.ModelRabbit; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RabbitDeclaration extends SpawnableDeclaration { - - public RabbitDeclaration() { - super("Rabbit", 21, EntityRabbit.class, EnumCreatureType.creature); - setSpawnProperties(15, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (239 << 16) + (179 << 8) + 83; - eggColor2 = (237 << 16) + (208 << 8) + 166; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.RabbitsFoot.meta(), 8); - customMobData.entityProperties = new EntityProperties(10f, 1.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/d147dcf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/d147dcf8c42100141fce95f06aba7e85 deleted file mode 100644 index d76f18d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/d147dcf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityGreenFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f0bd05f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f0bd05f8c42100141fce95f06aba7e85 deleted file mode 100644 index dad386a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/89/f0bd05f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryEdge implements Blueprint { - - List wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/003d8de6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/003d8de6c42100141fce95f06aba7e85 deleted file mode 100644 index d2d2cce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/003d8de6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,107 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/011a8ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/011a8ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 5feb479..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/011a8ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.blocks.util.StringHelper; -import projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/10485a00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/10485a00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index bbe968f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/10485a00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/10e9ebe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/10e9ebe4c42100141fce95f06aba7e85 deleted file mode 100644 index ebac1d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/10e9ebe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/110ecea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/110ecea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1d5ba35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/110ecea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,172 +0,0 @@ -package projectzulu.common.core; - -import java.util.EnumSet; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; - -public class RenderHelper { - - public static enum Surface { - TOP(0), BOTTOM(1), - - /* +x is RIGHT */ - RIGHT(2), LEFT(3), - - /* +z is FRONT */ - FRONT(4), BACK(5); - public final int index; - - Surface(int index) { - this.index = index; - } - } - - public static boolean renderRotated2D(IIcon icon, float iconScale, RenderBlocks renderer, double posX, double posY, - double posZ, double xWidth, double yHeight, double angle) { - - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double minU = icon.getMinU(); - double maxU = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / iconScale; - double minV = icon.getMinV(); - double maxV = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / iconScale; - - double yMin = posY; - - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, maxU, minV); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle) { - renderRotatedRectangle(icon, iconScale, renderer, posX, posY, posZ, xWidth, yHeight, zWidth, angle, - EnumSet.allOf(Surface.class)); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle, - EnumSet sidesToDraw) { - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double deltaU = icon.getMaxU() - icon.getMinU(); - double deltaV = icon.getMaxV() - icon.getMinV(); - double minU = icon.getMinU() + deltaU / 2 * (1 - 1 / iconScale); - double maxU = icon.getMaxU() - deltaU / 2 * (1 - 1 / iconScale); - double minV = icon.getMinV() + deltaV / 2 * (1 - 1 / iconScale); - double maxV = icon.getMaxV() - deltaV / 2 * (1 - 1 / iconScale); - - double yMin = posY; - - double intermedVarZ = -zWidth / 2; - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = -zWidth / 2; - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = -xWidth / 2; - double point3X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point3Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = +xWidth / 2; - double point4X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point4Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - for (Surface surface : sidesToDraw) { - switch (surface) { - case RIGHT: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case LEFT: - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - break; - case BACK: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case FRONT: - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - break; - case TOP: - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - break; - case BOTTOM: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - } - - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/207422f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/207422f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2601f4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/207422f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/3173e2e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/3173e2e4c42100141fce95f06aba7e85 deleted file mode 100644 index 003fa0a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/3173e2e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/50c066ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/50c066ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7fe473c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/50c066ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/800236a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/800236a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8bfec01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/800236a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.potion; - -/** - * Helper Classes to Parse Generic Potion properties form damage. - * - * Note the only damage values Guaranteed to work for any given SubItemPotion is subID and Splash. Any other bits are up - * to individual subItem to parse and may not conform to standard. - */ -public class PotionParser { - - public static int readID(int value) { - byte lowByte = (byte) (value & getLeastBitMask(4)); - return lowByte & 0xFF; - } - - public static int setID(int iD, int value) { - if (iD < 0 || iD > 15) { - iD = iD < 0 ? 0 : 15; - } - return setBitRange(value, iD, 0, 4); - } - - public static int readLevel(int value) { - byte lowByte = (byte) ((value >> 4) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setLevel(int level, int value) { - if (level < 0 || level > 3) { - level = level < 0 ? 0 : 3; - } - return setBitRange(value, level, 4, 2); - } - - public static int readPower(int value) { - byte lowByte = (byte) ((value >> 6) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setPower(int power, int value) { - if (power < 0 || power > 3) { - power = power < 0 ? 0 : 3; - } - return setBitRange(value, power, 6, 2); - } - - public static int readDuration(int value) { - byte lowByte = (byte) ((value >> 8) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setDuration(int duration, int value) { - if (duration < 0 || duration > 3) { - duration = duration < 0 ? 0 : 3; - } - return setBitRange(value, duration, 8, 2); - } - - public static int readContainer(int value) { - byte lowByte = (byte) ((value >> 10) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setContainer(int container, int value) { - if (container < 0 || container > 3) { - container = container < 0 ? 0 : 3; - } - return setBitRange(value, container, 10, 2); - } - - public static boolean isSplash(int value) { - return isBitSet(value, 14); - } - - public static int setSplash(int value) { - return setBit(value, 14); - } - - /** - * Sets Range of Bits in origValue to bits in ValueToSet starting from staringBitToSet for bitsToSet number of bits - * - * @param origValue - * @param valueToSet - * @param startingBitToSet - * @param bitsToSet - * @return - */ - private static int setBitRange(int origValue, int valueToSet, int startingBitToSet, int bitsToSet) { - for (int i = 0; i < bitsToSet; i++) { - if (isBitSet(origValue, startingBitToSet + i) == !isBitSet(valueToSet, i)) { - origValue = flipBit(origValue, startingBitToSet + i); - } - } - return origValue; - } - - private static boolean isBitSet(int value, int index) { - return (value & (1L << index)) != 0; - } - - private static int setBit(int value, int index) { - return value | (1 << index); - } - - private static int unSetBit(int value, int index) { - return value & ~(1 << index); - } - - private static int flipBit(int value, int index) { - return value ^ (1 << index); - } - - /** - * Returns a Mask to be & with a value to get the specified number of least significant bits - * - * @param value - * @param numBits Number of Least Significant bits desired - * @return - */ - private static int getLeastBitMask(int numBits) { - return ((1 << numBits) - 1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/80280ca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/80280ca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b8088e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/80280ca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,93 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/8094069fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/8094069fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 734f12b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/8094069fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -//package projectzulu.common.mobs.entityai; -// -//import net.minecraft.command.IEntitySelector; -//import net.minecraft.entity.EntityLiving; -//import projectzulu.common.mobs.EntityGenericCreature; -//import projectzulu.common.mobs.EntityStates; -// -//public class EntityZuluAINearestRevengeTarget extends EntityAINearestAttackableTarget{ -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5){ -// super(par1EntityLiving, par2Class, par3, par4, par5); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5, boolean par6){ -// super(par1EntityLiving, par2Class, par3, par4, par5, par6); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ -// super(par1, par2, par3, par4, par5, par6, par7IEntitySelector); -// } -// -// /** -// * Returns whether the EntityAIBase should begin execution. -// */ -// public boolean shouldExecute() { -// /* getAITarget acts as Tempory target timer, as it only lasts a few seconds, Reminder: getAttackTarget is the persistent form */ -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.shouldExecute(); -// } -// return false; -// } -// -// @Override -// public boolean continueExecuting() { -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.continueExecuting(); -// } -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/822ad7fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/822ad7fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d3aaef1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/822ad7fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.models.ModelHauntedArmor; -import projectzulu.common.mobs.renders.RenderHauntedArmor; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/a00de8e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/a00de8e3c42100141fce95f06aba7e85 deleted file mode 100644 index be62ca8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/a00de8e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -public enum ItemList { - instance; - /* Items */ - public static Optional ankh = Optional.absent(); - public static Optional scaleItem = Optional.absent(); - public static Optional furPelt = Optional.absent(); - - public static Optional aloeVeraSeeds = Optional.absent(); - public static Optional waterDroplets = Optional.absent(); - - public static Optional coconutItem = Optional.absent(); - public static Optional coconutSeed = Optional.absent(); - public static Optional coconutShell = Optional.absent(); - public static Optional coconutMilkFragment = Optional.absent(); - - public static Optional genericCraftingItems = Optional.absent(); - public static Optional scrapMeat = Optional.absent(); - public static Optional structurePlacer = Optional.absent(); - public static Optional potionIngredients = Optional.absent(); - public static Optional customPotions = Optional.absent(); - public static Optional vanillaPotions = Optional.absent(); - - /* Armor */ - public static Optional scaleArmorHead = Optional.absent(); - public static Optional scaleArmorChest = Optional.absent(); - public static Optional scaleArmorLeg = Optional.absent(); - public static Optional scaleArmorBoots = Optional.absent(); - - public static Optional goldScaleArmorHead = Optional.absent(); - public static Optional goldScaleArmorChest = Optional.absent(); - public static Optional goldScaleArmorLeg = Optional.absent(); - public static Optional goldScaleArmorBoots = Optional.absent(); - - public static Optional ironScaleArmorHead = Optional.absent(); - public static Optional ironScaleArmorChest = Optional.absent(); - public static Optional ironScaleArmorLeg = Optional.absent(); - public static Optional ironScaleArmorBoots = Optional.absent(); - - public static Optional diamondScaleArmorHead = Optional.absent(); - public static Optional diamondScaleArmorChest = Optional.absent(); - public static Optional diamondScaleArmorLeg = Optional.absent(); - public static Optional diamondScaleArmorBoots = Optional.absent(); - - public static Optional whiteClothHead = Optional.absent(); - public static Optional whiteClothChest = Optional.absent(); - public static Optional whiteClothLeg = Optional.absent(); - public static Optional whiteClothBoots = Optional.absent(); - - public static Optional redClothHead = Optional.absent(); - public static Optional redClothChest = Optional.absent(); - public static Optional redClothLeg = Optional.absent(); - public static Optional redClothBoots = Optional.absent(); - - public static Optional greenClothHead = Optional.absent(); - public static Optional greenClothChest = Optional.absent(); - public static Optional greenClothLeg = Optional.absent(); - public static Optional greenClothBoots = Optional.absent(); - - public static Optional blueClothHead = Optional.absent(); - public static Optional blueClothChest = Optional.absent(); - public static Optional blueClothLeg = Optional.absent(); - public static Optional blueClothBoots = Optional.absent(); - - public static Optional cactusArmorHead = Optional.absent(); - public static Optional cactusArmorChest = Optional.absent(); - public static Optional cactusArmorLeg = Optional.absent(); - public static Optional cactusArmorBoots = Optional.absent(); - - public static Optional furArmorHead = Optional.absent(); - public static Optional furArmorChest = Optional.absent(); - public static Optional furArmorLeg = Optional.absent(); - public static Optional furArmorBoots = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/a1bcbbf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/a1bcbbf7c42100141fce95f06aba7e85 deleted file mode 100644 index 9b1b456..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/a1bcbbf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBeaverHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBeaverHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 0F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 2F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 2F, -5F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/b06383f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/b06383f6c42100141fce95f06aba7e85 deleted file mode 100644 index 19addc9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/b06383f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c1477201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c1477201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 581d0fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c1477201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c16e39ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c16e39ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c4882c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c16e39ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import projectzulu.common.core.CreativePZGeneralTab; -import projectzulu.common.core.CreativePZPotionTab; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.EventHookContainerClass; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.PacketPipeline; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.ZuluGuiHandler; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c1f31fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c1f31fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 05d1d4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/c1f31fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e0dad6f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e0dad6f6c42100141fce95f06aba7e85 deleted file mode 100644 index f8a3966..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e0dad6f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class NightBloomFeature extends BiomeFeature { - private int density = 2; - - public NightBloomFeature() { - super("Night Bloom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.nightBloom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 2; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e1c609f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e1c609f6c42100141fce95f06aba7e85 deleted file mode 100644 index ea15368..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8a/e1c609f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,236 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import net.minecraft.util.Vec3; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - //worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), tempE.posZ), - //worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ) - - Vec3.createVectorHelper((double)tempE.posX, (double) tempE.posY + tempE.getEyeHeight(),(double) tempE.posZ), - Vec3.createVectorHelper((double)this.posX, (double) this.posY,(double) this.posZ) - ) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/0080c81bcb2100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/0080c81bcb2100141a6cb1c64d7b6ba1 deleted file mode 100644 index a13a899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/0080c81bcb2100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/209783ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/209783ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f3cf49b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/209783ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/217beef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/217beef9c42100141fce95f06aba7e85 deleted file mode 100644 index 0b9bc71..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/217beef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/2271c4a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/2271c4a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65a6d4e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/2271c4a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/3045bda0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/3045bda0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7fe9312..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/3045bda0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraft.item.Item; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public ItemDeclaration(String name) { - this(name, 0); - } - - public ItemDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("item", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createItem(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerItem(); - if (!side.isServer()) { - clientRegisterItem(); - } - } - } - - protected abstract void registerItem(); - - protected void clientRegisterItem() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/3048909dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/3048909dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ce0ed20..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/3048909dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/4048e3f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/4048e3f4c42100141fce95f06aba7e85 deleted file mode 100644 index cfea057..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/4048e3f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionBlindness extends SubItemPotionGeneric { - - public SubItemPotionBlindness(Item itemID, int subID) { - super(itemID, subID, "potion.blindness"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 2, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.blindness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/602807f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/602807f9c42100141fce95f06aba7e85 deleted file mode 100644 index c6ed032..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/602807f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/71a96da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/71a96da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b430b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/71a96da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/805d32f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/805d32f6c42100141fce95f06aba7e85 deleted file mode 100644 index 4f8db16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/805d32f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/807ba29ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/807ba29ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3dfa0d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/807ba29ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/902a1e85042100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/902a1e85042100141769cb1ed0c338cd deleted file mode 100644 index c90342c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/902a1e85042100141769cb1ed0c338cd +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/9036c2f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/9036c2f5c42100141fce95f06aba7e85 deleted file mode 100644 index 8557ed0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/9036c2f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,103 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/90840101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/90840101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ce8d6b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/90840101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/b074f9fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/b074f9fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d8e74f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/b074f9fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockTumbleweed; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class TumbleweedDeclaration extends BlockDeclaration { - - public TumbleweedDeclaration() { - super("Tumbleweed"); - } - - @Override - protected boolean createBlock() { - BlockList.tumbleweed = Optional.of((new BlockTumbleweed()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tumbleweed.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/d19714a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/d19714a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2b8f553..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/d19714a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class RenderSnow extends RenderGenericLiving { - public final ResourceLocation snowTexture; - - public RenderSnow(ModelBase modelBase, float shadowSize, ResourceLocation livingLocation, - ResourceLocation snowTexture) { - super(modelBase, shadowSize, livingLocation); - this.snowTexture = snowTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (BiomeDictionary.isBiomeOfType(entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ), - Type.FROZEN)) { - return snowTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/e27373f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/e27373f8c42100141fce95f06aba7e85 deleted file mode 100644 index c6b8d2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8b/e27373f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHarm2 extends PotionZulu { - - public PotionHarm2(int par1, boolean par2) { - super(par1, par2, 4393481); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase entityLiving, int amplifier) { - if (!entityLiving.isEntityUndead()) { - entityLiving.attackEntityFrom(DamageSource.magic, amplifier * 3); - } else { - entityLiving.heal(amplifier * 3); - } - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (!par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/00233cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/00233cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 091162d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/00233cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/01d893f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/01d893f9c42100141fce95f06aba7e85 deleted file mode 100644 index da79298..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/01d893f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandPlaceBlock extends CommandBase { - @Override - public String getCommandName() { - return "placeblock"; - } - - /** - * Return the required permission level for this command. - */ - @Override - public int getRequiredPermissionLevel() { - return 2; - } - - /** - * Command stringArgs : /placeblock [targetPlayer] [blockID] Command stringArgs == 2: /placeblock @p - * blockID Command stringArgs == 3: /placeblock @p blockID Command stringArgs == 5: /placeblock @p blockID - * Command stringArgs == 6: /placeblock @p blockID - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.placeblock.usage", new Object[0]); - } else { - int targetX = 0; - int targetY = 0; - int targetZ = 0; - int blockMeta = 0; - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - Block blockToPlace = Block.getBlockFromName(stringArgs[1]); - if (blockToPlace == null) { - throw new WrongUsageException("commands.placeblock.noblock", new Object[0]); - } - - if (stringArgs.length == 3 || stringArgs.length == 6) { - blockMeta = parseIntBounded(commandSender, stringArgs[2], 0, 4095); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - targetX = (int) targetPlayer.posX; - targetY = (int) targetPlayer.posY; - targetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - targetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - targetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, - 0); - targetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - targetPlayer.worldObj.setBlock(targetX, targetY, targetZ, blockToPlace, blockMeta, 3); - } - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spawnentity.usage"; - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/117ac4f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/117ac4f8c42100141fce95f06aba7e85 deleted file mode 100644 index cc26b48..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/117ac4f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRhino; -import com.ngb.projectzulu.common.mobs.models.ModelRhino; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/408f1f2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/408f1f2bc52100141fce95f06aba7e85 deleted file mode 100644 index 33a683a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/408f1f2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,237 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import projectzulu.common.core.CreativePZGeneralTab; -import projectzulu.common.core.CreativePZPotionTab; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.EventHookContainerClass; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.PacketPipeline; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.ZuluGuiHandler; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/522eada2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/522eada2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b4c94d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/522eada2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/523613f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/523613f9c42100141fce95f06aba7e85 deleted file mode 100644 index eb270e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/523613f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,116 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/608c13fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/608c13fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ac48725..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/608c13fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/61cea4f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/61cea4f6c42100141fce95f06aba7e85 deleted file mode 100644 index 4cf36c8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/61cea4f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.core; - - -public enum GuiID { - Tombstone(0), - FlowerPot(1), - AnimalName(2), - MobSpawner(3), - BrewingStand(4), - Unknown(-1); - - private int iD; - private GuiID(int iD) { - this.iD = iD; - } - - public int getID(){ - return iD; - } - - public static GuiID getGuiIDByID(int iD){ - for (GuiID guiID : GuiID.values()) { - if(guiID.iD == iD){ - return guiID; - } - } - return Unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/71d2fbe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/71d2fbe5c42100141fce95f06aba7e85 deleted file mode 100644 index 43afe26..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/71d2fbe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/926fd2fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/926fd2fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4670445..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/926fd2fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.models.ModelFox; -import projectzulu.common.mobs.renders.RenderTameable; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/a0b1445beeac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/a0b1445beeac0014196dc3517d78505a new file mode 100644 index 0000000..5cbcdbc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/a0b1445beeac0014196dc3517d78505a @@ -0,0 +1,288 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelDeer extends ModelBase + { + float heightToRaise = 5f; + float renderScale = 1.3f; + + //fields + ModelRenderer top4hornRight; + ModelRenderer top4hornLeft; + ModelRenderer top3hornRight; + ModelRenderer top3hornLeft; + ModelRenderer top1hornRight; + ModelRenderer top1hornLeft; + ModelRenderer HEADROT; + ModelRenderer hornLeft; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer neck; + ModelRenderer BODYROT; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer tail; + ModelRenderer top2hornLeft; + ModelRenderer hornRight; + ModelRenderer top2hornRight; + + public ModelDeer() + { + textureWidth = 64; + textureHeight = 64; + + HEADROT = new ModelRenderer(this, 1, 19); + HEADROT.addBox(-1.5F, -6F, -7F, 5, 4, 7); + HEADROT.setRotationPoint(-2F, 4F - heightToRaise , -6F); + HEADROT.setTextureSize(64, 64); + HEADROT.mirror = true; + setRotation(HEADROT, 0.5230717F, 0F, 0F); + + earLeft = new ModelRenderer(this, 43, 33); + earLeft.addBox(0F, 1F, 0F, 1, 3, 1); + //earLeft.setRotationPoint(0F, 0.5F, -9F); + earLeft.setRotationPoint(2F, -3.5F, -2.0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, -2.199115F); + HEADROT.addChild(earLeft); + + earRight = new ModelRenderer(this, 50, 33); + earRight.addBox(-1F, 1F, 0F, 1, 3, 1); + //earRight.setRotationPoint(-2F, 0.5F, -9F); + earRight.setRotationPoint(-0.5F, -3.5F, -2.0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, 2.199115F); + HEADROT.addChild(earRight); + + hornLeft = new ModelRenderer(this, 8, 5); + hornLeft.addBox(0F, -3F, 0F, 1, 5, 1); + //hornLeft.setRotationPoint(0F, -3F, -9F); + hornLeft.setRotationPoint(2F, -8F, -2F); + hornLeft.setTextureSize(64, 64); + hornLeft.mirror = true; + setRotation(hornLeft, -0.5410521F, 0.1396263F, 0F); + HEADROT.addChild(hornLeft); + + hornRight = new ModelRenderer(this, 2, 5); + hornRight.addBox(-1F, -3F, 0F, 1, 5, 1); + //hornRight.setRotationPoint(-2F, -3F, -9F); + hornRight.setRotationPoint(0F, -8F, -2F); + hornRight.setTextureSize(64, 64); + hornRight.mirror = true; + setRotation(hornRight, -0.5410521F, -0.1396263F, 0F); + HEADROT.addChild(hornRight); + + top2hornLeft = new ModelRenderer(this, 21, 5); + top2hornLeft.addBox(0F, -3F, 0F, 1, 4, 1); + //top2hornLeft.setRotationPoint(0.3F, -5.5F, -8F); + top2hornLeft.setRotationPoint(0.3F, -3.5F, 0F); + top2hornLeft.setTextureSize(64, 64); + top2hornLeft.mirror = true; + setRotation(top2hornLeft, 0.6372665F, 0.0349066F, 0.0523599F); + hornLeft.addChild(top2hornLeft); + + top2hornRight = new ModelRenderer(this, 15, 5); + top2hornRight.addBox(-1F, -3F, 0F, 1, 4, 1); + //top2hornRight.setRotationPoint(-2.3F, -5.5F, -8F); + top2hornRight.setRotationPoint(0F, -3.5F, 0F); + top2hornRight.setTextureSize(64, 64); + top2hornRight.mirror = true; + setRotation(top2hornRight, 0.6372665F, -0.0349066F, -0.0523599F); + hornRight.addChild(top2hornRight); + + top1hornRight = new ModelRenderer(this, 41, 5); + top1hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top1hornRight.setRotationPoint(-2.4F, -7.5F, -8F); + top1hornRight.setRotationPoint(-0.4F, -2.0F, -0F); + top1hornRight.setTextureSize(64, 64); + top1hornRight.mirror = true; + setRotation(top1hornRight, 1.047198F, 0.1047198F, 0F); + top2hornRight.addChild(top1hornRight); + + top1hornLeft = new ModelRenderer(this, 41, 10); + top1hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top1hornLeft.setRotationPoint(0.5F, -7.5F, -8F); + top1hornLeft.setRotationPoint(0.5F, -2.0F, -0F); + top1hornLeft.setTextureSize(64, 64); + top1hornLeft.mirror = true; + setRotation(top1hornLeft, 1.047198F, -0.1047198F, 0F); + top2hornLeft.addChild(top1hornLeft); + + top3hornRight = new ModelRenderer(this, 34, 5); + top3hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top3hornRight.setRotationPoint(-2.2F, -5F, -8F); + top3hornRight.setRotationPoint(-0.2F, -2.0F, 0F); + top3hornRight.setTextureSize(64, 64); + top3hornRight.mirror = true; + setRotation(top3hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top3hornRight); + + top3hornLeft = new ModelRenderer(this, 34, 10); + top3hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top3hornLeft.setRotationPoint(0.2F, -5F, -8F); + top3hornLeft.setRotationPoint(0.2F, -2.0F, 0F); + top3hornLeft.setTextureSize(64, 64); + top3hornLeft.mirror = true; + setRotation(top3hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top3hornLeft); + + top4hornRight = new ModelRenderer(this, 28, 5); + top4hornRight.addBox(-1F, -3F, 0F, 1, 2, 1); + //top4hornRight.setRotationPoint(-2F, -2F, -8F); + top4hornRight.setRotationPoint(-0F, 1.5F, 1.5F); + top4hornRight.setTextureSize(64, 64); + top4hornRight.mirror = true; + setRotation(top4hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top4hornRight); + + top4hornLeft = new ModelRenderer(this, 28, 9); + top4hornLeft.addBox(0F, -3F, 0F, 1, 2, 1); + //top4hornLeft.setRotationPoint(0F, -2F, -8F); + top4hornLeft.setRotationPoint(0F, 1.5F, 1.5F); + top4hornLeft.setTextureSize(64, 64); + top4hornLeft.mirror = true; + setRotation(top4hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top4hornLeft); + + neck = new ModelRenderer(this, 28, 21); + neck.addBox(0F, -2F, -2F, 4, 3, 8); + neck.setRotationPoint(-3F, 2F - heightToRaise, -8F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, -0.9294653F, 0F, 0F); + BODYROT = new ModelRenderer(this, 28, 41); + BODYROT.addBox(-4F, -8F, -5F, 8, 15, 6); + BODYROT.setRotationPoint(-1F, 6F - heightToRaise, 1F); + BODYROT.setTextureSize(64, 64); + BODYROT.mirror = true; + setRotation(BODYROT, 1.570796F, 0F, 0F); + leg1 = new ModelRenderer(this, 0, 32); + leg1.addBox(-1F, 0F, -1F, 3, 10, 3); + leg1.setRotationPoint(-4F, 11F - heightToRaise, 6F); + leg1.setTextureSize(64, 64); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 13, 32); + leg2.addBox(-1F, 0F, -1F, 3, 10, 3); + leg2.setRotationPoint(1F, 11F - heightToRaise, 6F); + leg2.setTextureSize(64, 64); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 13, 49); + leg3.addBox(-2F, 0F, -1F, 3, 10, 3); + leg3.setRotationPoint(-3F, 11F - heightToRaise, -6F); + leg3.setTextureSize(64, 64); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 0, 49); + leg4.addBox(-1F, 0F, -1F, 3, 10, 3); + leg4.setRotationPoint(1F, 11F - heightToRaise, -6F); + leg4.setTextureSize(64, 64); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + tail = new ModelRenderer(this, 28, 34); + tail.addBox(-1F, 0F, 0F, 2, 1, 3); + tail.setRotationPoint(-1F, 5.5F - heightToRaise, 7F); + tail.setTextureSize(64, 64); + tail.mirror = true; + setRotation(tail, -0.4506874F, 0F, 0F); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //top4hornRight.render(f5); + //top4hornLeft.render(f5); + //top3hornRight.render(f5); + //top3hornLeft.render(f5); + //top2hornLeft.render(f5); + //top2hornRight.render(f5); + //top1hornRight.render(f5); + //top1hornLeft.render(f5); + //hornLeft.render(f5); + //hornRight.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Constant Animation Rotations */ + leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + + /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math + .log(par3 + 1))); + + earLeft.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1))); + earRight.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1)));*/ + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + //HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + //HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + HEADROT.rotateAngleX = f3 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); + } + + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/b02ee8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/b02ee8f8c42100141fce95f06aba7e85 deleted file mode 100644 index 051ecc8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/b02ee8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBeaver; -import com.ngb.projectzulu.common.mobs.models.ModelBeaver; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BeaverDeclaration extends SpawnableDeclaration { - - public BeaverDeclaration() { - super("Beaver", 15, EntityBeaver.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (54 << 16) + (36 << 8) + 9; - eggColor2 = (67 << 16) + (45 << 8) + 11; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/e1cb159ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/e1cb159ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a5e1db0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/e1cb159ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/f0b59fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/f0b59fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9dcd7a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8c/f0b59fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAIBase; - -public class EntityAISmoothSwimming extends EntityAIBase{ - private EntityLiving theEntity; - private boolean smootherSwimming = false; - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving){ - this.theEntity = par1EntityLiving; - this.setMutexBits(4); - par1EntityLiving.getNavigator().setCanSwim(true); - } - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving, boolean smootherSwimming){ - this(par1EntityLiving); - this.smootherSwimming = smootherSwimming; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - - /** - * Updates the task - */ - public void updateTask(){ -// if(smootherSwimming -//// && this.theEntity.getRNG().nextFloat() < 0.8F -//// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ) -// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ)){ -// this.theEntity.getJumpHelper().setJumping(); -// } - - if(this.theEntity.getRNG().nextFloat() < 0.8F){ - this.theEntity.getJumpHelper().setJumping(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/0099d5fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/0099d5fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c6556f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/0099d5fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20673ff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20673ff4c42100141fce95f06aba7e85 deleted file mode 100644 index 9836e84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20673ff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisPool implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta water = new BlockWithMeta(Blocks.water); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return water; - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisPool"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20d5fdf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20d5fdf4c42100141fce95f06aba7e85 deleted file mode 100644 index 543fa3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/20d5fdf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionCleansing extends PotionZulu { - - public PotionCleansing(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(1, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - super.performEffect(effectedEntity, par2); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/30984ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/30984ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 85d4b37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/30984ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/41df8afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/41df8afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a94b6e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/41df8afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50ea5301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50ea5301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 19e24b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/50ea5301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,253 +0,0 @@ -// Date: 21/08/2012 16:58:44 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityLizard; - -public class ModelLizard extends ModelBase { - ModelRenderer leg1; - ModelRenderer leg1u; - ModelRenderer leg2; - ModelRenderer leg2u; - - ModelRenderer TAILROT; - ModelRenderer Tail3; - ModelRenderer Tail2; - ModelRenderer Tail1; - - ModelRenderer FRONTROT; - ModelRenderer HEADBASE; - ModelRenderer Frill1; - ModelRenderer Frill2; - ModelRenderer Frill3; - ModelRenderer Frill4; - ModelRenderer head; - ModelRenderer leg3u; - ModelRenderer leg3; - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg4u; - - public ModelLizard() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TAILROT.dltfold1", 0, 0); - setTextureOffset("FRONTROT.dltfold3", 0, 0); - - leg1 = new ModelRenderer(this, 20, 22); - leg1.addBox(-3F, 0F, -1F, 2, 6, 2); - leg1.setRotationPoint(-4F, 18F, 6F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg1u = new ModelRenderer(this, 14, 22); - leg1u.addBox(-1F, 0F, -1F, 1, 2, 2); - leg1u.setRotationPoint(-4F, 18F, 6F); - leg1u.setTextureSize(64, 32); - leg1u.mirror = true; - setRotation(leg1u, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 20, 22); - leg2.addBox(1F, 0F, -1F, 2, 6, 2); - leg2.setRotationPoint(4F, 18F, 6F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg2u = new ModelRenderer(this, 14, 22); - leg2u.addBox(0F, 0F, -1F, 1, 2, 2); - leg2u.setRotationPoint(4F, 18F, 6F); - leg2u.setTextureSize(64, 32); - leg2u.mirror = true; - setRotation(leg2u, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 9F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - Tail3 = new ModelRenderer(this, 0, 17); - Tail3.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail3); - Tail3.setRotationPoint(0F, -1F, 10F); - Tail3.setTextureSize(64, 32); - Tail3.mirror = true; - setRotation(Tail3, 0F, 0F, 0F); - Tail2 = new ModelRenderer(this, 0, 17); - Tail2.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail2); - Tail2.setRotationPoint(0F, -1F, 5F); - Tail2.setTextureSize(64, 32); - Tail2.mirror = true; - setRotation(Tail2, 0F, 0F, 0F); - Tail1 = new ModelRenderer(this, 0, 17); - Tail1.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail1); - Tail1.setRotationPoint(0F, -1F, 0F); - Tail1.setTextureSize(64, 32); - Tail1.mirror = true; - setRotation(Tail1, 0F, 0F, 0F); - FRONTROT = new ModelRenderer(this, "FRONTROT"); - FRONTROT.setRotationPoint(0F, 19F, 6F); - setRotation(FRONTROT, 0F, 0F, 0F); - FRONTROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - FRONTROT.addChild(HEADBASE); - HEADBASE.setRotationPoint(0F, 0F, -13F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - Frill2 = new ModelRenderer(this, 29, 22); - Frill2.addBox(-3F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill2); - Frill2.setRotationPoint(-3F, 1F, -3F); - Frill2.setTextureSize(64, 32); - Frill2.mirror = true; - setRotation(Frill2, 0F, 0.0371786F, 0F); - Frill4 = new ModelRenderer(this, 37, 22); - Frill4.addBox(-4F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill4); - Frill4.setRotationPoint(-1F, -2F, -3F); - Frill4.setTextureSize(64, 32); - Frill4.mirror = true; - setRotation(Frill4, 0F, 0F, 0F); - Frill1 = new ModelRenderer(this, 29, 22); - Frill1.addBox(0F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill1); - Frill1.setRotationPoint(3F, 1F, -3F); - Frill1.setTextureSize(64, 32); - Frill1.mirror = true; - setRotation(Frill1, 0F, 0.0371786F, 0F); - - Frill3 = new ModelRenderer(this, 37, 22); - Frill3.addBox(0F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill3); - Frill3.setRotationPoint(1F, -2F, -3F); - Frill3.setTextureSize(64, 32); - Frill3.mirror = true; - setRotation(Frill3, 0F, 0F, 0F); - Frill3.mirror = false; - head = new ModelRenderer(this, 0, 0); - head.addBox(-4F, -4F, -9F, 6, 6, 8); - HEADBASE.addChild(head); - head.setRotationPoint(1F, 1F, 1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(HEADBASE); - leg3u = new ModelRenderer(this, 14, 22); - leg3u.addBox(-1F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg3u); - leg3u.setRotationPoint(-4F, -1F, -12F); - leg3u.setTextureSize(64, 32); - leg3u.mirror = true; - setRotation(leg3u, 0F, 0F, 0F); - body = new ModelRenderer(this, 10, 0); - body.addBox(-4F, -2F, -9F, 8, 4, 18); - FRONTROT.addChild(body); - body.setRotationPoint(0F, 0F, -6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4u = new ModelRenderer(this, 14, 22); - leg4u.addBox(0F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg4u); - leg4u.setRotationPoint(4F, -1F, -12F); - leg4u.setTextureSize(64, 32); - leg4u.mirror = true; - setRotation(leg4u, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 20, 22); - leg4.addBox(1F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg4); - leg4.setRotationPoint(4F, -1F, -12F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 20, 22); - leg3.addBox(-3F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg3); - leg3.setRotationPoint(-4F, -1F, -12F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - FRONTROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - FRONTROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityLizard var5 = (EntityLizard) par1EntityLiving; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - if (var5.prepareToSpit == true) { - Frill1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.0F * par3; - Frill2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 1.0F * par3; - - Frill3.rotateAngleZ = (float) (-45 * Math.PI / 180); - Frill3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - Frill3.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - - Frill4.rotateAngleZ = (float) (45 * Math.PI / 180); - Frill4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - Frill4.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - } else { - Frill1.rotateAngleZ = (float) (-90 * Math.PI / 180); // This is on Right - Frill2.rotateAngleZ = (float) (90 * Math.PI / 180); // This is on Left - - Frill3.rotateAngleY = (float) (-90 * Math.PI / 180); - Frill4.rotateAngleY = (float) (90 * Math.PI / 180); - } - leg1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - leg3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADBASE.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADBASE.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/7074d9fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/7074d9fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c1947ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/7074d9fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.models.ModelHornBill; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HornbillDeclaration extends SpawnableDeclaration { - - public HornbillDeclaration() { - super("Horn Bill", 36, EntityHornBill.class, EnumCreatureType.ambient); - setSpawnProperties(10, 25, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (26 << 16) + (19 << 8) + 15; - eggColor2 = (199 << 16) + (33 << 8) + 14; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/717c38fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/717c38fac42100141fce95f06aba7e85 deleted file mode 100644 index fb36379..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/717c38fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/80852a00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/80852a00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ac0bd1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/80852a00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLimitedMobSpawner extends BlockContainer { - - public BlockLimitedMobSpawner() { - super(Material.rock); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, - float par7, float par8, float par9) { - if (player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isCreativeMode) { - ((EntityPlayer) player).openGui(ProjectZulu_Core.modInstance, GuiID.MobSpawner.getID(), par1World, par2, - par3, par4); - return true; - } - return super.onBlockActivated(par1World, par2, par3, par4, player, par6, par7, par8, par9); - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityLimitedMobSpawner(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/80e73650c5ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/80e73650c5ab00141ee9bf3050c1025b new file mode 100644 index 0000000..58ebe81 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/80e73650c5ab00141ee9bf3050c1025b @@ -0,0 +1,117 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + private Configuration config; + private boolean bugReleasem = true; + private boolean stickSpawn = true; + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void preInit(FMLPreInitializationEvent event, File configDirectory) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + //displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + config.save(); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d049d378ce21001418ceed54b1d01b94 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d049d378ce21001418ceed54b1d01b94 deleted file mode 100644 index 9137382..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/d049d378ce21001418ceed54b1d01b94 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "com.ngb.projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/e069d4f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/e069d4f6c42100141fce95f06aba7e85 deleted file mode 100644 index 66b2841..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/e069d4f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/e0967aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/e0967aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5f13576..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/e0967aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelTombstone extends ModelBase -{ - //fields - ModelRenderer baserig; - ModelRenderer body4; - ModelRenderer topcenter; - ModelRenderer baselef; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - private ModelRenderer CENTERROT; - private ModelRenderer TOPLEFROT; - private ModelRenderer TOPRIGROT; - - public ModelTombstone(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TOPLEFROT.topleft", 0, 17); - setTextureOffset("TOPRIGROT.topright", 0, 17); - - body4 = new ModelRenderer(this, 28, 15); - body4.addBox(0F, -18F, -4.5F, 9, 8, 9); - body4.setRotationPoint(0F, 28F, 0F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - topcenter = new ModelRenderer(this, 28, 16); - topcenter.addBox(-4.5F, -4F, -4.5F, 9, 4, 9); - topcenter.setRotationPoint(0F, 2F, 0F); - topcenter.setTextureSize(64, 32); - topcenter.mirror = true; - setRotation(topcenter, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 28, 15); - body3.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body3.setRotationPoint(0F, 28F, 0F); - body3.setTextureSize(64, 32); - body3.mirror = true; - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body3.mirror = false; - body2 = new ModelRenderer(this, 28, 15); - body2.addBox(0F, -18F, -4.5F, 9, 8, 9); - body2.setRotationPoint(0F, 20F, 0F); - body2.setTextureSize(64, 32); - body2.mirror = true; - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body2.mirror = false; - body1 = new ModelRenderer(this, 28, 15); - body1.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body1.setRotationPoint(0F, 20F, 0F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - baselef = new ModelRenderer(this, 0, 0); - baselef.addBox(-12F, -3F, -6F, 12, 6, 12); - baselef.setRotationPoint(0F, 21F, 0F); - baselef.setTextureSize(64, 32); - baselef.mirror = true; - baselef.mirror = true; - setRotation(baselef, 0F, 0F, 0F); - baselef.mirror = false; - baserig = new ModelRenderer(this, 0, 0); - baserig.addBox(0F, -3F, -6F, 12, 6, 12); - baserig.setRotationPoint(0F, 21F, 0F); - baserig.setTextureSize(64, 32); - baserig.mirror = true; - baserig.mirror = true; - setRotation(baserig, 0F, 0F, 0F); - baserig.mirror = false; - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 1.2F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - TOPLEFROT = new ModelRenderer(this, "TOPLEFROT"); - TOPLEFROT.setRotationPoint(-5.8F, 0F, 0F); - setRotation(TOPLEFROT, 0F, 0F, 0.837758F); - TOPLEFROT.mirror = true; - TOPLEFROT.addBox("topleft", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPLEFROT); - TOPRIGROT = new ModelRenderer(this, "TOPRIGROT"); - TOPRIGROT.setRotationPoint(5.8F, 0F, 0F); - setRotation(TOPRIGROT, 0F, 0F, -0.837758F); - TOPRIGROT.mirror = true; - TOPRIGROT.addBox("topright", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPRIGROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - baserig.render(f5); - body4.render(f5); - topcenter.render(f5); - baselef.render(f5); - body3.render(f5); - body2.render(f5); - body1.render(f5); - - CENTERROT.render(f5); - - } - - public void render1(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - body4.rotateAngleY = (float) (angle*Math.PI/180); - body4.render(f5); - topcenter.rotateAngleY = (float) (angle*Math.PI/180); - topcenter.render(f5); - - body3.rotateAngleY = (float) (angle*Math.PI/180); - body3.render(f5); - body2.rotateAngleY = (float) (angle*Math.PI/180); - body2.render(f5); - body1.rotateAngleY = (float) (angle*Math.PI/180); - body1.render(f5); - - baselef.rotateAngleY = (float) (angle*Math.PI/180); - baselef.render(f5); - baserig.rotateAngleY = (float) (angle*Math.PI/180); - baserig.render(f5); - } - - public void render2(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - CENTERROT.rotateAngleY = (float) (angle*Math.PI/180); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } - -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f1339ff7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f1339ff7c42100141fce95f06aba7e85 deleted file mode 100644 index f06d995..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8d/f1339ff7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemAnkh; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/00833d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/00833d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6106606..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/00833d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,529 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelCrocodile extends ModelBase { - ModelRenderer MOUTHBOTROT; - ModelRenderer MOUTHTOPROT; - ModelRenderer BODY1ROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - private ModelRenderer BODY2ROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer BODY3ROT; - private ModelRenderer BODY4ROT; - private ModelRenderer BODY5ROT; - private ModelRenderer BODY6ROT; - private ModelRenderer TAIL1ROT; - private ModelRenderer TAIL2ROT; - private ModelRenderer TAIL3ROT; - private ModelRenderer TAILROT4; - private ModelRenderer TAILROT5; - private ModelRenderer TAILROT6; - private ModelRenderer TAILROT7; - private ModelRenderer TAILROT8; - private ModelRenderer TAILROT9; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - - public ModelCrocodile() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("BODY1ROT.Body1", 62, 0); - setTextureOffset("BODY1ROT.bodydeclef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig1", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig1", 0, 0); - setTextureOffset("BODY1ROT.Shape1", 0, 0); - setTextureOffset("BODY1ROT.bodydeclef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig2", 0, 0); - setTextureOffset("BODY2ROT.Body2", 62, 0); - setTextureOffset("BODY2ROT.bodydeclef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydeclef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig4", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig4", 0, 0); - setTextureOffset("LEG2TOPROT.leg2top", 20, 12); - setTextureOffset("LEG2TOPROT.leg2deco", 16, 8); - setTextureOffset("LEG2BOTROT.leg2bot", 16, 20); - setTextureOffset("LEG1TOPROT.leg1top", 0, 12); - setTextureOffset("LEG1TOPROT.leg1deco", 0, 8); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 20); - setTextureOffset("BODY3ROT.Body3", 62, 0); - setTextureOffset("BODY3ROT.bodydeclef5", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef5", 0, 0); - setTextureOffset("BODY3ROT.bodydeclef6", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef6", 0, 0); - setTextureOffset("BODY4ROT.Body4", 62, 0); - setTextureOffset("BODY4ROT.bodydecinrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinrig8", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef8", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef8", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig8", 0, 0); - setTextureOffset("BODY5ROT.Body5", 62, 0); - setTextureOffset("BODY5ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig10", 0, 0); - setTextureOffset("BODY6ROT.Body6", 62, 0); - setTextureOffset("BODY6ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig10", 0, 0); - setTextureOffset("TAIL1ROT.tail1", 62, 12); - setTextureOffset("TAIL1ROT.bodydecinlef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecinrig11", 0, 0); - setTextureOffset("TAIL1ROT.bodydeclef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecrig11", 0, 0); - setTextureOffset("TAIL2ROT.tail2", 62, 22); - setTextureOffset("TAIL2ROT.bodydeclef12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinlef12", 0, 0); - setTextureOffset("TAIL3ROT.tail3", 62, 31); - setTextureOffset("TAIL3ROT.bodydecrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinlef13", 0, 0); - setTextureOffset("TAIL3ROT.bodydeclef13", 0, 0); - setTextureOffset("TAILROT4.tail4", 62, 40); - setTextureOffset("TAILROT4.bodydecrig14", 0, 0); - setTextureOffset("TAILROT4.bodydecinlef14", 0, 0); - setTextureOffset("TAILROT4.bodydeclef14", 0, 0); - setTextureOffset("TAILROT5.tail5", 62, 48); - setTextureOffset("TAILROT5.bodydeclef15", 0, 0); - setTextureOffset("TAILROT5.bodydecrig16", 0, 0); - setTextureOffset("TAILROT5.bodydecrig15", 0, 0); - setTextureOffset("TAILROT5.bodydeclef16", 0, 0); - setTextureOffset("TAILROT6.tail6", 84, 49); - setTextureOffset("TAILROT6.bodydeclef17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig18", 0, 0); - setTextureOffset("TAILROT6.bodydeclef18", 0, 0); - setTextureOffset("TAILROT7.tail7", 90, 44); - setTextureOffset("TAILROT7.bodydecrig19", 0, 0); - setTextureOffset("TAILROT7.bodydeclef19", 0, 0); - setTextureOffset("TAILROT8.tail8", 94, 40); - setTextureOffset("TAILROT8.bodydecrig20", 0, 0); - setTextureOffset("TAILROT8.bodydeclef20", 0, 0); - setTextureOffset("TAILROT9.tail9", 98, 37); - setTextureOffset("LEG4TOPROT.leg4top", 20, 12); - setTextureOffset("LEG4TOPROT.leg4deco", 16, 8); - setTextureOffset("LEG4BOTROT.leg4bot", 16, 20); - setTextureOffset("LEG3TOPROT.leg3top", 0, 12); - setTextureOffset("LEG3TOPROT.leg3deco", 0, 8); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 20); - - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 17F, -7F); - setRotation(BODY1ROT, 0F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("Body1", -7F, -4F, 0F, 14, 8, 4); - BODY1ROT.addBox("bodydeclef1", -5.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef1", -2F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig1", 1F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig1", 4.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("Shape1", 0F, 0F, 0F, 1, 1, 1); - BODY1ROT.addBox("bodydeclef2", -5.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef2", -2F, -5F, 2.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig2", 4.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig2", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("Body2", -7F, -4F, 0F, 14, 8, 4); - BODY2ROT.addBox("bodydeclef3", -5.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef3", -2F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig3", 4.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig3", 1F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydeclef4", -5.5F, -5F, 3F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef4", -2F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig4", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig4", 4.5F, -5F, 3F, 1, 1, 1); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(7F, 1F, 2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", 0F, -2F, -2F, 6, 4, 4); - LEG2TOPROT.addBox("leg2deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2F, 0F, -2F, 4, 4, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY2ROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-8F, 1F, 2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -5F, -2F, -2F, 6, 4, 4); - LEG1TOPROT.addBox("leg1deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -2F, 0F, -2F, 4, 4, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY2ROT.addChild(LEG1TOPROT); - BODY3ROT = new ModelRenderer(this, "BODY3ROT"); - BODY3ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY3ROT, 0F, 0F, 0F); - BODY3ROT.mirror = true; - BODY3ROT.addBox("Body3", -7F, -4F, 0F, 14, 8, 4); - BODY3ROT.addBox("bodydeclef5", -5.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig5", 4.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig5", 1F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef5", -2F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydeclef6", -5.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig6", 4.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig6", 1F, -5F, 2.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef6", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT = new ModelRenderer(this, "BODY4ROT"); - BODY4ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY4ROT, 0F, 0F, 0F); - BODY4ROT.mirror = true; - BODY4ROT.addBox("Body4", -7F, -4F, 0F, 14, 8, 4); - BODY4ROT.addBox("bodydecinrig7", 1F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef7", -2F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig7", 4.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef7", -5.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydecinrig8", 1F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef8", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef8", -5.5F, -5F, 3F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig8", 4.5F, -5F, 3F, 1, 1, 1); - BODY5ROT = new ModelRenderer(this, "BODY5ROT"); - BODY5ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY5ROT, 0F, 0F, 0F); - BODY5ROT.mirror = true; - BODY5ROT.addBox("Body5", -7F, -4F, 0F, 14, 8, 4); - BODY5ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - BODY6ROT = new ModelRenderer(this, "BODY6ROT"); - BODY6ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY6ROT, 0F, 0F, 0F); - BODY6ROT.mirror = true; - BODY6ROT.addBox("Body6", -7F, -4F, 0F, 14, 8, 4); - BODY6ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - TAIL1ROT = new ModelRenderer(this, "TAIL1ROT"); - TAIL1ROT.setRotationPoint(0F, 0F, 4F); - setRotation(TAIL1ROT, 0F, 0F, 0F); - TAIL1ROT.mirror = true; - TAIL1ROT.addBox("tail1", -6F, -3.5F, 0F, 12, 7, 3); - TAIL1ROT.addBox("bodydecinlef11", -2F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydecinrig11", 1F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydeclef11", -5F, -4.5F, 1F, 1, 1, 1); - TAIL1ROT.addBox("bodydecrig11", 4F, -4.5F, 1F, 1, 1, 1); - TAIL2ROT = new ModelRenderer(this, "TAIL2ROT"); - TAIL2ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL2ROT, 0F, 0F, 0F); - TAIL2ROT.mirror = true; - TAIL2ROT.addBox("tail2", -5.5F, -2.5F, 0F, 11, 6, 3); - TAIL2ROT.addBox("bodydeclef12", -4.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecrig12", 3.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinrig12", 1F, -3.5F, 0.5F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinlef12", -2F, -3.5F, 0.5F, 1, 1, 1); - TAIL3ROT = new ModelRenderer(this, "TAIL3ROT"); - TAIL3ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL3ROT, 0F, 0F, 0F); - TAIL3ROT.mirror = true; - TAIL3ROT.addBox("tail3", -4.5F, -1.5F, 0F, 9, 5, 4); - TAIL3ROT.addBox("bodydecrig13", 2.5F, -2.5F, 1.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinrig13", 0.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinlef13", -1.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydeclef13", -4F, -2.5F, 1.5F, 1, 1, 1); - TAILROT4 = new ModelRenderer(this, "TAILROT4"); - TAILROT4.setRotationPoint(0F, 1.5F, 4F); - setRotation(TAILROT4, 0F, 0F, 0F); - TAILROT4.mirror = true; - TAILROT4.addBox("tail4", -4F, -2F, 0F, 8, 4, 4); - TAILROT4.addBox("bodydecrig14", 2F, -3F, 1.5F, 1, 1, 1); - TAILROT4.addBox("bodydecinlef14", -0.5F, -3F, 0.5F, 1, 1, 1); - TAILROT4.addBox("bodydeclef14", -3F, -3F, 1.5F, 1, 1, 1); - TAILROT5 = new ModelRenderer(this, "TAILROT5"); - TAILROT5.setRotationPoint(0F, 0.5F, 4F); - setRotation(TAILROT5, 0F, 0F, 0F); - TAILROT5.mirror = true; - TAILROT5.addBox("tail5", -3F, -1.5F, 0F, 6, 3, 5); - TAILROT5.addBox("bodydeclef15", -2F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig16", 1F, -2.5F, 3.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig15", 1F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydeclef16", -2F, -2.5F, 3.5F, 1, 1, 1); - TAILROT6 = new ModelRenderer(this, "TAILROT6"); - TAILROT6.setRotationPoint(0F, 0.5F, 5F); - setRotation(TAILROT6, 0F, 0F, 0F); - TAILROT6.mirror = true; - TAILROT6.addBox("tail6", -2.5F, -1F, 0F, 5, 2, 5); - TAILROT6.addBox("bodydeclef17", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig17", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig18", 0.5F, -2F, 3F, 1, 1, 1); - TAILROT6.addBox("bodydeclef18", -1.5F, -2F, 3F, 1, 1, 1); - TAILROT7 = new ModelRenderer(this, "TAILROT7"); - TAILROT7.setRotationPoint(0F, 0F, 5F); - setRotation(TAILROT7, 0F, 0F, 0F); - TAILROT7.mirror = true; - TAILROT7.addBox("tail7", -2F, -1F, 0F, 4, 2, 3); - TAILROT7.addBox("bodydecrig19", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT7.addBox("bodydeclef19", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT8 = new ModelRenderer(this, "TAILROT8"); - TAILROT8.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT8, 0F, 0F, 0F); - TAILROT8.mirror = true; - TAILROT8.addBox("tail8", -1.5F, -1F, 0F, 3, 2, 2); - TAILROT8.addBox("bodydecrig20", 0.5F, -2F, 0.5F, 1, 1, 1); - TAILROT8.addBox("bodydeclef20", -1.5F, -2F, 0.5F, 1, 1, 1); - TAILROT9 = new ModelRenderer(this, "TAILROT9"); - TAILROT9.setRotationPoint(0F, 0F, 2F); - setRotation(TAILROT9, 0F, 0F, 0F); - TAILROT9.mirror = true; - TAILROT9.addBox("tail9", -1F, -1F, 0F, 2, 2, 1); - TAILROT8.addChild(TAILROT9); - TAILROT7.addChild(TAILROT8); - TAILROT6.addChild(TAILROT7); - TAILROT5.addChild(TAILROT6); - TAILROT4.addChild(TAILROT5); - TAIL3ROT.addChild(TAILROT4); - TAIL2ROT.addChild(TAIL3ROT); - TAIL1ROT.addChild(TAIL2ROT); - BODY6ROT.addChild(TAIL1ROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(7F, 1F, 0F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", 0F, -2F, -2F, 6, 4, 4); - LEG4TOPROT.addBox("leg4deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -2F, 0F, -2F, 4, 4, 4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODY6ROT.addChild(LEG4TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-8F, 1F, 0F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -5F, -2F, -2F, 6, 4, 4); - LEG3TOPROT.addBox("leg3deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -2F, 0F, -2F, 4, 4, 4); - LEG3TOPROT.addChild(LEG3BOTROT); - BODY6ROT.addChild(LEG3TOPROT); - BODY5ROT.addChild(BODY6ROT); - BODY4ROT.addChild(BODY5ROT); - BODY3ROT.addChild(BODY4ROT); - BODY2ROT.addChild(BODY3ROT); - BODY1ROT.addChild(BODY2ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 6.0F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.7F / var8, 1.7F / var8, 1.7F / var8); - GL11.glTranslatef(0.0f, field_78145_g * f5, field_78151_h * f5); - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODY1ROT.render(f5); - GL11.glPopMatrix(); - } else { - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - BODY1ROT.render(f5); - - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG2TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG1TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODY1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 0 / 4 * (float) Math.PI) * 0.1F * par3; - BODY2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; - BODY3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 2 / 4 * (float) Math.PI) * 0.1F * par3; - BODY4ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 3 / 4 * (float) Math.PI) * 0.1F * par3; - BODY5ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 4 / 4 * (float) Math.PI) * 0.1F * par3; - BODY6ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 5 / 4 * (float) Math.PI) * 0.1F * par3; - - TAIL1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 6 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 7 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 8 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT4.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 9 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT5.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 10 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT6.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 11 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT7.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 12 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT8.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 13 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT9.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 14 / 4 * (float) Math.PI) * 0.1F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - MOUTHTOPROT.rotateAngleX = -Math.abs(MathHelper.cos(f * 0.6662F) * f1) + Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - MOUTHTOPROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - - MOUTHBOTROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - MOUTHBOTROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/10d8b901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/10d8b901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b877027..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/10d8b901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/207beef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/207beef9c42100141fce95f06aba7e85 deleted file mode 100644 index 6b1bac4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/207beef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/411e1d2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/411e1d2bc52100141fce95f06aba7e85 deleted file mode 100644 index 54a5075..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/411e1d2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,164 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import projectzulu.common.blocks.FurPeltDeclaration; -import projectzulu.common.blocks.ItemBlockRecipeManager; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import projectzulu.common.blocks.terrain.AloeVeraFeature; -import projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import projectzulu.common.blocks.terrain.NightBloomFeature; -import projectzulu.common.blocks.terrain.PalmTreeFeature; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.PotionEvents; -import projectzulu.common.potion.EventHandleNullPotions; -import projectzulu.common.potion.PZExtraPotionDeclaration; -import projectzulu.common.potion.PZVanillaPotionDeclaration; -import projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/418d70e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/418d70e6c42100141fce95f06aba7e85 deleted file mode 100644 index 467ebf7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/418d70e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/41babc9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/41babc9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3bb58a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/41babc9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50f241fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50f241fac42100141fce95f06aba7e85 deleted file mode 100644 index d3b3ad9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/50f241fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/518cd6e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/518cd6e4c42100141fce95f06aba7e85 deleted file mode 100644 index 7adaaf1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/518cd6e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/51b383fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/51b383fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f581ba7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/51b383fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/60039ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/60039ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 37a69c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/60039ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,159 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/61b25affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/61b25affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c46390..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/61b25affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/90f06c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/90f06c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d65ed89..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/90f06c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,184 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import projectzulu.common.core.RenderHelper; -import projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/b08f7f4f6023001416428e945fc8fb52 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/b08f7f4f6023001416428e945fc8fb52 deleted file mode 100644 index f0cdb83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/b08f7f4f6023001416428e945fc8fb52 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/c18c47f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/c18c47f9c42100141fce95f06aba7e85 deleted file mode 100644 index 66cb450..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/c18c47f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/e29b11a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/e29b11a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dc19269..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8e/e29b11a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/217422f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/217422f5c42100141fce95f06aba7e85 deleted file mode 100644 index 095bc24..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/217422f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -public class RenderGenericLiving extends RenderLiving implements RenderWrapper { - - public final ResourceLocation livingTexture; - - public RenderGenericLiving(ModelBase modelBase, float shadowSize, ResourceLocation livingTexture) { - super(modelBase, shadowSize); - this.livingTexture = livingTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return livingTexture; - } - - @Override - public Render getRender() { - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/304384f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/304384f5c42100141fce95f06aba7e85 deleted file mode 100644 index d76f18d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/304384f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityGreenFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/40534200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/40534200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c1f6766..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/40534200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,577 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/41abe0ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/41abe0ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3042648..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/41abe0ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/50a7199fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/50a7199fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0b74787..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/50a7199fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.models.ModelHornBill; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HornbillDeclaration extends SpawnableDeclaration { - - public HornbillDeclaration() { - super("Horn Bill", 36, EntityHornBill.class, EnumCreatureType.ambient); - setSpawnProperties(10, 25, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (26 << 16) + (19 << 8) + 15; - eggColor2 = (199 << 16) + (33 << 8) + 14; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/51b143f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/51b143f8c42100141fce95f06aba7e85 deleted file mode 100644 index cd4fd53..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/51b143f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import com.ngb.projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/61e2cfffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/61e2cfffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43dc3dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/61e2cfffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockQuickSand; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/70bf14c80a2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/70bf14c80a2100141769cb1ed0c338cd deleted file mode 100644 index 37e3ba8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/70bf14c80a2100141769cb1ed0c338cd +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityGenericCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityGenericCreature entityGenericCreature, float par2) - { - this.theEntity = entityGenericCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/9086e3fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/9086e3fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9d05a21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/9086e3fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityLizardSpit; -import projectzulu.common.mobs.renders.RenderLizardSpit; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/a17bbdf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/a17bbdf5c42100141fce95f06aba7e85 deleted file mode 100644 index 11a173f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/a17bbdf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/c1b2219ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/c1b2219ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 50e4038..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/c1b2219ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.api.BlockList; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/d13db29fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/d13db29fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 88da588..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/d13db29fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; - -/* Helper Class to contain both BlockID and Meta in a single Structure */ -public class BlockWithMeta extends WeightedRandom.Item { - public final Block block; - public final int meta; - - public BlockWithMeta(Block block) { - this(block, 0); - } - - public BlockWithMeta(Block block, int meta) { - this(block, meta, 1); - } - - public BlockWithMeta(Block block, int meta, int weight) { - super(weight); - this.block = block; - this.meta = meta; - } - - /** - * Helper Function to Place Block/TileEntity/Spawner. Overridden in child to make use of specific knowledge, i.e. A - * Chests Loot Chance - */ - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (block != null) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e08bdde7312000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e08bdde7312000141dbfc2e92eb0e949 deleted file mode 100644 index c77d162..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/e08bdde7312000141dbfc2e92eb0e949 +++ /dev/null @@ -1,18 +0,0 @@ -package com.example.soulmod; - -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void preinit(FMLPreInitializationEvent event) - { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f0510fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f0510fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b528480..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f0510fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,382 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - //return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - // par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - return AxisAlignedBB.getBoundingBox(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f13d429fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f13d429fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2831bbc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f13d429fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,190 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f1b693e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f1b693e4c42100141fce95f06aba7e85 deleted file mode 100644 index e90310d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/8f/f1b693e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,120 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/30c59ef4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/30c59ef4c42100141fce95f06aba7e85 deleted file mode 100644 index a930008..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/30c59ef4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; - -public class ChestWithMeta extends BlockWithMeta { - - int lootChance; - int maxLoot; - TileEntityChest tileEntityChest; - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance) { - this(block, meta, tileEntityChest, lootChance, -1); - } - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance, int maxLoot) { - super(block, meta); - this.tileEntityChest = tileEntityChest; - this.lootChance = lootChance; - this.maxLoot = maxLoot; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntityChest); - int amountOfLoot = 0; - for (int slot = 0; slot < tileEntityChest.getSizeInventory(); slot++) { - if (lootChance - random.nextInt(100) >= 0) { - tileEntityChest.setInventorySlotContents(slot, ChestGenHooks.getOneItem(DUNGEON_CHEST, random)); - amountOfLoot++; - if (maxLoot > 0 && amountOfLoot >= maxLoot) { - break; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/4167b1f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/4167b1f8c42100141fce95f06aba7e85 deleted file mode 100644 index 7898ca2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/4167b1f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,156 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityFinch; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/50c07d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/50c07d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dacf718..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/50c07d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHarm2 extends PotionZulu { - - public PotionHarm2(int par1, boolean par2) { - super(par1, par2, 4393481); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase entityLiving, int amplifier) { - if (!entityLiving.isEntityUndead()) { - entityLiving.attackEntityFrom(DamageSource.magic, amplifier * 3); - } else { - entityLiving.heal(amplifier * 3); - } - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (!par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/8041e8fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/8041e8fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8b31b64..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/8041e8fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityOstrich; -import projectzulu.common.mobs.models.ModelOstrich; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/d110819ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/d110819ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d756151..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/d110819ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/e0a53bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/e0a53bf9c42100141fce95f06aba7e85 deleted file mode 100644 index b738ec7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9/e0a53bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/0067aff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/0067aff4c42100141fce95f06aba7e85 deleted file mode 100644 index f7205b8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/0067aff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/107ac4f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/107ac4f8c42100141fce95f06aba7e85 deleted file mode 100644 index 7082a77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/107ac4f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntitySandWorm; -import com.ngb.projectzulu.common.mobs.models.ModelSandWorm; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericIdle; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/215df3f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/215df3f9c42100141fce95f06aba7e85 deleted file mode 100644 index 1da8df1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/215df3f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockWateredDirt; -import com.ngb.projectzulu.common.blocks.ItemWateredDirt; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/31d94dfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/31d94dfac42100141fce95f06aba7e85 deleted file mode 100644 index f0cdb83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/31d94dfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/40e6e500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/40e6e500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e9194ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/40e6e500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/52de74f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/52de74f9c42100141fce95f06aba7e85 deleted file mode 100644 index d08cdf1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/52de74f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/7081cff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/7081cff9c42100141fce95f06aba7e85 deleted file mode 100644 index 3336c5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/7081cff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderUniversalFlowerPot implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - // TODO: Render Universal Pot - renderer.renderStandardBlock(par1Block, par2, par3, par4); - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - IIcon var8 = par1Block.getBlockTextureFromSide(0); - float var9 = (var7 >> 16 & 255) / 255.0F; - float var10 = (var7 >> 8 & 255) / 255.0F; - float var11 = (var7 & 255) / 255.0F; - float var12; - float var14; - - if (EntityRenderer.anaglyphEnable) { - var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; - var9 = var12; - var10 = var13; - var11 = var14; - } - - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); - var12 = 0.1865F; - renderer.renderFaceXPos(par1Block, par2 - 0.5F + var12, par3, par4, var8); - renderer.renderFaceXNeg(par1Block, par2 + 0.5F - var12, par3, par4, var8); - renderer.renderFaceZPos(par1Block, par2, par3, par4 - 0.5F + var12, var8); - renderer.renderFaceZNeg(par1Block, par2, par3, par4 + 0.5F - var12, var8); - renderer.renderFaceYNeg(Blocks.dirt, par2, par3 - 0.35F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - renderer.renderFaceYPos(Blocks.dirt, par2, par3 - 0.5F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/712c04f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/712c04f7c42100141fce95f06aba7e85 deleted file mode 100644 index 703bcaf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/712c04f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.BlockTombstone; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/80f13b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/80f13b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5feb479..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/80f13b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.blocks.util.StringHelper; -import projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90dbc5a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90dbc5a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fb973e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/90dbc5a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityLizardSpit; -import projectzulu.common.mobs.renders.RenderLizardSpit; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/a04622f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/a04622f8c42100141fce95f06aba7e85 deleted file mode 100644 index e7a552d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/a04622f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public interface Blueprint { - - /** - * - * @param pieceLoc X,Y,Z Coordinate of Piece within Cell - * @param cellSize - * @param maxHeight - * @param xIndex - * @param zIndex - * @param random - * @param cellIndexDirection - * @return - */ - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection); - - /** - * Used to Search Architect list for a specific Building Type - * - * Type insensitive. Should be unique. - */ - public abstract String getIdentifier(); - - public abstract int getWeight(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/a1f822fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/a1f822fac42100141fce95f06aba7e85 deleted file mode 100644 index d50a2a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/a1f822fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,93 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelVultureHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer HEADROT; - - - public ModelVultureHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("NECKROT1.neck1", 8, 10); - setTextureOffset("NECKROT2.neck2", 8, 10); - setTextureOffset("NECKROT3.neck3", 8, 10); - setTextureOffset("HEADROT.mouthbot", 0, 25); - setTextureOffset("HEADROT.mouthtal", 6, 25); - setTextureOffset("HEADROT.mouthtop", 0, 21); - setTextureOffset("HEADROT.head", 0, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F, 24.5F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, 0F, 1F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -0.5F, -2F, -0.5F, 1, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("mouthbot", -0.5F, 0.5F, -4F, 1, 1, 2); - HEADROT.addBox("mouthtal", -1F, 0.5F, -5F, 2, 2, 1); - HEADROT.addBox("mouthtop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - NECKROT3.addChild(HEADROT); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - BODYROT.addChild(NECKROT1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); - break; - - default: - NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b00be5f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b00be5f6c42100141fce95f06aba7e85 deleted file mode 100644 index 0a79765..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/b00be5f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,60 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/c1e20ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/c1e20ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 2a28b51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/c1e20ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0f8469fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0f8469fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 37a69c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/90/e0f8469fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,159 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/005c710aefac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/005c710aefac0014196dc3517d78505a new file mode 100644 index 0000000..557a88f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/005c710aefac0014196dc3517d78505a @@ -0,0 +1,287 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelDeer extends ModelBase + { + float heightToRaise = 5f; + float renderScale = 1.3f; + + //fields + ModelRenderer top4hornRight; + ModelRenderer top4hornLeft; + ModelRenderer top3hornRight; + ModelRenderer top3hornLeft; + ModelRenderer top1hornRight; + ModelRenderer top1hornLeft; + ModelRenderer HEADROT; + ModelRenderer hornLeft; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer neck; + ModelRenderer BODYROT; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer tail; + ModelRenderer top2hornLeft; + ModelRenderer hornRight; + ModelRenderer top2hornRight; + + public ModelDeer() + { + textureWidth = 64; + textureHeight = 64; + + HEADROT = new ModelRenderer(this, 1, 19); + HEADROT.addBox(-1.5F, -6F, -7F, 5, 4, 7); + HEADROT.setRotationPoint(-2F, 4F - heightToRaise , -6F); + HEADROT.setTextureSize(64, 64); + HEADROT.mirror = true; + setRotation(HEADROT, 0.5230717F, 0F, 0F); + + earLeft = new ModelRenderer(this, 43, 33); + earLeft.addBox(0F, 1F, 0F, 1, 3, 1); + //earLeft.setRotationPoint(0F, 0.5F, -9F); + earLeft.setRotationPoint(2F, -3.5F, -2.0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, -2.199115F); + HEADROT.addChild(earLeft); + + earRight = new ModelRenderer(this, 50, 33); + earRight.addBox(-1F, 1F, 0F, 1, 3, 1); + //earRight.setRotationPoint(-2F, 0.5F, -9F); + earRight.setRotationPoint(-0.5F, -3.5F, -2.0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, 2.199115F); + HEADROT.addChild(earRight); + + hornLeft = new ModelRenderer(this, 8, 5); + hornLeft.addBox(0F, -3F, 0F, 1, 5, 1); + //hornLeft.setRotationPoint(0F, -3F, -9F); + hornLeft.setRotationPoint(2F, -8F, -2F); + hornLeft.setTextureSize(64, 64); + hornLeft.mirror = true; + setRotation(hornLeft, -0.5410521F, 0.1396263F, 0F); + HEADROT.addChild(hornLeft); + + hornRight = new ModelRenderer(this, 2, 5); + hornRight.addBox(-1F, -3F, 0F, 1, 5, 1); + //hornRight.setRotationPoint(-2F, -3F, -9F); + hornRight.setRotationPoint(0F, -8F, -2F); + hornRight.setTextureSize(64, 64); + hornRight.mirror = true; + setRotation(hornRight, -0.5410521F, -0.1396263F, 0F); + HEADROT.addChild(hornRight); + + top2hornLeft = new ModelRenderer(this, 21, 5); + top2hornLeft.addBox(0F, -3F, 0F, 1, 4, 1); + //top2hornLeft.setRotationPoint(0.3F, -5.5F, -8F); + top2hornLeft.setRotationPoint(0.3F, -3.5F, 0F); + top2hornLeft.setTextureSize(64, 64); + top2hornLeft.mirror = true; + setRotation(top2hornLeft, 0.6372665F, 0.0349066F, 0.0523599F); + hornLeft.addChild(top2hornLeft); + + top2hornRight = new ModelRenderer(this, 15, 5); + top2hornRight.addBox(-1F, -3F, 0F, 1, 4, 1); + //top2hornRight.setRotationPoint(-2.3F, -5.5F, -8F); + top2hornRight.setRotationPoint(0F, -3.5F, 0F); + top2hornRight.setTextureSize(64, 64); + top2hornRight.mirror = true; + setRotation(top2hornRight, 0.6372665F, -0.0349066F, -0.0523599F); + hornRight.addChild(top2hornRight); + + top1hornRight = new ModelRenderer(this, 41, 5); + top1hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top1hornRight.setRotationPoint(-2.4F, -7.5F, -8F); + top1hornRight.setRotationPoint(-0.4F, -2.0F, -0F); + top1hornRight.setTextureSize(64, 64); + top1hornRight.mirror = true; + setRotation(top1hornRight, 1.047198F, 0.1047198F, 0F); + top2hornRight.addChild(top1hornRight); + + top1hornLeft = new ModelRenderer(this, 41, 10); + top1hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top1hornLeft.setRotationPoint(0.5F, -7.5F, -8F); + top1hornLeft.setRotationPoint(0.5F, -2.0F, -0F); + top1hornLeft.setTextureSize(64, 64); + top1hornLeft.mirror = true; + setRotation(top1hornLeft, 1.047198F, -0.1047198F, 0F); + top2hornLeft.addChild(top1hornLeft); + + top3hornRight = new ModelRenderer(this, 34, 5); + top3hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top3hornRight.setRotationPoint(-2.2F, -5F, -8F); + top3hornRight.setRotationPoint(-0.2F, -2.0F, 0F); + top3hornRight.setTextureSize(64, 64); + top3hornRight.mirror = true; + setRotation(top3hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top3hornRight); + + top3hornLeft = new ModelRenderer(this, 34, 10); + top3hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top3hornLeft.setRotationPoint(0.2F, -5F, -8F); + top3hornLeft.setRotationPoint(0.2F, -2.0F, 0F); + top3hornLeft.setTextureSize(64, 64); + top3hornLeft.mirror = true; + setRotation(top3hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top3hornLeft); + + top4hornRight = new ModelRenderer(this, 28, 5); + top4hornRight.addBox(-1F, -3F, 0F, 1, 2, 1); + //top4hornRight.setRotationPoint(-2F, -2F, -8F); + top4hornRight.setRotationPoint(-0F, 1.5F, 1.5F); + top4hornRight.setTextureSize(64, 64); + top4hornRight.mirror = true; + setRotation(top4hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top4hornRight); + + top4hornLeft = new ModelRenderer(this, 28, 9); + top4hornLeft.addBox(0F, -3F, 0F, 1, 2, 1); + //top4hornLeft.setRotationPoint(0F, -2F, -8F); + top4hornLeft.setRotationPoint(0F, 1.5F, 1.5F); + top4hornLeft.setTextureSize(64, 64); + top4hornLeft.mirror = true; + setRotation(top4hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top4hornLeft); + + neck = new ModelRenderer(this, 28, 21); + neck.addBox(0F, -2F, -2F, 4, 3, 8); + neck.setRotationPoint(-3F, 2F - heightToRaise, -8F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, -0.9294653F, 0F, 0F); + BODYROT = new ModelRenderer(this, 28, 41); + BODYROT.addBox(-4F, -8F, -5F, 8, 15, 6); + BODYROT.setRotationPoint(-1F, 6F - heightToRaise, 1F); + BODYROT.setTextureSize(64, 64); + BODYROT.mirror = true; + setRotation(BODYROT, 1.570796F, 0F, 0F); + leg1 = new ModelRenderer(this, 0, 32); + leg1.addBox(-1F, 0F, -1F, 3, 10, 3); + leg1.setRotationPoint(-4F, 11F - heightToRaise, 6F); + leg1.setTextureSize(64, 64); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 13, 32); + leg2.addBox(-1F, 0F, -1F, 3, 10, 3); + leg2.setRotationPoint(1F, 11F - heightToRaise, 6F); + leg2.setTextureSize(64, 64); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 13, 49); + leg3.addBox(-2F, 0F, -1F, 3, 10, 3); + leg3.setRotationPoint(-3F, 11F - heightToRaise, -6F); + leg3.setTextureSize(64, 64); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 0, 49); + leg4.addBox(-1F, 0F, -1F, 3, 10, 3); + leg4.setRotationPoint(1F, 11F - heightToRaise, -6F); + leg4.setTextureSize(64, 64); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + tail = new ModelRenderer(this, 28, 34); + tail.addBox(-1F, 0F, 0F, 2, 1, 3); + tail.setRotationPoint(-1F, 5.5F - heightToRaise, 7F); + tail.setTextureSize(64, 64); + tail.mirror = true; + setRotation(tail, -0.4506874F, 0F, 0F); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //top4hornRight.render(f5); + //top4hornLeft.render(f5); + //top3hornRight.render(f5); + //top3hornLeft.render(f5); + //top2hornLeft.render(f5); + //top2hornRight.render(f5); + //top1hornRight.render(f5); + //top1hornLeft.render(f5); + //hornLeft.render(f5); + //hornRight.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Constant Animation Rotations */ + leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + + /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math + .log(par3 + 1))); + + earLeft.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1))); + earRight.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1)));*/ + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +45) * (float) (Math.PI / 180f); + HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +45) * (float) (Math.PI / 180f); + + } + + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/30d5c5f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/30d5c5f4c42100141fce95f06aba7e85 deleted file mode 100644 index 85d4b37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/30d5c5f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/31c316e8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/31c316e8c42100141fce95f06aba7e85 deleted file mode 100644 index f390ed8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/31c316e8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,360 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - - //vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - - if (movingobjectposition != null) - { - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); - vec31 = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/41b077ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/41b077ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a272393..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/41b077ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCemetary; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/50454da0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/50454da0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 204697b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/50454da0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCreeperBlossom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CreeperBlossomDeclaration extends BlockDeclaration { - - public CreeperBlossomDeclaration() { - super("CreeperBlossom"); - } - - @Override - protected boolean createBlock() { - BlockList.creeperBlossom = Optional.of(new BlockCreeperBlossom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.creeperBlossom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/50542cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/50542cf4c42100141fce95f06aba7e85 deleted file mode 100644 index e9e0aa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/50542cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,66 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/809e30f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/809e30f8c42100141fce95f06aba7e85 deleted file mode 100644 index ff1e27a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/809e30f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import net.minecraft.util.WeightedRandom; - -public class EntityEntry extends WeightedRandom.Item { - - public final String entityname; - - public EntityEntry(String entityname, int spawnWeight) { - super(spawnWeight); - if (entityname == null || entityname.trim() == "") { - throw new IllegalArgumentException("Entity Name Cannot be " + entityname == null ? "null" : "blank"); - } - this.entityname = entityname.trim(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90c7e100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90c7e100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a8da8c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90c7e100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,103 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90e1022e2f2000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90e1022e2f2000141dbfc2e92eb0e949 deleted file mode 100644 index abcea27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90e1022e2f2000141dbfc2e92eb0e949 +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.examplemod; - -import net.minecraft.init.Blocks; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulMod1.MODID, version = SoulMod1.VERSION) -public class SoulMod1 -{ - public static final String MODID = "examplemod"; - public static final String VERSION = "1.0"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - // some example code - System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90ebefe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90ebefe5c42100141fce95f06aba7e85 deleted file mode 100644 index 7740f36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/90ebefe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDigspeed extends SubItemPotionHalfPower { - - public SubItemPotionDigspeed(Item itemID, int subID) { - super(itemID, subID, "Haste"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a0ad85f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a0ad85f6c42100141fce95f06aba7e85 deleted file mode 100644 index 71d3a24..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a0ad85f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a0cb4f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a0cb4f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a5cdba6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a0cb4f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,159 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a119f1f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a119f1f6c42100141fce95f06aba7e85 deleted file mode 100644 index e482bb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a119f1f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a11c1ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a11c1ee5c42100141fce95f06aba7e85 deleted file mode 100644 index 8211f0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a11c1ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,105 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a1e455f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a1e455f9c42100141fce95f06aba7e85 deleted file mode 100644 index 2f6ebe5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/91/a1e455f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0035c9f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0035c9f8c42100141fce95f06aba7e85 deleted file mode 100644 index 54cce7d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0035c9f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityPenguin; -import com.ngb.projectzulu.common.mobs.models.ModelPenguin; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PenguinDeclaration extends SpawnableDeclaration { - - public PenguinDeclaration() { - super("Penguin", 14, EntityPenguin.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (22 << 16) + (16 << 8) + 13; - eggColor2 = (235 << 16) + (235 << 8) + 235; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0158d0a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0158d0a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1133821..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/0158d0a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -/** - * Terrain Feature that is Restricted by Biome - */ -public abstract class BiomeFeature extends BaseFeature { - - /** List of Biome Package Names that this Feature can Spawn in */ - protected ArrayList biomesToSpawn = new ArrayList(); - - public BiomeFeature(String featureName, Size size) { - super(featureName, size); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - return biomesToSpawn.contains(getBiomePackageName(world.getBiomeGenForCoords(genBlockCoords.posX, - genBlockCoords.posZ))); - } - return false; - } - - protected abstract Collection getDefaultBiomeList(); - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - Collection defaultBiomesToSpawn = getDefaultBiomeList(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - if (config.getFeatureProperty(this, "GeneratingBiomes", - getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i]), - defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName)).getBoolean(false)) { - biomesToSpawn.add(getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i])); - } - } - } - - private String getBiomePackageName(BiomeGenBase biome) { - return biome.getClass().getName() + "." + biome.biomeName; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/10e2e700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/10e2e700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a6d1c0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/10e2e700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/11d8b901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/11d8b901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d4ec12f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/11d8b901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,141 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/305c94649a22001414aab7e331350948 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/305c94649a22001414aab7e331350948 deleted file mode 100644 index c6e53bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/305c94649a22001414aab7e331350948 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityYellowFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class YellowFinchDeclaration extends SpawnableDeclaration { - - public YellowFinchDeclaration() { - super("Yellow Finch", 22, EntityYellowFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/308919f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/308919f7c42100141fce95f06aba7e85 deleted file mode 100644 index 1ca0885..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/308919f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeLeaves; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/41ec849fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/41ec849fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8917d74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/41ec849fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,143 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/60767b9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/60767b9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 25a049d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/60767b9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,24 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionCleansing extends PotionZulu { - - public PotionCleansing(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(1, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - super.performEffect(effectedEntity, par2); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/704211fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/704211fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 851af3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/704211fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,297 +0,0 @@ -package com.ngb.projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/71a734f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/71a734f6c42100141fce95f06aba7e85 deleted file mode 100644 index 1ed1b2e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/71a734f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/80c4e6ecbeab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/80c4e6ecbeab00141ee9bf3050c1025b new file mode 100644 index 0000000..e553476 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/80c4e6ecbeab00141ee9bf3050c1025b @@ -0,0 +1,292 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(10) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/81032ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/81032ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 97fffc4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/81032ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/90d62ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/90d62ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3c3394a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/90d62ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.effects; - -public class PotionThorns extends PotionZulu { - - public PotionThorns(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/b2c5a9e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/b2c5a9e6c42100141fce95f06aba7e85 deleted file mode 100644 index 5ac5964..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/b2c5a9e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,107 +0,0 @@ -//package projectzulu.experimental; -// -//import java.util.List; -//import java.util.Random; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.creativetab.CreativeTabs; -//import net.minecraft.item.ItemStack; -//import projectzulu.common.core.DefaultProps; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -// -//public class BlockHoloPalmTree extends Block{ -// -// public BlockHoloPalmTree(int par1, int par2){ -// super(par1, Material.wood); -// -// this.setTickRandomly(true); -// -// this.setCreativeTab(CreativeTabs.tabBlock); -// } -// -// //TODO Commented -//// public int getIcon(int par1, int par2) -//// { -//// switch (par2) { -//// case 0: -//// return 17; -//// case 1: -//// return 19; -//// case 2: -//// return 18; -//// default: -//// return 17; -//// } -//// } -// -// public int damageDropped(int par1) -// { -// return par1; -// } -// -// //This may be neccesary cause otherwise Install will fail on server? -// @SideOnly(Side.CLIENT) -// public String getTextureFile() -// { -// return DefaultProps.blockSpriteSheet; -// } -// -// public int idDropped(int par1, Random par2Random, int par3) -// { -// switch(par1) -// { -// case 0: -// return this.blockID; -// case 1: -// return this.blockID; -// default: -// return this.blockID; -// } -// } -// -// -// public int quantityDropped(Random par1Random) -// { -// return par1Random.nextInt(2) + 1; -// } -// -// @SideOnly(Side.CLIENT) -// public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) -// { -// for (int var4 = 0; var4 < 11; ++var4) -// { -// par3List.add(new ItemStack(par1, 1, var4)); -// } -// } -// -// -// @SideOnly(Side.CLIENT) -// /** -// * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -// */ -// public int getRenderBlockPass() -// { -// return 0; -// } -// -// /** -// * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -// * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -// */ -// public boolean isOpaqueCube() -// { -// return false; -// } -// -// /** -// * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -// */ -// public boolean renderAsNormalBlock() -// { -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/f0749df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/f0749df9c42100141fce95f06aba7e85 deleted file mode 100644 index 3fc009c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/92/f0749df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/20b84de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/20b84de5c42100141fce95f06aba7e85 deleted file mode 100644 index 2eca65e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/20b84de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/2141c7fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/2141c7fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 150d09f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/2141c7fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/30ca35f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/30ca35f4c42100141fce95f06aba7e85 deleted file mode 100644 index dc670d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/30ca35f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectCemetary; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/4253e4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/4253e4f7c42100141fce95f06aba7e85 deleted file mode 100644 index 42e7bd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/4253e4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,107 +0,0 @@ -//package projectzulu.experimental; -// -//import java.util.List; -//import java.util.Random; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.creativetab.CreativeTabs; -//import net.minecraft.item.ItemStack; -//import com.ngb.projectzulu.common.core.DefaultProps; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -// -//public class BlockHoloPalmTree extends Block{ -// -// public BlockHoloPalmTree(int par1, int par2){ -// super(par1, Material.wood); -// -// this.setTickRandomly(true); -// -// this.setCreativeTab(CreativeTabs.tabBlock); -// } -// -// //TODO Commented -//// public int getIcon(int par1, int par2) -//// { -//// switch (par2) { -//// case 0: -//// return 17; -//// case 1: -//// return 19; -//// case 2: -//// return 18; -//// default: -//// return 17; -//// } -//// } -// -// public int damageDropped(int par1) -// { -// return par1; -// } -// -// //This may be neccesary cause otherwise Install will fail on server? -// @SideOnly(Side.CLIENT) -// public String getTextureFile() -// { -// return DefaultProps.blockSpriteSheet; -// } -// -// public int idDropped(int par1, Random par2Random, int par3) -// { -// switch(par1) -// { -// case 0: -// return this.blockID; -// case 1: -// return this.blockID; -// default: -// return this.blockID; -// } -// } -// -// -// public int quantityDropped(Random par1Random) -// { -// return par1Random.nextInt(2) + 1; -// } -// -// @SideOnly(Side.CLIENT) -// public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) -// { -// for (int var4 = 0; var4 < 11; ++var4) -// { -// par3List.add(new ItemStack(par1, 1, var4)); -// } -// } -// -// -// @SideOnly(Side.CLIENT) -// /** -// * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -// */ -// public int getRenderBlockPass() -// { -// return 0; -// } -// -// /** -// * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -// * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -// */ -// public boolean isOpaqueCube() -// { -// return false; -// } -// -// /** -// * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -// */ -// public boolean renderAsNormalBlock() -// { -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/70aa61e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/70aa61e4c42100141fce95f06aba7e85 deleted file mode 100644 index 4346f18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/70aa61e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCampFire extends ItemBlock { - - public ItemCampFire(Block block) { - super(block); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Block.getBlockFromItem(this).getIcon(2, par1); - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return "tile." - + BlockCampfire.Type.getTypeByMeta(itemstack.getItemDamage()).displayName().toLowerCase() - .replaceAll("\\s", ""); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/a04b2ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/a04b2ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index df54433..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/a04b2ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,138 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelCrocodileHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer MOUTHTOPROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - - public ModelCrocodileHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - CENTERROT.addChild(MOUTHTOPROT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - CENTERROT.addChild(MOUTHBOTROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d0aeb49fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d0aeb49fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f24f6e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/d0aeb49fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,24 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f03b63e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f03b63e5c42100141fce95f06aba7e85 deleted file mode 100644 index dfda6f6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f03b63e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityElephant; -import projectzulu.common.mobs.models.ModelElephant; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f0c29cf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f0c29cf7c42100141fce95f06aba7e85 deleted file mode 100644 index 21b5cd3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f0c29cf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f1173c2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f1173c2bc52100141fce95f06aba7e85 deleted file mode 100644 index 598e853..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f1173c2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.blocks.itemblockdeclarations.StructurePlacerDeclaration; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_World extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.WorldModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new StructurePlacerDeclaration()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new PyramidFeature(), new LabyrinthFeature(), new CemetaryFeature(), - new OasisFeature(), new CathedralFeature()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f165dca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f165dca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6947281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/93/f165dca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandPlaceBlock extends CommandBase { - @Override - public String getCommandName() { - return "placeblock"; - } - - /** - * Return the required permission level for this command. - */ - @Override - public int getRequiredPermissionLevel() { - return 2; - } - - /** - * Command stringArgs : /placeblock [targetPlayer] [blockID] Command stringArgs == 2: /placeblock @p - * blockID Command stringArgs == 3: /placeblock @p blockID Command stringArgs == 5: /placeblock @p blockID - * Command stringArgs == 6: /placeblock @p blockID - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.placeblock.usage", new Object[0]); - } else { - int targetX = 0; - int targetY = 0; - int targetZ = 0; - int blockMeta = 0; - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - Block blockToPlace = Block.getBlockFromName(stringArgs[1]); - if (blockToPlace == null) { - throw new WrongUsageException("commands.placeblock.noblock", new Object[0]); - } - - if (stringArgs.length == 3 || stringArgs.length == 6) { - blockMeta = parseIntBounded(commandSender, stringArgs[2], 0, 4095); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - targetX = (int) targetPlayer.posX; - targetY = (int) targetPlayer.posY; - targetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - targetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - targetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, - 0); - targetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - targetPlayer.worldObj.setBlock(targetX, targetY, targetZ, blockToPlace, blockMeta, 3); - } - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spawnentity.usage"; - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/0092fef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/0092fef7c42100141fce95f06aba7e85 deleted file mode 100644 index fdaff19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/0092fef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public abstract class BPOasisEdge implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - List flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/014e4bf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/014e4bf4c42100141fce95f06aba7e85 deleted file mode 100644 index 3a27920..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/014e4bf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,107 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/10b198a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/10b198a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0650f49..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/10b198a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityGenericCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityGenericCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, - //this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - Vec3.createVectorHelper((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/114d93f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/114d93f7c42100141fce95f06aba7e85 deleted file mode 100644 index 86f1e45..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/114d93f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemCoconutShell; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/30e887a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/30e887a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43fb0bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/30e887a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,103 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/50a53ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/50a53ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 43fb0bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/50a53ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,103 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/70ed3ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/70ed3ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 298643b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/70ed3ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/8008c1e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/8008c1e4c42100141fce95f06aba7e85 deleted file mode 100644 index b3f016f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/8008c1e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.nbt.NBTBase; - -import org.lwjgl.util.Point; - -public class GUIEditNodeTextField extends GuiTextField { - private NBTNode selectedNode = null; - - public GUIEditNodeTextField(FontRenderer par1FontRenderer, int xPos, int yPos, int width, int height) { - super(par1FontRenderer, xPos, yPos, width, height); - } - - public GUIEditNodeTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(30000); - } - - public GUIEditNodeTextField(GUIEditNodeTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - - this.selectedNode = oldTextFields.selectedNode; - setText(oldTextFields.getText()); - setupTextField(30000); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } - - public boolean isEnabled() { - return selectedNode != null; - } - - public void setSelectedNode(NBTNode selectedNode) { - this.selectedNode = selectedNode; - setText(selectedNode.getValue()); - } - - public boolean saveAndClear(NBTTree nodeTree) { - NBTBase newNBT = selectedNode.createNBTFromString(getText()); - if (newNBT != null) { - if (selectedNode.getParent() != null) { - selectedNode.getParent().replaceChild(selectedNode, - new NBTNode(newNBT, selectedNode.getParent(), selectedNode.getTagName())); - } else { - // Properties name is arbitrary, the top compound in entity NBT is/was typically called properties - selectedNode = new NBTNode(newNBT, null, "Properties"); - } - clear(); - return true; - } - return false; - } - - public void clear() { - selectedNode = null; - setText(""); - } - - @Override - public boolean textboxKeyTyped(char keyChar, int keyID) { - if (selectedNode != null) { - return super.textboxKeyTyped(keyChar, keyID); - } - return false; - } - - @Override - public void mouseClicked(int par1, int par2, int par3) { - if (selectedNode != null) { - super.mouseClicked(par1, par2, par3); - } - } - - @Override - public void drawTextBox() { - super.drawTextBox(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/80fd9ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/80fd9ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 561ba75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/80fd9ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeDiagonal extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeDiagonal(boolean inverted) { - super(inverted); - } - - /** - * BPOasisEdgeDiagonal G GG GGG - */ - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ - (!inverted ? piecePos.posX : cellSize - 1 - piecePos.posX) >= 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "diagonal"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/91f2659fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/91f2659fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 464644a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/91f2659fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/d05e4b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/d05e4b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c80f79f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/d05e4b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,190 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f0883e2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f0883e2bc52100141fce95f06aba7e85 deleted file mode 100644 index f86aa0d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f0883e2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f1db75a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f1db75a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7a0443a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f1db75a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f2d1d2f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f2d1d2f8c42100141fce95f06aba7e85 deleted file mode 100644 index 09785c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/94/f2d1d2f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseGrey; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/00a4f0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/00a4f0e4c42100141fce95f06aba7e85 deleted file mode 100644 index 3dfa0d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/00a4f0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/205df3f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/205df3f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5897a55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/205df3f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/301af9f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/301af9f4c42100141fce95f06aba7e85 deleted file mode 100644 index c5e1d50..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/301af9f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,52 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHeal2 extends PotionZulu { - - public PotionHeal2(int par1, boolean par2) { - super(par1, par2, 16262179); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - par1EntityLiving.heal(amplifier * 3); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/309f26fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/309f26fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0cf6193..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/309f26fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/51acacf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/51acacf8c42100141fce95f06aba7e85 deleted file mode 100644 index bb689a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/51acacf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,159 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/51eb75f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/51eb75f5c42100141fce95f06aba7e85 deleted file mode 100644 index 09785c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/51eb75f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseGrey; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/8119d69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/8119d69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e3884bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/8119d69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/c24d82a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/c24d82a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5722f80..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/c24d82a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/e070f6c1652300141cbf9363b5b13b15 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/e070f6c1652300141cbf9363b5b13b15 deleted file mode 100644 index affce35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/e070f6c1652300141cbf9363b5b13b15 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration(), new YellowFinchDeclaration(),); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/f0b366f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/f0b366f6c42100141fce95f06aba7e85 deleted file mode 100644 index f4f9d36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/f0b366f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/f0c7f03e5f2300141615d74fdd8749f5 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/f0c7f03e5f2300141615d74fdd8749f5 deleted file mode 100644 index ed043ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/95/f0c7f03e5f2300141615d74fdd8749f5 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/100ecea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/100ecea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9322eca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/100ecea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; - -public interface PZPacket { - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to encode into - */ - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to decode from - */ - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); - - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/11e9ebe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/11e9ebe4c42100141fce95f06aba7e85 deleted file mode 100644 index 94bf039..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/11e9ebe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/2041c7fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/2041c7fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9aa6009..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/2041c7fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/21b84de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/21b84de5c42100141fce95f06aba7e85 deleted file mode 100644 index c041098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/21b84de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/22acb201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/22acb201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c46390..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/22acb201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/50c510f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/50c510f9c42100141fce95f06aba7e85 deleted file mode 100644 index 975f663..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/50c510f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/619909f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/619909f9c42100141fce95f06aba7e85 deleted file mode 100644 index 1e5b104..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/619909f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/71b1d79dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/71b1d79dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 298643b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/71b1d79dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/81d862f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/81d862f5c42100141fce95f06aba7e85 deleted file mode 100644 index cc26b48..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/81d862f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRhino; -import com.ngb.projectzulu.common.mobs.models.ModelRhino; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/9115f4f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/9115f4f8c42100141fce95f06aba7e85 deleted file mode 100644 index e6d0ca7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/9115f4f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/916095a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/916095a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 799993f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/916095a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,334 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/924f9b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/924f9b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ebac1d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/924f9b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/92b1c1ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/92b1c1ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f12e58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/92b1c1ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/c0c9a6e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/c0c9a6e4c42100141fce95f06aba7e85 deleted file mode 100644 index 7839452..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/c0c9a6e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d024d9f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d024d9f6c42100141fce95f06aba7e85 deleted file mode 100644 index 415f794..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d024d9f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d115189ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d115189ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 72744fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d115189ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,163 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.terrain.TerrainFeature; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d2c0a2e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d2c0a2e6c42100141fce95f06aba7e85 deleted file mode 100644 index b4c94d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/d2c0a2e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.world2; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; - -public class CellHelper { - - /** - * Returns the Cardinal Rotation of Cell if Rotated from North along CellIndexDirection NorthWall(North, Unaltered), - * WestWall(West),EastWall(East),SouthWall(South) - * - * @param piecePos Current Piece Position - * @param cellSize Size of Cell - * @param cellIndexDirection Direction Cell should be facing - * @return - */ - public static ChunkCoordinates rotateCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWall) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posZ, piecePos.posY, piecePos.posX); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return new ChunkCoordinates(piecePos.posZ, piecePos.posY, cellSize - 1 - piecePos.posX); - } - return piecePos; - } - - /** - * Similar to {@link CellHelper#rotateCellTo} but instead of rotating it mirrors along the X and Z axes. - * - * NorthWest represents the base configuration which is unaltered. - * - * SouthWest maintains X axis (WEST) but inverted the Z axis for south. - * - * - * @param piecePos - * @param cellSize - * @param cellIndexDirection - * @return - */ - public static ChunkCoordinates mirrorCellTo(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return new ChunkCoordinates(piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, piecePos.posZ); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return new ChunkCoordinates(cellSize - 1 - piecePos.posX, piecePos.posY, cellSize - 1 - piecePos.posZ); - } - return piecePos; - } - - public static boolean isCorner(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } else if (buildCoords.x == cells.length - 1 && (buildCoords.y == 0 || buildCoords.y == cells[0].length - 1)) { - return true; - } - return false; - } - - public static int getSlopeIndex(ChunkCoordinates piecePos, int directionIndex, float slopeSpacing, - BoundaryPair indexBoundary, int highestPoint) { - int distanceFromTop = highestPoint - piecePos.posY; - int corectDirecIndex = Math.min(Math.max(directionIndex, indexBoundary.getLowerLimit()), - indexBoundary.getUpperLimit()); - return (int) (corectDirecIndex / slopeSpacing) - distanceFromTop; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/f0dd40fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/f0dd40fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a70a9b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/f0dd40fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,345 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/f1b008a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/f1b008a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9da4186..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/96/f1b008a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -public class RenderGenericLiving extends RenderLiving implements RenderWrapper { - - public final ResourceLocation livingTexture; - - public RenderGenericLiving(ModelBase modelBase, float shadowSize, ResourceLocation livingTexture) { - super(modelBase, shadowSize); - this.livingTexture = livingTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return livingTexture; - } - - @Override - public Render getRender() { - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30db2b5ac8ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30db2b5ac8ab00141ee9bf3050c1025b new file mode 100644 index 0000000..531c46e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/30db2b5ac8ab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(2) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/42c9dbffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/42c9dbffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 16b6634..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/42c9dbffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockWateredDirt; -import projectzulu.common.blocks.ItemWateredDirt; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/517a73f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/517a73f5c42100141fce95f06aba7e85 deleted file mode 100644 index 0ce1df2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/517a73f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseWhite; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/6000e29fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/6000e29fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1212d27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/6000e29fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,225 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/60ae2501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/60ae2501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3b2fd1d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/60ae2501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,84 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/802897f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/802897f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2b12be2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/802897f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; -//package com.ngb.projectzulu.common.mobs; -// -//import net.minecraft.src.Entity; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.MathHelper; -//import net.minecraft.src.ModelBase; -//import net.minecraft.src.ModelRenderer; -// -//public class ModelZulu extends ModelBase -//{ -// -// public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.render(entity, f, f1, f2, f3, f4, f5); -// setRotationAngles(f, f1, f2, f3, f4, f5); -// if(this.isChild){ -// HEADROT.render(f5); -// BODYROT.render(f5); -// } -// -// } -// public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.setRotationAngles(f, f1, f2, f3, f4, f5); -// } -// -// -// -// @Override -// public void setLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4) { -// super.setLivingAnimations(par1EntityLiving, par2, par3, par4); -// } -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/9063689fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/9063689fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9924c4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/9063689fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,12 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.util.ResourceLocation; - -public class RenderMimic extends RenderGenericLiving { - public static final ResourceLocation normalChest = new ResourceLocation("textures/entity/chest/normal.png"); - - public RenderMimic(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/906620e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/906620e5c42100141fce95f06aba7e85 deleted file mode 100644 index ecaf279..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/906620e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/915253e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/915253e4c42100141fce95f06aba7e85 deleted file mode 100644 index f53b3e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/915253e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemScale; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/91652ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/91652ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 581f7d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/91652ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionIncendiary extends PotionZulu { - - public PotionIncendiary(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(1, 2); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int par2) { - super.performEffect(par1EntityLiving, par2); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int par3, double par4) { - par2EntityLiving.setFire((int) (2 + 1.5 * par3)); - super.affectEntity(par1EntityLiving, par2EntityLiving, par3, par4); - } - - @Override - public boolean isInstant() { - return true; - } - - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/917f84e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/917f84e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4c72756..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/917f84e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,277 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelArmadillo extends ModelBase { - public ModelRenderer WHOLE; - public ModelRenderer HEADPIECE; - public ModelRenderer REARRTR1; - public ModelRenderer REARRTR2; - public ModelRenderer REARRTR3; - - public ModelRenderer leg1; - public ModelRenderer leg2; - public ModelRenderer leg3; - public ModelRenderer leg4; - public ModelRenderer body2; - public ModelRenderer tail; - public ModelRenderer body1; - public ModelRenderer body3; - public ModelRenderer body4; - - public ModelRenderer chin; - public ModelRenderer head; - public ModelRenderer nose; - - public ModelArmadillo() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("WHOLE.dltfold0", 0, 0); - - WHOLE = new ModelRenderer(this, "WHOLE"); - WHOLE.setRotationPoint(0F, 18F, 0F); - // WHOLE.setRotationPoint(0F, 0F, 0F); - WHOLE.mirror = true; - setRotation(WHOLE, 0F, 0F, 0F); - - REARRTR1 = new ModelRenderer(this, "REARRTR1"); - WHOLE.addChild(REARRTR1); - REARRTR1.setRotationPoint(0F, -3F, -2F); - setRotation(REARRTR1, 0F, 0F, 0F); - REARRTR1.mirror = true; - body2 = new ModelRenderer(this, 32, 0); - body2.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR1.addChild(body2); - body2.setRotationPoint(0F, 3F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - REARRTR2 = new ModelRenderer(this, "REARRTR2"); - REARRTR1.addChild(REARRTR2); - REARRTR2.setRotationPoint(0F, -1F, 4F); - setRotation(REARRTR2, 0F, 0F, 0F); - REARRTR2.mirror = true; - body3 = new ModelRenderer(this, 32, 0); - body3.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR2.addChild(body3); - body3.setRotationPoint(0F, 4F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - REARRTR3 = new ModelRenderer(this, "REARRTR3"); - REARRTR2.addChild(REARRTR3); - REARRTR3.setRotationPoint(0F, 0F, 4F); - setRotation(REARRTR3, 0F, 0F, 0F); - REARRTR3.mirror = true; - tail = new ModelRenderer(this, 8, 14); - tail.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); - REARRTR3.addChild(tail); - tail.setRotationPoint(0F, 6F, 4F); - tail.setTextureSize(64, 32); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 32, 0); - body4.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR3.addChild(body4); - body4.setRotationPoint(0F, 4F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(REARRTR3); - // dltfold2.addChildModelRenderer(REARRTR2); - // dltfold0.addChildModelRenderer(REARRTR1); - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - WHOLE.addChild(HEADPIECE); - HEADPIECE.setRotationPoint(0F, 1F, -6F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - nose = new ModelRenderer(this, 12, 9); - nose.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADPIECE.addChild(nose); - nose.setRotationPoint(0F, 2F, -5F); - nose.setTextureSize(64, 32); - nose.mirror = true; - setRotation(nose, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 0); - head.addBox(-2.5F, -2.5F, -1.5F, 5, 5, 3); - HEADPIECE.addChild(head); - head.setRotationPoint(0F, 0F, -1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - chin = new ModelRenderer(this, 0, 8); - chin.addBox(-1.5F, -1.5F, -2.5F, 3, 3, 3); - HEADPIECE.addChild(chin); - chin.setRotationPoint(0F, 1F, -3F); - chin.setTextureSize(64, 32); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - // dltfold0.addChildModelRenderer(HEADPIECE); - body1 = new ModelRenderer(this, 32, 0); - body1.addBox(-4.5F, -4F, -2F, 9, 8, 4); - WHOLE.addChild(body1); - body1.setRotationPoint(0F, 0F, -4F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 15); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg4); - leg4.setRotationPoint(3F, 4F, 5F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 15); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg3); - leg3.setRotationPoint(-3F, 4F, 5F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 0, 15); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg2); - leg2.setRotationPoint(3F, 4F, -4F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 15); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg1); - leg1.setRotationPoint(-3F, 4F, -4F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // Something Should GO here - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - WHOLE.render(f5); - GL11.glPopMatrix(); - } else { - WHOLE.render(f5); - } - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - EntityArmadillo var5 = (EntityArmadillo) par7Entity; - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateX(+0.05f * 2.0f, 0f, (float) (145 * Math.PI / 180f)); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - // HEADPIECE.rotateAngleX = - // var5.eHEADPIECE.rotateX(-0.05f*animSpeed,0f,(float)(145*Math.PI/180f)); - this.HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateAngleX = Math.min(Math.max(par5, -180), +180) - * (float) (Math.PI / 180f); - this.HEADPIECE.rotateAngleY = var5.eHEADPIECE.rotateAngleY = Math.min(Math.max(par4, -30), +30) - * (float) (Math.PI / 180f); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityArmadillo var5 = (EntityArmadillo) par1EntityLiving; - - if (var5.eWHOLE.isSetup == false) { - var5.eWHOLE.setup(WHOLE); - } - if (var5.eHEADPIECE.isSetup == false) { - var5.eHEADPIECE.setup(HEADPIECE); - } - if (var5.eREARRTR1.isSetup == false) { - var5.eREARRTR1.setup(REARRTR1); - } - if (var5.eREARRTR2.isSetup == false) { - var5.eREARRTR2.setup(REARRTR2); - } - if (var5.eREARRTR3.isSetup == false) { - var5.eREARRTR3.setup(REARRTR3); - } - if (var5.etail.isSetup == false) { - var5.etail.setup(tail); - } - if (var5.eleg3.isSetup == false) { - var5.eleg3.setup(leg3); - } - if (var5.eleg4.isSetup == false) { - var5.eleg4.setup(leg4); - } - - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - float animSpeed = 2.0f; - if (var5.isCharging() == true) { - animSpeed = 5.0f; - /* Make Complete Body Circle */ - if (var5.eWHOLE.rotateAngleX == (float) ((390 + 360) * Math.PI / 180f)) { - var5.eWHOLE.rotateAngleX -= 360 * Math.PI / 180; - } - WHOLE.rotateAngleX = var5.eWHOLE - .rotateX(+0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - } else { - animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(+0.09f * animSpeed, 0f, (float) (390 * Math.PI / 180f)); - } - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(+0.1f, (float) (0 * Math.PI / 180f), (float) (90 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(-0.5f * animSpeed, 2.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(-0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(-0.5f * animSpeed, -4f, 4f); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - float animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(-0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - /* Rotate Face Inward */ - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(-0.1f * animSpeed, (float) (-15 * Math.PI / 180f), - (float) (30 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(+0.5f * animSpeed, 0.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(+0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(+0.5f * animSpeed, -4f, 4f); - - leg1.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg2.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - leg3.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg4.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0c65e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0c65e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0155d5c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/a0c65e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.entity.EntityMaster; - -public class PacketFollowerMasterData implements PZPacket { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/b0ea8ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/b0ea8ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8fcf322..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/b0ea8ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,147 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/d0d9acf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/d0d9acf5c42100141fce95f06aba7e85 deleted file mode 100644 index 8854324..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/d0d9acf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.command.IEntitySelector; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAINearestAttackableTarget extends EntityAITarget{ - EntityLivingBase targetEntity; - Class targetClass; - int targetChance; - private final IEntitySelector entitySelector; - EnumSet setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/e10271f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/e10271f8c42100141fce95f06aba7e85 deleted file mode 100644 index 537c72a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/97/e10271f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionSlowFall extends PotionZulu { - - public PotionSlowFall(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(0, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - amplifier = amplifier > 10 ? 10 : amplifier < 0 ? 0 : amplifier; - if (par1EntityLiving.fallDistance > (10 - amplifier) * 2) { - par1EntityLiving.fallDistance = (10 - amplifier) * 2; - } - par1EntityLiving.motionY = Math.max(par1EntityLiving.motionY, -1.2f + (amplifier + 1f) * (0.1f)); - super.performEffect(par1EntityLiving, amplifier); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 4 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/01105ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/01105ce5c42100141fce95f06aba7e85 deleted file mode 100644 index a27ea4c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/01105ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,70 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPolarBear; -import projectzulu.common.mobs.models.ModelPolarBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/015697f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/015697f5c42100141fce95f06aba7e85 deleted file mode 100644 index 576bac1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/015697f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBlackBear; -import com.ngb.projectzulu.common.mobs.models.ModelBlackBear; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/016ffbf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/016ffbf5c42100141fce95f06aba7e85 deleted file mode 100644 index 5025e37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/016ffbf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/021ea5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/021ea5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 28ba60e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/021ea5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/12819bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/12819bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cbb68ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/12819bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/4083b700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/4083b700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5344d24..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/4083b700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,105 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/611cfee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/611cfee5c42100141fce95f06aba7e85 deleted file mode 100644 index 1f091dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/611cfee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/61fe02e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/61fe02e6c42100141fce95f06aba7e85 deleted file mode 100644 index 54a5075..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/61fe02e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,164 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import projectzulu.common.blocks.FurPeltDeclaration; -import projectzulu.common.blocks.ItemBlockRecipeManager; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import projectzulu.common.blocks.terrain.AloeVeraFeature; -import projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import projectzulu.common.blocks.terrain.NightBloomFeature; -import projectzulu.common.blocks.terrain.PalmTreeFeature; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.PotionEvents; -import projectzulu.common.potion.EventHandleNullPotions; -import projectzulu.common.potion.PZExtraPotionDeclaration; -import projectzulu.common.potion.PZVanillaPotionDeclaration; -import projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/b0737901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/b0737901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index edb9913..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/b0737901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/b20887a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/b20887a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2e12ea9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/98/b20887a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/019f59e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/019f59e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4b7a193..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/019f59e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.models.ModelBlackBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/1018f8f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/1018f8f9c42100141fce95f06aba7e85 deleted file mode 100644 index 1daa149..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/1018f8f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockTumbleweed; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class TumbleweedDeclaration extends BlockDeclaration { - - public TumbleweedDeclaration() { - super("Tumbleweed"); - } - - @Override - protected boolean createBlock() { - BlockList.tumbleweed = Optional.of((new BlockTumbleweed()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tumbleweed.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/10d51ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/10d51ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 7e4971d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/10d51ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,52 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelPenguinHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelPenguinHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 24F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/10fdb8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/10fdb8e5c42100141fce95f06aba7e85 deleted file mode 100644 index f2c90d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/10fdb8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/406207ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/406207ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 88f0be9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/406207ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,439 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/41ad1a2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/41ad1a2bc52100141fce95f06aba7e85 deleted file mode 100644 index 28ccce0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/41ad1a2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/506344fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/506344fac42100141fce95f06aba7e85 deleted file mode 100644 index f566ab1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/506344fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,260 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/700a8417c92100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/700a8417c92100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8a790af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/700a8417c92100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/807338a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/807338a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb38494..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/807338a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import projectzulu.common.potion.subitem.SubItemPotionHarm; -import projectzulu.common.potion.subitem.SubItemPotionHeal; -import projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import projectzulu.common.potion.subitem.SubItemPotionNightVision; -import projectzulu.common.potion.subitem.SubItemPotionPoison; -import projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/812125e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/812125e5c42100141fce95f06aba7e85 deleted file mode 100644 index 2d22fcb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/812125e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/819227e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/819227e5c42100141fce95f06aba7e85 deleted file mode 100644 index cb6b027..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/819227e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/a022bdf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/a022bdf4c42100141fce95f06aba7e85 deleted file mode 100644 index 8067cb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/a022bdf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWeakness extends SubItemPotionHalfPower { - - public SubItemPotionWeakness(Item itemID, int subID) { - super(itemID, subID, "Weakness"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.weakness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/c0d7effdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/c0d7effdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6de97bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/c0d7effdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/c0fd49f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/c0fd49f9c42100141fce95f06aba7e85 deleted file mode 100644 index 7a0214d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/c0fd49f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,321 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d02e78f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d02e78f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1ae436f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d02e78f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,13 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -public class PotionBubbling extends PotionZulu { - - protected PotionBubbling(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - @Override - public boolean isInstant() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0a7e4f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0a7e4f4c42100141fce95f06aba7e85 deleted file mode 100644 index 68e1c16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/d0a7e4f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/e0f1d0e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/e0f1d0e5c42100141fce95f06aba7e85 deleted file mode 100644 index aded3cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/e0f1d0e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingTriple extends TileEntityBrewingBase { - - public TileEntityBrewingTriple() { - brewingItemStacks = new ItemStack[4]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/e2b296e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/e2b296e6c42100141fce95f06aba7e85 deleted file mode 100644 index 8e06422..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/e2b296e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisPool implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta water = new BlockWithMeta(Blocks.water); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return water; - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisPool"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/f0efcdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/f0efcdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 76dee54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/99/f0efcdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EggableDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityMinotaur; -import com.ngb.projectzulu.common.mobs.models.ModelMinotaur; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/01e594f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/01e594f5c42100141fce95f06aba7e85 deleted file mode 100644 index 9e1f045..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/01e594f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityPolarBear; -import com.ngb.projectzulu.common.mobs.models.ModelPolarBear; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/20337ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/20337ee4c42100141fce95f06aba7e85 deleted file mode 100644 index c9359d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/20337ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,204 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityTombstone extends TileEntity { - /* List of Items this Tombstone will Empty Upon Right-Clicking */ - private ArrayList deathItems = new ArrayList(); - public int experience = 0; - private EntityXPOrb xpOrb = null; - - public EntityXPOrb getEntityOrb() { - if (hasDrops()) { - if (xpOrb == null) { - xpOrb = new EntityXPOrb(worldObj, xCoord, yCoord, zCoord, worldObj.rand.nextInt(5) + 1); - } - return xpOrb; - } - return null; - } - - public boolean addDrop(ItemStack itemDrop) { - return deathItems.add(itemDrop); - } - - public boolean hasDrops() { - return !deathItems.isEmpty() || experience > 0; - } - - /* Give items in Tombstone to Player */ - public void giveItemsToPlayer(EntityPlayer player) { - player.addExperience(experience); - experience = 0; - - Iterator unSortIterator = deathItems.iterator(); - boolean itemAdded = true; - while (unSortIterator.hasNext() && itemAdded) { - ItemStack deathItem = unSortIterator.next(); - itemAdded = player.inventory.addItemStackToInventory(deathItem); - if (itemAdded) { - unSortIterator.remove(); - } - } - } - - /** An array of four strings storing the lines of text on the sign. */ - public String[] signText; - public final int maxLines = 7; - public final int maxcharPerLine = 13; - - /** - * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only - * really used when the > < are going to be visible. - */ - public int lineBeingEdited = -1; - private boolean isEditable = true; - - public TileEntityTombstone() { - signText = new String[maxLines]; - for (int i = 0; i < signText.length; i++) { - signText[i] = ""; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - for (int i = 0; i < signText.length; i++) { - if (signText[i].length() > 0) { - tagCompound.setString("Text" + (i + 1), signText[i]); - } - } - tagCompound.setInteger("Experience", experience); - addItemsToCompound(tagCompound, "DeathItems", deathItems); - } - - private void addItemsToCompound(NBTTagCompound tileCompound, String itemTagName, List items) { - NBTTagList itemsTag = new NBTTagList(); - for (ItemStack itemStack : items) { - NBTTagCompound tag = new NBTTagCompound(); - itemStack.writeToNBT(tag); - itemsTag.appendTag(tag); - } - tileCompound.setTag(itemTagName, itemsTag); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - this.isEditable = false; - super.readFromNBT(tagCompound); - for (int i = 0; i < signText.length; ++i) { - this.signText[i] = tagCompound.getString("Text" + (i + 1)); - if (this.signText[i].length() > maxcharPerLine) { - this.signText[i] = this.signText[i].substring(0, maxcharPerLine); - } - } - experience = tagCompound.hasKey("Experience") ? tagCompound.getInteger("Experience") : 0; - deathItems = readItemsFromCompound(tagCompound, "DeathItems"); - } - - public ArrayList readItemsFromCompound(NBTTagCompound tileCompound, String itemTagName) { - ArrayList items = new ArrayList(); - if (tileCompound.hasKey(itemTagName)) { - NBTTagList itemsTag = (NBTTagList) tileCompound.getTag(itemTagName); - for (int i = 0; i < itemsTag.tagCount(); i++) { - ItemStack itemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) itemsTag.getCompoundTagAt(i)); - if (itemStack != null) { - items.add(itemStack); - } - } - } - return items; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - public void setSignString(String inputString) { - String[] words = inputString.split(" "); - int startWord = 0; - for (int currentLine = 0; currentLine < signText.length; currentLine++) { - StringBuilder currentLineText = new StringBuilder(maxcharPerLine); - /* Add Words until Line is full */ - for (int i = startWord; i < words.length; i++) { - String currentWord = getFilteredWord(words[i]); - - if (currentLineText.length() + (currentLineText.length() != 0 ? 1 : 0) + currentWord.length() <= maxcharPerLine) { - if (currentLineText.length() != 0) { - currentLineText.append(" "); - } - currentLineText.append(currentWord); - /* If This is the last line, we want to write the text */ - if (i + 1 >= words.length) { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i + 1; - break; - } - } else { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i; - break; - } - } - } - } - - /** - * Handlers filtering word if it is invalid in some way, such as truncating a word that is too long. - */ - private String getFilteredWord(String word) { - return word.length() > maxcharPerLine ? word.substring(0, maxcharPerLine - 2).concat(".") : word; - } - - @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() { - return 16384.0D; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/20b2c9fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/20b2c9fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1a0d38c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/20b2c9fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,201 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/3116ade5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/3116ade5c42100141fce95f06aba7e85 deleted file mode 100644 index 58633e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/3116ade5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,173 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelRhino extends ModelBase { - float heightToRaise = 9f; - float renderScale = 1.6f; - - ModelRenderer LEG3ROT; - ModelRenderer LEG4ROT; - ModelRenderer LEG2ROT; - ModelRenderer HEADROT; - ModelRenderer LEG1ROT; - ModelRenderer TAILROT; - ModelRenderer BODYROT; - - public ModelRhino() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG3ROT.leg3", 48, 13); - setTextureOffset("LEG3ROT.toe31", 0, 0); - setTextureOffset("LEG3ROT.toe32", 0, 0); - setTextureOffset("LEG3ROT.toe33", 0, 0); - setTextureOffset("LEG4ROT.leg4", 68, 13); - setTextureOffset("LEG4ROT.toe41", 0, 0); - setTextureOffset("LEG4ROT.toe42", 0, 0); - setTextureOffset("LEG4ROT.toe43", 0, 0); - setTextureOffset("LEG2ROT.leg2", 68, 0); - setTextureOffset("LEG2ROT.toe21", 0, 0); - setTextureOffset("LEG2ROT.toe22", 0, 0); - setTextureOffset("LEG2ROT.toe23", 0, 0); - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - setTextureOffset("LEG1ROT.toe11", 0, 0); - setTextureOffset("LEG1ROT.toe12", 0, 0); - setTextureOffset("LEG1ROT.toe13", 0, 0); - setTextureOffset("LEG1ROT.leg1", 48, 0); - setTextureOffset("TAILROT.tail", 0, 25); - setTextureOffset("BODYROT.leg1dec", 20, 25); - setTextureOffset("BODYROT.leg2dec", 20, 25); - setTextureOffset("BODYROT.body", 0, 32); - - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG3ROT.addBox("toe31", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe32", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe33", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG4ROT.addBox("toe41", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe42", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe43", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(4F, 15F - heightToRaise, -5F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2.5F, 1F, -2.5F, 5, 8, 5); - LEG2ROT.addBox("toe21", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe22", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe23", 1.5F, 8F, -3.5F, 1, 1, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 9F - heightToRaise, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-4F, 15F - heightToRaise, -5F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("toe11", -2.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe12", -0.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe13", 1.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("leg1", -2.5F, 1F, -2F, 5, 8, 5); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 9F - heightToRaise, 12F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.5F, -0.5F, 0F, 1, 1, 6); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F - heightToRaise, -8F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("leg1dec", -7F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("leg2dec", 1F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("body", -7F, -7F, 0F, 14, 12, 20); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 6.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(renderScale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - GL11.glPopMatrix(); - } else { - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - HEADROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Constant Animation Rotations */ - LEG1ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - TAILROT.rotateAngleX = (float) (-90 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/40c4e6f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/40c4e6f7c42100141fce95f06aba7e85 deleted file mode 100644 index 7c0367d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/40c4e6f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world2.Direction; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/5010b2a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/5010b2a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d6fbe83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/5010b2a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.util.Random; - -import projectzulu.common.world2.MazeCell; - -import net.minecraft.world.World; - -public class EdgeRandomizer extends Randomizer { - Random random; - int edgeDepth; - - public EdgeRandomizer(World world, int edgeDepth) { - this.random = world.rand; - this.edgeDepth = edgeDepth; - } - - @Override - public void randomize(MazeCell[][] cells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < edgeDepth; k++) { - cells[i][k].rawState = 1; - } - for (int k = cells[0].length - 1; k > cells[0].length - 1 - edgeDepth; k--) { - cells[i][k].rawState = 1; - } - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < edgeDepth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - 1; i > cells.length - 1 - edgeDepth; i--) { - cells[i][k].rawState = 1; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50983d00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50983d00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cf75075..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/50983d00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,367 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/7020fbe3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/7020fbe3c42100141fce95f06aba7e85 deleted file mode 100644 index c9f416c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/7020fbe3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/7110cdf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/7110cdf9c42100141fce95f06aba7e85 deleted file mode 100644 index c4b490f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/7110cdf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,151 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityUniversalFlowerPot extends TileEntity implements IInventory { - - private ItemStack[] inventory; - - public TileEntityUniversalFlowerPot() { - inventory = new ItemStack[1]; - } - - @Override - public int getSizeInventory() { - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public ItemStack decrStackSize(int slot, int amt) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize <= amt) { - setInventorySlotContents(slot, null); - } else { - stack = stack.splitStack(amt); - if (stack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - setInventorySlotContents(slot, null); - } - return stack; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this - && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - - NBTTagList itemList = new NBTTagList(); - for (int i = 0; i < inventory.length; i++) { - ItemStack stack = inventory[i]; - if (stack != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) i); - stack.writeToNBT(tag); - itemList.appendTag(tag); - } - } - tagCompound.setTag("Inventory", itemList); - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/804965f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/804965f5c42100141fce95f06aba7e85 deleted file mode 100644 index 4ef4c9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/804965f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRedFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedFinchDeclaration extends SpawnableDeclaration { - - public RedFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/904f9b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/904f9b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c69c938..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/904f9b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/90b1c1ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/90b1c1ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8ca455e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/90b1c1ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.brewingstands.PotionIngredients; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GenericCraftingItemsDeclaration extends ItemDeclaration { - - public GenericCraftingItemsDeclaration() { - super("GenericCraftingItems1"); - } - - @Override - protected boolean createItem() { - ItemGenerics itemGenerics = (ItemGenerics) new ItemGenerics(); - ItemList.genericCraftingItems = Optional.of(itemGenerics); - PotionIngredients.addIngredientProperties(itemGenerics, itemGenerics); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.genericCraftingItems.get(); - OreDictionary.registerOre("foodSalt", new ItemStack(item, 1, ItemGenerics.Properties.Salt.meta())); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a137619fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a137619fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d6219f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/a137619fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/d02612a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/d02612a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2424d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9a/d02612a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/10b9029ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/10b9029ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f53b3e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/10b9029ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemScale; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/125557e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/125557e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4038f7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/125557e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCrocodile; -import projectzulu.common.mobs.models.ModelCrocodile; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/208591a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/208591a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89c12e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/208591a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/30ac3af4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/30ac3af4c42100141fce95f06aba7e85 deleted file mode 100644 index c718d5e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/30ac3af4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import org.apache.commons.lang3.tuple.Pair; - -/** - * For usage see: {@link Pair} - */ -public class BoundaryPair { - private final K lower; - private final V upper; - - public static BoundaryPair createPair(K lower, V upper) { - return new BoundaryPair(lower, upper); - } - - public BoundaryPair(K lower, V upper) { - this.lower = lower; - this.upper = upper; - } - - public K getLowerLimit() { - return lower; - } - - public V getUpperLimit() { - return upper; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/511db39ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/511db39ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a85bc54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/511db39ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,563 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getAABBPool() - .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/614677a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/614677a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3f5b6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/614677a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,167 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/61b28bf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/61b28bf4c42100141fce95f06aba7e85 deleted file mode 100644 index f98875d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/61b28bf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/70f2d1f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/70f2d1f9c42100141fce95f06aba7e85 deleted file mode 100644 index e32c264..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/70f2d1f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerUniversalFlowerPot extends Container{ - protected TileEntityUniversalFlowerPot tileEntity; - - public ContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntityUniversalFlowerPot){ - this.tileEntity = tileEntityUniversalFlowerPot; - - // The Slot constructor takes the IInventory and the slot number in that it binds to - // and the x-y coordinates it resides on-screen - addSlotToContainer(new Slot(tileEntity, 0, 79, 17)); - - // Commonly used vanilla code that adds the player's inventory - bindPlayerInventory(inventoryPlayer); - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return tileEntity.isUseableByPlayer(player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { - ItemStack stack = null; - Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) - if (slotObject != null && slotObject.getHasStack()) { - ItemStack stackInSlot = slotObject.getStack(); - stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity - //this assumes only 1 slot, for inventories with > 1 slots, check out the Chest Container. - if (slot == 0) { - if (!mergeItemStack(stackInSlot, 1, inventorySlots.size(), true)) { - return null; - } - //places it into the tileEntity is possible since its in the player inventory - } else if (!mergeItemStack(stackInSlot, 0, 1, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slotObject.putStack(null); - } else { - slotObject.onSlotChanged(); - } - } - - return stack; - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/70f337a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/70f337a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 63a4c85..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/70f337a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,165 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/81cb7ff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/81cb7ff4c42100141fce95f06aba7e85 deleted file mode 100644 index ca9a73e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/81cb7ff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetDoorway; -import com.ngb.projectzulu.common.world2.blueprint.BPSetHallway; -import com.ngb.projectzulu.common.world2.blueprint.BPSetHallwaySpawner; -import com.ngb.projectzulu.common.world2.blueprint.BPSetPyramidEdge; -import com.ngb.projectzulu.common.world2.blueprint.BPSetStairs; -import com.ngb.projectzulu.common.world2.blueprint.BPSetTreasureDeadEnd; -import com.ngb.projectzulu.common.world2.blueprint.BPSetWall; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectPyramid extends ArchitectBase { - - public final BPSetStairs stairSet = new BPSetStairs(); - public final BPSetPyramidEdge edge = new BPSetPyramidEdge(); - public final BPSetDoorway door = new BPSetDoorway(); - - public ArchitectPyramid(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetWall()); - stockpile.addBlueprintSet(new BPSetTreasureDeadEnd()); - stockpile.addBlueprintSet(new BPSetHallway()); - stockpile.addBlueprintSet(new BPSetHallwaySpawner()); - stockpile.addBlueprintSet(stairSet); - stockpile.addBlueprintSet(edge); - stockpile.addBlueprintSet(door); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - /* If is Wall, use Wall Cell */ - BlueprintSet set; - if (door.isApplicable(cells, buildCoords, random)) { - set = door; - } else if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] bottomCells, MazeCell[][] topCells) { - for (int topX = 0; topX < topCells.length; topX++) { - for (int topZ = 0; topZ < topCells[0].length; topZ++) { - Point buildCoords = new Point(topX, topZ); - if (stairSet.attemptAssignBlueprint(bottomCells, topCells, buildCoords, random)) { - return; - } - } - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/926620e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/926620e5c42100141fce95f06aba7e85 deleted file mode 100644 index d67559e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/926620e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,155 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/a023949ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/a023949ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 003fa0a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/a023949ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b0fc1ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b0fc1ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 38690ba..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/b0fc1ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c0913c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c0913c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 68d15b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c0913c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRabbit; -import projectzulu.common.mobs.models.ModelRabbit; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RabbitDeclaration extends SpawnableDeclaration { - - public RabbitDeclaration() { - super("Rabbit", 21, EntityRabbit.class, EnumCreatureType.creature); - setSpawnProperties(15, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (239 << 16) + (179 << 8) + 83; - eggColor2 = (237 << 16) + (208 << 8) + 166; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.RabbitsFoot.meta(), 8); - customMobData.entityProperties = new EntityProperties(10f, 1.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c2e4e5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c2e4e5f8c42100141fce95f06aba7e85 deleted file mode 100644 index b82465b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9b/c2e4e5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBlueFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/11665500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/11665500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0bdd49b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/11665500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/31598aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/31598aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e2b4a0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/31598aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/4094e2f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/4094e2f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0a79765..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/4094e2f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,60 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/7191fde3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/7191fde3c42100141fce95f06aba7e85 deleted file mode 100644 index 805dae7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/7191fde3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,39 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/90e56bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/90e56bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b2c3189..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/90e56bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a094969ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a094969ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5fa2c4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/a094969ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/b1db55a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/b1db55a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 62635f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/b1db55a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c187b0f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c187b0f9c42100141fce95f06aba7e85 deleted file mode 100644 index b044250..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c187b0f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.util.MathHelper; - -public class ModelHelper { - - /** - * Absolute Value alternative to {@link MathHelper#abs(float par0)} for Double values - */ - public static double abs(double value) { - if (value < 0) { - return 0f; - } else { - return value; - } - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value may be outside - * the range of values. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value will be clamped - * to the min.max values of the target range. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueWithClamp(float value, float set1min, float set1max, float set2min, float set2max) { - float value2 = (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - value2 = MathHelper.clamp_float(value2, set2min, set2max); - return value2; - } - - /** - * Vanilla Function used for Rotations - * - * @param par1 - * @param par2 - * @return - */ - // TODO: Rename To Something Decent, deobfuscate parameters - public static float func_78172_a(float par1, float par2) { - return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); - } - - /** - * Sets the RotationPoint of the provided Model using the value interpolated to the desired ranges foreach direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotationPoint(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotationPointX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotationPointY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotationPointZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } - - /** - * Sets the Rotation of the provided Model using the value interpolated to the desired ranges for each direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotation(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotateAngleX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotateAngleY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotateAngleZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c23c889ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c23c889ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b78e77b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/c23c889ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d0861a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d0861a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7a0443a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d0861a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d08badf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d08badf7c42100141fce95f06aba7e85 deleted file mode 100644 index 5d836c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d08badf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelRhinoHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelRhinoHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 18F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d0f7a7f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d0f7a7f5c42100141fce95f06aba7e85 deleted file mode 100644 index 631fe99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9c/d0f7a7f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/008013f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/008013f5c42100141fce95f06aba7e85 deleted file mode 100644 index 8b16bdd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/008013f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,147 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ContainerBrewingStandSingle extends Container { - - private TileEntityBrewingBase tileBrewingStand; - - /** Instance of Slot. */ - private final Slot theSlot; - private int brewTime = 0; - public final int potionSlots; - - public ContainerBrewingStandSingle(InventoryPlayer par1InventoryPlayer, TileEntityBrewingBase brewingStand) { - this.tileBrewingStand = brewingStand; - potionSlots = tileBrewingStand.getSizeInventory() - 1; - int slotID = 0; - if (potionSlots >= 1) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 79, - 53)); - } - - if (potionSlots >= 3) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 56, - 46)); - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, - 102, 46)); - } - this.theSlot = this.addSlotToContainer(new SlotBrewingStandSingleIngredient(this, brewingStand, slotID++, 79, - 17)); - int i; - - /* Add Inventory Slots */ - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - /* Add Hot Bar Slots */ - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - - /** - * Looks for changes made in the container, sends them to every listener. - */ - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.brewTime != this.tileBrewingStand.getBrewTime()) { - icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - } - this.brewTime = this.tileBrewingStand.getBrewTime(); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - if (par1 == 0) { - this.tileBrewingStand.setBrewTime(par2); - } - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - int potionMin = 0; - int potionMax = potionSlots + 1; // 4; - int hotBarMin = potionSlots + 1 + 3 * 9; // 31; - int hotBarMax = potionSlots + 1 + 3 * 9 + 9; // 40; - int inventMin = potionSlots + 1; // 4; - int inventMax = potionSlots + 1 + 3 * 9;// 31; - - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - if ((par2 < 0 || par2 > potionMax)) { - if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) { - if (!this.mergeItemStack(itemstack1, potionMax - 1, potionMax, false)) { - return null; - } - } else if (SlotBrewingStandSinglePotion.canHoldPotion(itemstack)) { - if (!this.mergeItemStack(itemstack1, potionMin, potionMax - 1, false)) { - return null; - } - } else if (par2 >= inventMin && par2 < inventMax) { - if (!this.mergeItemStack(itemstack1, hotBarMin, hotBarMax, false)) { - return null; - } - } else if (par2 >= hotBarMin && par2 < hotBarMax) { - if (!this.mergeItemStack(itemstack1, inventMin, inventMax, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, false)) { - return null; - } - } else { - if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, true)) { - return null; - } - slot.onSlotChange(itemstack1, itemstack); - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - return itemstack; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00fe6d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00fe6d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d3f1cbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/00fe6d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/109328f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/109328f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5c4388b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/109328f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/10b27200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/10b27200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 95585fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/10b27200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/10ebc6f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/10ebc6f8c42100141fce95f06aba7e85 deleted file mode 100644 index 4ef4c9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/10ebc6f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRedFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RedFinchDeclaration extends SpawnableDeclaration { - - public RedFinchDeclaration() { - super("Red Finch", 22, EntityRedFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/11d7f9f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/11d7f9f7c42100141fce95f06aba7e85 deleted file mode 100644 index 6b0deaa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/11d7f9f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/409e85a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/409e85a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 109e51f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/409e85a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/40b32c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/40b32c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e33e777..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/40b32c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseRandom; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/5004daf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/5004daf5c42100141fce95f06aba7e85 deleted file mode 100644 index acdd317..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/5004daf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/601ed9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/601ed9f9c42100141fce95f06aba7e85 deleted file mode 100644 index 66b2841..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/601ed9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/7077a5a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/7077a5a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 27a50c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/7077a5a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZPotionTab extends CreativeTabs { - - public CreativePZPotionTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - public Item getTabIconItem() { - return Items.potionitem; - } - - @Override - public int func_151243_f() { - return 3; - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu Potions"; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/8023049fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/8023049fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8144c51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/8023049fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/90e32bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/90e32bf8c42100141fce95f06aba7e85 deleted file mode 100644 index c816dce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/90e32bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/92ebefe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/92ebefe5c42100141fce95f06aba7e85 deleted file mode 100644 index 4505454..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/92ebefe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,290 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.EntityPZPotion; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e02a0bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e02a0bfac42100141fce95f06aba7e85 deleted file mode 100644 index 6163abd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e02a0bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e16ee09ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e16ee09ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cf86e68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/e16ee09ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMammoth extends EntityGenericAnimal implements IAnimals { - - Vec3 stampedeDirection = Vec3.createVectorHelper(0, 0, 0); - public int timeLeftStampeding = 0; - - public EntityMammoth(World par1World) { - super(par1World); - setSize(4.5f, 5.4f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 5.5f * 5.5f)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, false, IMob.mobSelector)); - } - - public float getAttackDistance() { - return isChild() ? 3.0f : 6.0f; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mammothliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - public void causeStampede(Vec3 locationOfCause) { - // this.pathToEntity = null; - timeLeftStampeding = 20 * 10; - List centroids = new ArrayList(); - - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(100, 60, 100); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityMammoth.class, var15); - Vec3 herdCentroid = Vec3.createVectorHelper(0, 0, 0); - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - - if (var4 instanceof EntityMammoth) { - // Notify Mammoth that he should be stampeding, If the lazy bastard isn't - if (((EntityMammoth) var4).timeLeftStampeding == 0) { - ((EntityMammoth) var4).causeStampede(locationOfCause); - } - centroids.add(i, Vec3.createVectorHelper(var4.posX, var4.posY, var4.posZ)); - herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord + var4.posX, herdCentroid.yCoord - + var4.posY, herdCentroid.zCoord + var4.posZ); - i++; - } - } - } - // herdCentroid = Vec3.createVectorHelper(herdCentroid.xCoord/i, herdCentroid.yCoord/i, herdCentroid.zCoord/i); - herdCentroid = Vec3.createVectorHelper(this.posX, this.posY, this.posZ); - - stampedeDirection = Vec3.createVectorHelper((herdCentroid.xCoord - locationOfCause.xCoord), - (herdCentroid.yCoord - locationOfCause.yCoord), (herdCentroid.zCoord - locationOfCause.zCoord)); - if (Math.abs(stampedeDirection.xCoord) < 6 && Math.abs(stampedeDirection.zCoord) < 6) { - stampedeDirection.xCoord = stampedeDirection.xCoord * 6; - stampedeDirection.zCoord = stampedeDirection.zCoord * 6; - } - if (Math.abs(stampedeDirection.xCoord) > 32 || Math.abs(stampedeDirection.zCoord) > 32) { - stampedeDirection.xCoord = stampedeDirection.xCoord / 2; - stampedeDirection.zCoord = stampedeDirection.zCoord / 2; - } - - Vec3 locToStamp = Vec3.createVectorHelper(this.posX + stampedeDirection.xCoord, worldObj - .getTopSolidOrLiquidBlock((int) (this.posX + stampedeDirection.xCoord), - (int) (this.posY + stampedeDirection.zCoord)), this.posZ + stampedeDirection.zCoord); - // this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, (int)locToStamp.xCoord, (int)locToStamp.yCoord, - // (int)locToStamp.zCoord, 32f, false, true, false, true); - } - - protected void riderAttackNearby() { - /* Search For Nearby Entities */ - /* Select ones To Attack */ - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var15); - - int i = 0; - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityPlayer - && ((EntityPlayer) riddenByEntity).getCommandSenderName().equals(((EntityPlayer) var4).getCommandSenderName())) { - - } else { - if (var4.getDistanceToEntity(this) < getAttackDistance()) { - attackEntityAsMob(var4); - } - } - } - } - this.attackTime = 20; - worldObj.playSound(this.posX, this.posY, this.posZ, "sounds.mammothstomp", 1.0f, 1.0f, false); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 11), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/f09f0e9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/f09f0e9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4346f18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/f09f0e9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCampFire extends ItemBlock { - - public ItemCampFire(Block block) { - super(block); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Block.getBlockFromItem(this).getIcon(2, par1); - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return "tile." - + BlockCampfire.Type.getTypeByMeta(itemstack.getItemDamage()).displayName().toLowerCase() - .replaceAll("\\s", ""); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/f1039bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/f1039bf9c42100141fce95f06aba7e85 deleted file mode 100644 index 9de21f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9d/f1039bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public interface TerrainFeature { - - /** - * The ordinal declaration of this ENUM determines priority during feature generation. Value declared first gets - * precedent. - */ - enum Size { - /* Feature is larger than a single chunk */ - LARGE, - /* Is approximately the size of a chunk */ - MEDIUM, - /* Size is less than a chunk, but more than a block */ - SMALL, - /* Spans a single or a couple blocks */ - TINY - } - - public enum FeatureDirection { - /* Structure should be centered on Current Block */ - CENTERED, - /* Structure should be centered along X but generate along -Z axis away from this block */ - NORTH, - /* Structure should be centered along X but generate along +Z axis away from this block */ - SOUTH, - /* Structure should be centered along Z but generate along -X axis away from this block */ - WEST, - /* Structure should be centered along Z but generate along +X axis away from this block */ - EAST; - } - - public abstract String getFeatureName(); - - public abstract boolean isEnabled(); - - public abstract Size getFeatureSize(); - - public abstract void initialize(File modConfigDirectory); - - /** - * From the World and Chunk. Generates an array of positions to attempt to generate the feature at. - * - * Each Point should be able to spawn - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @return - */ - public abstract ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ); - - /** - * Determines if the Feature can generate at the specified coordinates - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @param genBlockCoords Coordinates to generate at - * @param random - * @return - */ - public abstract boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random, FeatureDirection direction); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/101d8ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/101d8ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 88fff06..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/101d8ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; - -import org.lwjgl.util.Point; - -public interface DataFields { - - public abstract boolean isEnabled(); - - public abstract void setIsEnabled(boolean isEnabled); - - public abstract DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize); - - public abstract void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID); - - public abstract void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner); - - public abstract boolean keyboardInput(char keyChar, int keyID); - - public abstract void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3); - - public abstract void mouseHover(int par1, int par2, int par3); - - public abstract void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/11d087e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/11d087e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2c9fc76..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/11d087e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package projectzulu.common; - -import projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/218591a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/218591a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65fb51f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/218591a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/40774da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/40774da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f157fad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/40774da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,215 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityAerial extends EntityLiving { - - protected ChunkCoordinates targetPosition; - /** Tries to Assign targetPosition - * Checks if Valid first using isTargetPositionValid - * Returns False if invald - */ - public boolean setTargetPosition(ChunkCoordinates targetPosition){ - if(isTargetPositionValid(targetPosition)){ - this.targetPosition = targetPosition; - return true; - } - return false; - } - protected int maxFlightHeight = 20; - public int getMaxFlightHeight(){ return maxFlightHeight; } - public EntityAerial(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handle whether Entity is Flying or not*/ - if( defaultGrounded() ){ - this.dataWatcher.addObject(17, Byte.valueOf((byte)1)); - }else{ - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - } - - } - - public boolean defaultGrounded() { - return true; - } - - public boolean isEntityGrounded() { - return this.dataWatcher.getWatchableObjectByte(17) != 0; - } - protected void setEntityGrounded(Boolean par1) { - if(par1){ - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - }else { - this.dataWatcher.updateObject(17, Byte.valueOf((byte)0)); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("Is Grounded", this.dataWatcher.getWatchableObjectByte(17)); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - if(par1NBTTagCompound.hasKey("Is Grounded")){ - this.dataWatcher.updateObject(17, par1NBTTagCompound.getByte("Is Grounded")); - } - } - - @Override - protected void updateAITasks() { - if(!isEntityGrounded() && targetPosition != null){ - /* Get The Direction I want to travel in */ - double var1 = (double)this.targetPosition.posX + 0.5D - this.posX; - double var3 = (double)this.targetPosition.posY + 0.1D - this.posY; - double var5 = (double)this.targetPosition.posZ + 0.5D - this.posZ; - - /* Change Velocity */ - /* Normalize the Direction I want to travel in, then add and scale it to Motion */ - this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D*0.3D; - this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D*0.3D; - this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D*0.3D; - float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; - float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); - this.moveForward = 0.5F; - this.rotationYaw += var8; - } - super.updateAITasks(); - } - - protected boolean shouldBeFlying() { - return false; - } - - public boolean isTargetPositionValid(){ - return isTargetPositionValid(this.targetPosition); - } - - public boolean isTargetPositionValid(ChunkCoordinates targetPosition){ - /* Invalid if Water, is below height = 3 (superflat), and if its null */ - if (targetPosition != null && (!this.worldObj.isAirBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ) || targetPosition.posY < 3 - || this.worldObj.getBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ).getMaterial().equals(Material.water))){ -// targetPosition = null; - return false; - } - return true; - } - - /* Checks if Entity is at the target position, return true if TargetPosition is null*/ - public boolean atTargetPosition(){ - if(targetPosition != null){ - return getDistance(targetPosition.posX, targetPosition.posY, targetPosition.posZ) < 2; - } - return true; - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if(isEntityGrounded()){ - super.moveEntityWithHeading(par1, par2); - return; - } - - if (this.isInWater()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } - else if (this.handleLavaMovement()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - else - { - float var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double)var3; - this.motionY *= (double)var3; - this.motionZ *= (double)var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) - { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwing; - } - - - /** - * Method Designed for Flying Entities to adjust the Direction They are facing to the direction they are moving - */ - protected void adjustRotationToWaypoint() { - double var8 = targetPosition.posX - this.posX; - double var10 = targetPosition.posZ - this.posZ; - float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI);// - 90.0F; - float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); - - if (var15 > 30.0F){ - var15 = 30.0F; - } - - if (var15 < -30.0F){ - var15 = -30.0F; - } - this.renderYawOffset = this.rotationYaw += var15; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/408002ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/408002ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb41ada..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/408002ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,502 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/60894001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/60894001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 581e0fe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/60894001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.models.ModelSandWorm; -import projectzulu.common.mobs.renders.RenderGenericIdle; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/71c00d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/71c00d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 836549e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/71c00d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlueFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/829133a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/829133a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 98d0454..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/829133a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.PotionList; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.potion.effects.PotionCleansing; -import projectzulu.common.potion.effects.PotionCurse; -import projectzulu.common.potion.effects.PotionHarm2; -import projectzulu.common.potion.effects.PotionHeal2; -import projectzulu.common.potion.effects.PotionIncendiary; -import projectzulu.common.potion.effects.PotionSlowFall; -import projectzulu.common.potion.effects.PotionThorns; -import projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/90ea7300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/90ea7300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f5e998..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/90ea7300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/91019ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/91019ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4d3ac86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/91019ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiContainerUniversalFlowerPot extends GuiContainer { - public final static ResourceLocation FLOWERPOT_GUI = new ResourceLocation(DefaultProps.coreKey, - "gui/FlowerPotGUI.png"); - - public GuiContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntity) { - super(new ContainerUniversalFlowerPot(inventoryPlayer, tileEntity)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Flower Pot", 8, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(FLOWERPOT_GUI); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/91ea02fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/91ea02fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0fc412b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/91ea02fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/a0676c8a092100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/a0676c8a092100141769cb1ed0c338cd deleted file mode 100644 index d6ee739..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/a0676c8a092100141769cb1ed0c338cd +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - /** The PathNavigate of our entity. */ - EntityLivingBase entityPathNavigate; - int fleeChance = 0; - /** Task Owner in the form of out Generic Creature, used to access Specialized information, such as Anger or EntityState */ - EntityGenericCreature genericTaskOwner; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityLiving, boolean shouldCallAllies, boolean shouldCheckSight) { - super(par1EntityLiving, 16.0F, shouldCheckSight); - this.shouldCallAllies = shouldCallAllies; - this.setMutexBits(1); - this.genericTaskOwner = par1EntityLiving; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.isSuitableTarget(this.taskOwner.getAITarget(), false); - - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return shouldExecute(); -// return this.taskOwner.getAITarget() != null && this.taskOwner.getAITarget() != this.entityPathNavigate; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.entityPathNavigate = this.taskOwner.getAITarget(); - - if (this.shouldCallAllies){ - //List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - double d0 = this.getTargetDistance(); - List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - Iterator var2 = var1.iterator(); - - while (var2.hasNext()){ - EntityLiving var3 = (EntityLiving)var2.next(); - - if (this.taskOwner != var3 && var3.getAttackTarget() == null){ - var3.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - super.startExecuting(); - } - - @Override - public void updateTask() { - startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/a191c3a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/a191c3a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f98a97a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/a191c3a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityLizard; -import projectzulu.common.mobs.models.ModelLizard; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/b110edf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/b110edf8c42100141fce95f06aba7e85 deleted file mode 100644 index c3559d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/b110edf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityCrocodile; -import com.ngb.projectzulu.common.mobs.models.ModelCrocodile; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/b2fa44e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/b2fa44e4c42100141fce95f06aba7e85 deleted file mode 100644 index 41a9242..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/b2fa44e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockNightBloom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c0d66f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c0d66f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f0531d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c0d66f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.client.Minecraft; -import net.minecraft.potion.Potion; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PotionZulu extends Potion { - - public ResourceLocation resourceLocation = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - protected PotionZulu(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - public PotionZulu(int par1, boolean par2, int par3, int iconX, int iconY) { - this(par1, par2, par3); - setIconIndex(iconX, iconY); - setEffectiveness(0.25D); - } - - @Override - @SideOnly(Side.CLIENT) - public int getStatusIconIndex() { - Minecraft mc = Minecraft.getMinecraft(); - mc.renderEngine.bindTexture(getTextureFile()); - return super.getStatusIconIndex(); - } - - private ResourceLocation getTextureFile() { - return resourceLocation; - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c0ee13f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c0ee13f8c42100141fce95f06aba7e85 deleted file mode 100644 index c6aa73e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c0ee13f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c1d5aff7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c1d5aff7c42100141fce95f06aba7e85 deleted file mode 100644 index 99254af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/c1d5aff7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,195 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelMammothHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer TUSKLEFROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer NOSEROT1; - private ModelRenderer NOSEROT2; - private ModelRenderer NOSEROT3; - private ModelRenderer NOSEROT4; - private ModelRenderer NOSEROT5; - private ModelRenderer NOSEROT6; - private ModelRenderer NOSEROT7; - private ModelRenderer NOSEROT8; - private ModelRenderer NOSEROT9; - private ModelRenderer EARRIGROT; - private ModelRenderer EARLEFROT; - - public ModelMammothHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 16F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5) - { - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NOSEROT1.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (0.0*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - default: - NOSEROT1.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - } - - TUSKRIGROT.rotateAngleY = (float) (-22.5*Math.PI/180); - TUSKLEFROT.rotateAngleY = (float) (22.5*Math.PI/180); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e0916ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e0916ef8c42100141fce95f06aba7e85 deleted file mode 100644 index f8f60fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e0916ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class EntityPZPotion extends EntityPotion { - - private ItemStack potionStack; - - public EntityPZPotion(World par1World) { - super(par1World); - } - - public EntityPZPotion(World world, EntityLivingBase living, ItemStack itemStack) { - super(world, living, itemStack); - potionStack = itemStack; - } - - public EntityPZPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { - super(par1World, par2, par4, par6, par8ItemStack); - potionStack = par8ItemStack; - } - - @Override - public int getPotionDamage() { - return potionStack != null ? potionStack.getItemDamage() : 0; - } - - @Override - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { - if (!this.worldObj.isRemote && potionStack.getItem() != null && potionStack.getItem() instanceof ItemPotion) { - @SuppressWarnings("unchecked") - List effectList = ((ItemPotion) potionStack.getItem()).getEffects(potionStack); - - if (effectList != null && !effectList.isEmpty()) { - AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - @SuppressWarnings("unchecked") - List entityList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, - axisalignedbb); - - if (entityList != null && !entityList.isEmpty()) { - Iterator iterator = entityList.iterator(); - - while (iterator.hasNext()) { - EntityLivingBase entityliving = iterator.next(); - double squareDistance = this.getDistanceSqToEntity(entityliving); - - if (squareDistance < 16.0D) { - double distanceFactor = 1.0D - Math.sqrt(squareDistance) / 4.0D; - - if (entityliving == par1MovingObjectPosition.entityHit) { - distanceFactor = 1.0D; - } - - Iterator iterator1 = effectList.iterator(); - - while (iterator1.hasNext()) { - PotionEffect potioneffect = iterator1.next(); - int potionID = potioneffect.getPotionID(); - - if (Potion.potionTypes[potionID].isInstant()) { - Potion.potionTypes[potionID].affectEntity(this.getThrower(), entityliving, - potioneffect.getAmplifier(), distanceFactor); - } else { - int potionDuration = (int) (distanceFactor * potioneffect.getDuration() + 0.5D); - - if (potionDuration > 20) { - entityliving.addPotionEffect(new PotionEffect(potionID, potionDuration, - potioneffect.getAmplifier())); - } - } - } - } - } - } - } - - this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), - (int) Math.round(this.posZ), potionStack.getItemDamage()); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - if (par1NBTTagCompound.hasKey("Potion")) { - potionStack = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); - } - - if (potionStack == null) { - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - if (potionStack != null) { - par1NBTTagCompound.setTag("Potion", potionStack.writeToNBT(new NBTTagCompound())); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e0f3af9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e0f3af9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 514a919..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e0f3af9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,473 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.io.ByteArrayOutputStream; -//import java.io.DataInputStream; -//import java.io.DataOutputStream; -//import java.io.IOException; -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.entity.EntityLiving; -//import net.minecraft.entity.EntityLivingBase; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.entity.player.EntityPlayerMP; -//import net.minecraft.nbt.NBTTagCompound; -//import net.minecraft.network.packet.Packet250CustomPayload; -//import net.minecraft.potion.Potion; -//import net.minecraft.potion.PotionEffect; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -//import cpw.mods.fml.common.network.PacketDispatcher; -//import cpw.mods.fml.common.network.Player; -// -//public class TemperatureTicker implements ITickHandler, IPlayerTracker{ -// -// /* Temperature Used When Changint Dimensions or Loading into a World for the First Time */ -// private static float defaultTemperature = 0; -// /* Player Tempurature, Used to Calculate Effects and Display */ -// private static float playerTemperature = 0; -// private static Map temperatureMap = new HashMap(); -// /* Last World the Player was in, Used to Determine if the player has Switched worlds or Just Loaded Minecraft */ -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// /* Used For Displaying the Environment Temperature around a player, used in DisplayTemperatureTicker to mark the Temp. the Player Trending Towards in */ -// private static Map playerLocTempMap = new HashMap(); -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private short DirtyFlag = 0; -// public TemperatureTicker(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( temperatureMap.containsKey( player.getEntityName() ) ){ -// playerTemperature = temperatureMap.get( player.getEntityName() ); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP ){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// /* Read From File */ -// if ( HasPendingRead() ){ -// readNBTFromFile(player); -// ClearPendingRead(); -// } -// } -// -// /* Get Outside Temperature */ -// float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// float unTouchedPlayerLocationTemperature; -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// unTouchedPlayerLocationTemperature = playerLocTempMap.get(player.getEntityName()); -// }else { -// unTouchedPlayerLocationTemperature = playerLocationTemperature; -// } -// float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -// playerLocationTemperature += item.getLocationTemperatureFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getPlayerTempContributionFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// if(currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 3)); -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 1)); -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Save Temperature To Map*/ -// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -// if(player instanceof EntityPlayerMP){ -// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -// DataOutputStream data = new DataOutputStream(bytes); -//// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -// -// /* Write PacketID into Packet */ -// try { -// data.writeInt(1); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// /* Write Temperature Into Packet*/ -// try { -// data.writeFloat(playerTemperature); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// -// Packet250CustomPayload packet = new Packet250CustomPayload(); -// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -// packet.data = bytes.toByteArray(); -// packet.length = packet.data.length; -// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -//// System.out.println( player.getEntityName().concat("Sent Packet ")); -// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// nbttagcompound.setFloat(player.getEntityName().concat("Player Temperature"), playerTemperature); -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// if (nbttagcompound.hasKey( player.getEntityName().concat("Player Temperature") )){ -// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("Player Temperature") ); -// } -// } -// -// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -// -// /* Get Relevent Data From DataStream */ -// float tempTemp = playerTemperature; -// try { -// tempTemp = data.readFloat(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// /* Make Sure Player Exists, then Assign data to map */ -// if(temperatureMap.containsKey(sender.getEntityName())){ -// temperatureMap.put(sender.getEntityName(), tempTemp); -// } -// -// -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -// temperatureMap.put(player.getEntityName(), 0.0f); -// lastWorldNameMap.put(player.getEntityName(), ""); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// } -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// setPlayerToDefaultTemp(player); -// } -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -// setPlayerToDefaultTemp(player); -// } -// -// public void setPlayerToDefaultTemp(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e1786800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e1786800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d9df01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/e1786800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/f07952f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/f07952f4c42100141fce95f06aba7e85 deleted file mode 100644 index 66ab9bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/f07952f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,176 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1 || piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection, - piecePos.posZ == cellSize - 2)); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - case SouthWall: - return 2; - case NorthWall: - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection, boolean onRight) { - switch (cellIndexDirection) { - case WestWall: - return onRight ? 0 : 1; - case EastWall: - return onRight ? 1 : 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/f12e0c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/f12e0c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3496413..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9e/f12e0c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,419 +0,0 @@ -package projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/004bf21b0e2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/004bf21b0e2100141769cb1ed0c338cd deleted file mode 100644 index 47daabf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/004bf21b0e2100141769cb1ed0c338cd +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - //return CompressedStreamTools.decompress(var2); - return CompressedStreamTools.decompress(var2); - - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/011ea5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/011ea5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b9c1fc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/011ea5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/01eafaffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/01eafaffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b50e429..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/01eafaffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.projectzulu.common; - -import projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/11ac8cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/11ac8cf9c42100141fce95f06aba7e85 deleted file mode 100644 index a32960f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/11ac8cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.nbt.NBTBase; - -import org.lwjgl.util.Point; - -public class GUIEditNodeTextField extends GuiTextField { - private NBTNode selectedNode = null; - - public GUIEditNodeTextField(FontRenderer par1FontRenderer, int xPos, int yPos, int width, int height) { - super(par1FontRenderer, xPos, yPos, width, height); - } - - public GUIEditNodeTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(30000); - } - - public GUIEditNodeTextField(GUIEditNodeTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - - this.selectedNode = oldTextFields.selectedNode; - setText(oldTextFields.getText()); - setupTextField(30000); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } - - public boolean isEnabled() { - return selectedNode != null; - } - - public void setSelectedNode(NBTNode selectedNode) { - this.selectedNode = selectedNode; - setText(selectedNode.getValue()); - } - - public boolean saveAndClear(NBTTree nodeTree) { - NBTBase newNBT = selectedNode.createNBTFromString(getText()); - if (newNBT != null) { - if (selectedNode.getParent() != null) { - selectedNode.getParent().replaceChild(selectedNode, - new NBTNode(newNBT, selectedNode.getParent(), selectedNode.getTagName())); - } else { - // Properties name is arbitrary, the top compound in entity NBT is/was typically called properties - selectedNode = new NBTNode(newNBT, null, "Properties"); - } - clear(); - return true; - } - return false; - } - - public void clear() { - selectedNode = null; - setText(""); - } - - @Override - public boolean textboxKeyTyped(char keyChar, int keyID) { - if (selectedNode != null) { - return super.textboxKeyTyped(keyChar, keyID); - } - return false; - } - - @Override - public void mouseClicked(int par1, int par2, int par3) { - if (selectedNode != null) { - super.mouseClicked(par1, par2, par3); - } - } - - @Override - public void drawTextBox() { - super.drawTextBox(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/11d75700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/11d75700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 371b5cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/11d75700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/21337ee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/21337ee4c42100141fce95f06aba7e85 deleted file mode 100644 index 1d2f276..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/21337ee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,196 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.blocks.ModelTombstone; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/21b2c9fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/21b2c9fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb281ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/21b2c9fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/302c59a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/302c59a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3005cbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/302c59a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLog; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/40bc80a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/40bc80a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 808036c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/40bc80a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/419979f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/419979f9c42100141fce95f06aba7e85 deleted file mode 100644 index e317e16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/419979f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.EnumSet; -import java.util.HashMap; - -/** - * Represent the readable Tags for OptionalSettings - */ -public enum Key { - /* Category Tags */ - spawn("spawn", KeyParserSpawn.class), despawn("despawn", KeyParserDespawn.class), - - /* Properties */ - sky("sky", KeyParserSky.class), block("block", KeyParserBlock.class), blockFoot("blockFoot", - KeyParserBlockFoot.class), light("light", KeyParserLight.class), entityCap("cap", KeyParserEntityCap.class), spawnRange( - "spawnRange", KeyParserSpawnRange.class), maxSpawnRange("maxSpawnRange", KeyParserMaxSpawnRange.class), despawnAge( - "despawnAge", KeyParserDespawnAge.class), spawnRate("spawnRate", KeyParserSpawnRate.class), blockRange( - "blockRange", KeyParserBlockRange.class), material("material", null), minSpawnHeight("minSpawnHeight", - KeyParserMinHeight.class), maxSpawnHeight("maxSpawnHeight", KeyParserMaxHeight.class), normal("normal", - KeyParserNormalCube.class), liquid("liquid", KeyParserLiquid.class), opaque("opaque", - KeyParserOpaqueBlock.class), solidSide("solidSide", KeyParserSolidSide.class), difficulty("difficulty", - KeyParserDifficulty.class), torchLight("torchLight", KeyParserTorchLight.class), ground("ground", - KeyParserGround.class), top("top", KeyParserTop.class), fill("fill", KeyParserFill.class), modspawn( - "modSpawn", KeyParserModSpawn.class), origin("origin", KeyParserOrigin.class), players("players", - KeyParserPlayers.class), entities("entities", KeyParserEntities.class), random("random", - KeyParserRandom.class), writenbt("writenbt", KeyParserWriteNBT.class), - - /* Sub Tags */ - blockRangeX("blockRangeX", null), blockRangeY("blockRangeY", null), blockRangeZ("blockRangeZ", null), - - /**/ - UNKNOWN("", null); - - public final String key; - private static final HashMap lookupEnum = new HashMap(); - static { - for (Key key : EnumSet.allOf(Key.class)) - lookupEnum.put(key.key.toUpperCase(), key); - } - - public KeyParser keyParser; - - Key(String key, Class keyParserClass) { - this.key = key; - if (keyParserClass != null) { - try { - keyParser = keyParserClass.getConstructor(new Class[] { Key.class }).newInstance(new Object[] { this }); - } catch (Exception exception) { - exception.printStackTrace(); - return; - } - } - } - - /** - * Gets the Key associated with the String. Is not case Sensitive - * - * @param string - * @return - */ - public static Key getKeybyString(String string) { - Key value = lookupEnum.get(string.toUpperCase()); - if (value != null) { - return value; - } else { - return UNKNOWN; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/501bba00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/501bba00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5392607..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/501bba00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityGreenFinch extends EntityFinch{ - - public EntityGreenFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/514805e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/514805e6c42100141fce95f06aba7e85 deleted file mode 100644 index 7efa47e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/514805e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60bad7f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60bad7f5c42100141fce95f06aba7e85 deleted file mode 100644 index 4f68641..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/60bad7f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,167 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c0ef274dce21001418ceed54b1d01b94 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c0ef274dce21001418ceed54b1d01b94 deleted file mode 100644 index 2d474d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/c0ef274dce21001418ceed54b1d01b94 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/f04dc301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/f04dc301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7195af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/9f/f04dc301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryEdge implements Blueprint { - - List wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/00ae8fe6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/00ae8fe6c42100141fce95f06aba7e85 deleted file mode 100644 index 9affe18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/00ae8fe6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,95 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY % 2 == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "cemeterytomb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/20285ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/20285ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2320610..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/20285ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,543 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.src.BiomeGenBase; -//import net.minecraft.src.Block; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.EntityPlayer; -//import net.minecraft.src.EntityPlayerMP; -//import net.minecraft.src.Material; -//import net.minecraft.src.NBTTagCompound; -//import net.minecraft.src.Potion; -//import net.minecraft.src.PotionEffect; -//import net.minecraft.src.World; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class TemperatureTickerAttempt2 implements ITickHandler, IPlayerTracker{ -// -// public static final int tempDataWatcher = 18; -// -// /* Player Tempurature HashMaps */ -// private static float playerTemperature = 0; -//// private static Map temperatureMap = new HashMap(); -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// private static Map playerLocTempMap = new HashMap(); -// -//// private static Map playerOuterTempModifierMap = new HashMap(); -// -//// private static float[] blockTempMod = new float[4096]; -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private static float defaultTemperature = 0; -// -// private short DirtyFlag = 0; -// public TemperatureTickerAttempt2(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( lastWorldNameMap.containsKey( player.getEntityName() ) ){ -//// playerTemperature = temperatureMap.get( player.getEntityName() ); -// playerTemperature = getTempFromDataWatcher(player, tempDataWatcher); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -//// System.out.println("Should be Reading :".concat(worldName).concat(lastWorldName) ); -// -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// -//// System.out.println( "SETUP" ); -// -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// -//// /* Read From File */ -//// if ( HasPendingRead() ){ -//// readNBTFromFile(player); -//// ClearPendingRead(); -////// System.out.println( "READ" ); -//// } -// -// } -// -// /* Get Outside Temperature */ -// Float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// Float unTouchedPlayerLocationTemperature = playerLocationTemperature; -// Float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -//// playerLocationTemperature -= 0.1f*Math.abs(worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature()); -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -//// playerLocationTemperature += item.getAddToPlayTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -//// playerTemperature += item.getAddToLocTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// useFastHeatTransfer = currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 100 - (int)playerTemperatureDegrees)); -// -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Set Temperature To Datawatcher on Server Side */ -// if(player instanceof EntityPlayerMP){ -// updateTempInDataWatcher(player, tempDataWatcher, playerTemperature); -// } -// -// /* Save Temperature To Map*/ -//// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -//// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -//// if(player instanceof EntityPlayerMP){ -//// -//// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -//// DataOutputStream data = new DataOutputStream(bytes); -////// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -//// try { -//// data.writeFloat(playerTemperature); -//// } catch (Exception e) { -//// e.printStackTrace(); -//// } -//// -//// Packet250CustomPayload packet = new Packet250CustomPayload(); -//// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -//// packet.data = bytes.toByteArray(); -//// packet.length = packet.data.length; -//// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -////// System.out.println( player.getEntityName().concat("Sent Packet ")); -//// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// try -// { -// -////// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// // File file = new File(ModLoader.getMinecraftInstance().getMinecraftDir() + "/saves/" + ModLoader.getMinecraftInstance().theWorld.saveHandler.getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// if(!file.exists()) -//// { -//// file.createNewFile(); -//// } -//// FileOutputStream fileoutputstream = new FileOutputStream(file); -//// NBTTagCompound nbttagcompound = new NBTTagCompound(); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), getTempFromDataWatcher(player, tempDataWatcher) ); -// -//// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), playerTemperature); -// -//// CompressedStreamTools.writeCompressed(nbttagcompound, fileoutputstream); -//// fileoutputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// try -// { -//// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// -//// if(!file.exists()) -//// { -//// return; -//// } -//// FileInputStream fileinputstream = new FileInputStream(file); -//// NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// if (nbttagcompound.hasKey( player.getEntityName().concat("zulu_temperature_a") )){ -// updateTempInDataWatcher(player, tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -// -//// player.getDataWatcher().updateObject(tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -//// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") ); -// } -// -//// fileinputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -//// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -//// -//// /* Get Relevent Data From DataStream */ -//// float tempTemp = playerTemperature; -//// try { -//// tempTemp = data.readFloat(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// } -//// -//// /* Make Sure Player Exists, then Assign data to map */ -//// if(temperatureMap.containsKey(sender.getEntityName())){ -//// temperatureMap.put(sender.getEntityName(), tempTemp); -////// System.out.println( sender.getEntityName().concat("Received Packet ")); -//// -//// } -//// -//// -//// } -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -//// temperatureMap.put(player.getEntityName(), 0.0f); -// -// lastWorldNameMap.put(player.getEntityName(), ""); -// player.getDataWatcher().addObject(tempDataWatcher, (int)playerTemperature); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -//// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// -// } -// -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell) && !player.worldObj.isRemote){ -// player.getDataWatcher().updateObject(tempDataWatcher, defaultTemperature); -//// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -//// System.out.println("Player Respawned"); -// -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) getTempFromDataWatcher(player, tempDataWatcher); -//// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static void updateTempInDataWatcher(EntityPlayer player, int index, float value){ -// player.getDataWatcher().updateObject(index, (int)value); -// } -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static Float getTempFromDataWatcher(EntityPlayer player, int index){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) player.getDataWatcher().getWatchableObjectInt(index); -// } -// return 0f; -// } -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/21d810ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/21d810ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 66baf99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/21d810ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/70c3c5e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/70c3c5e4c42100141fce95f06aba7e85 deleted file mode 100644 index 1e6243d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/70c3c5e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,367 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/71de04f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/71de04f9c42100141fce95f06aba7e85 deleted file mode 100644 index 44f2163..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/71de04f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/729f3fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/729f3fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7740f36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/729f3fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDigspeed extends SubItemPotionHalfPower { - - public SubItemPotionDigspeed(Item itemID, int subID) { - super(itemID, subID, "Haste"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8085ccf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8085ccf7c42100141fce95f06aba7e85 deleted file mode 100644 index b1bd674..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/8085ccf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/82305be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/82305be6c42100141fce95f06aba7e85 deleted file mode 100644 index 0fc7033..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/82305be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class MobSpawnerWithMeta extends BlockWithMeta { - - String mobName; - - public MobSpawnerWithMeta(String mobName) { - super(Blocks.mob_spawner); - this.mobName = mobName; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - /* Create Mob Spawner */ - world.setBlock(position.posX, position.posY, position.posZ, block); - TileEntityMobSpawner tileEntityMobSpawner = (TileEntityMobSpawner) world.getTileEntity(position.posX, - position.posY, position.posZ); - - if (tileEntityMobSpawner != null) { - tileEntityMobSpawner.func_145881_a().setEntityName(mobName); - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/82ad53ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/82ad53ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8bae7af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/82ad53ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/c1530de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/c1530de5c42100141fce95f06aba7e85 deleted file mode 100644 index 5b7e48a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/c1530de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e01bd5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e01bd5f8c42100141fce95f06aba7e85 deleted file mode 100644 index bbcd41c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e01bd5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e03457f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e03457f4c42100141fce95f06aba7e85 deleted file mode 100644 index ae6a990..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e03457f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,225 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e1c936e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e1c936e4c42100141fce95f06aba7e85 deleted file mode 100644 index 01fb9a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a/e1c936e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutItem; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/102a90f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/102a90f5c42100141fce95f06aba7e85 deleted file mode 100644 index a38d948..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/102a90f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityEagle; -import com.ngb.projectzulu.common.mobs.models.ModelEagle; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/10a083e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/10a083e6c42100141fce95f06aba7e85 deleted file mode 100644 index dd67271..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/10a083e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,141 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/301d1ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/301d1ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 4e3b1be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/301d1ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/512246f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/512246f8c42100141fce95f06aba7e85 deleted file mode 100644 index f68cf8b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/512246f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,164 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import com.ngb.projectzulu.common.blocks.FurPeltDeclaration; -import com.ngb.projectzulu.common.blocks.ItemBlockRecipeManager; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import com.ngb.projectzulu.common.blocks.terrain.AloeVeraFeature; -import com.ngb.projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import com.ngb.projectzulu.common.blocks.terrain.NightBloomFeature; -import com.ngb.projectzulu.common.blocks.terrain.PalmTreeFeature; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.PotionEvents; -import com.ngb.projectzulu.common.potion.EventHandleNullPotions; -import com.ngb.projectzulu.common.potion.PZExtraPotionDeclaration; -import com.ngb.projectzulu.common.potion.PZVanillaPotionDeclaration; -import com.ngb.projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/627933e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/627933e5c42100141fce95f06aba7e85 deleted file mode 100644 index a6c438d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/627933e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,404 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/80032ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/80032ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 285c0e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/80032ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/801c8ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/801c8ee5c42100141fce95f06aba7e85 deleted file mode 100644 index 6106606..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/801c8ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,529 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelCrocodile extends ModelBase { - ModelRenderer MOUTHBOTROT; - ModelRenderer MOUTHTOPROT; - ModelRenderer BODY1ROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - private ModelRenderer BODY2ROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer BODY3ROT; - private ModelRenderer BODY4ROT; - private ModelRenderer BODY5ROT; - private ModelRenderer BODY6ROT; - private ModelRenderer TAIL1ROT; - private ModelRenderer TAIL2ROT; - private ModelRenderer TAIL3ROT; - private ModelRenderer TAILROT4; - private ModelRenderer TAILROT5; - private ModelRenderer TAILROT6; - private ModelRenderer TAILROT7; - private ModelRenderer TAILROT8; - private ModelRenderer TAILROT9; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - - public ModelCrocodile() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("BODY1ROT.Body1", 62, 0); - setTextureOffset("BODY1ROT.bodydeclef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig1", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig1", 0, 0); - setTextureOffset("BODY1ROT.Shape1", 0, 0); - setTextureOffset("BODY1ROT.bodydeclef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig2", 0, 0); - setTextureOffset("BODY2ROT.Body2", 62, 0); - setTextureOffset("BODY2ROT.bodydeclef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydeclef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig4", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig4", 0, 0); - setTextureOffset("LEG2TOPROT.leg2top", 20, 12); - setTextureOffset("LEG2TOPROT.leg2deco", 16, 8); - setTextureOffset("LEG2BOTROT.leg2bot", 16, 20); - setTextureOffset("LEG1TOPROT.leg1top", 0, 12); - setTextureOffset("LEG1TOPROT.leg1deco", 0, 8); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 20); - setTextureOffset("BODY3ROT.Body3", 62, 0); - setTextureOffset("BODY3ROT.bodydeclef5", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef5", 0, 0); - setTextureOffset("BODY3ROT.bodydeclef6", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef6", 0, 0); - setTextureOffset("BODY4ROT.Body4", 62, 0); - setTextureOffset("BODY4ROT.bodydecinrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinrig8", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef8", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef8", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig8", 0, 0); - setTextureOffset("BODY5ROT.Body5", 62, 0); - setTextureOffset("BODY5ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig10", 0, 0); - setTextureOffset("BODY6ROT.Body6", 62, 0); - setTextureOffset("BODY6ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig10", 0, 0); - setTextureOffset("TAIL1ROT.tail1", 62, 12); - setTextureOffset("TAIL1ROT.bodydecinlef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecinrig11", 0, 0); - setTextureOffset("TAIL1ROT.bodydeclef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecrig11", 0, 0); - setTextureOffset("TAIL2ROT.tail2", 62, 22); - setTextureOffset("TAIL2ROT.bodydeclef12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinlef12", 0, 0); - setTextureOffset("TAIL3ROT.tail3", 62, 31); - setTextureOffset("TAIL3ROT.bodydecrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinlef13", 0, 0); - setTextureOffset("TAIL3ROT.bodydeclef13", 0, 0); - setTextureOffset("TAILROT4.tail4", 62, 40); - setTextureOffset("TAILROT4.bodydecrig14", 0, 0); - setTextureOffset("TAILROT4.bodydecinlef14", 0, 0); - setTextureOffset("TAILROT4.bodydeclef14", 0, 0); - setTextureOffset("TAILROT5.tail5", 62, 48); - setTextureOffset("TAILROT5.bodydeclef15", 0, 0); - setTextureOffset("TAILROT5.bodydecrig16", 0, 0); - setTextureOffset("TAILROT5.bodydecrig15", 0, 0); - setTextureOffset("TAILROT5.bodydeclef16", 0, 0); - setTextureOffset("TAILROT6.tail6", 84, 49); - setTextureOffset("TAILROT6.bodydeclef17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig18", 0, 0); - setTextureOffset("TAILROT6.bodydeclef18", 0, 0); - setTextureOffset("TAILROT7.tail7", 90, 44); - setTextureOffset("TAILROT7.bodydecrig19", 0, 0); - setTextureOffset("TAILROT7.bodydeclef19", 0, 0); - setTextureOffset("TAILROT8.tail8", 94, 40); - setTextureOffset("TAILROT8.bodydecrig20", 0, 0); - setTextureOffset("TAILROT8.bodydeclef20", 0, 0); - setTextureOffset("TAILROT9.tail9", 98, 37); - setTextureOffset("LEG4TOPROT.leg4top", 20, 12); - setTextureOffset("LEG4TOPROT.leg4deco", 16, 8); - setTextureOffset("LEG4BOTROT.leg4bot", 16, 20); - setTextureOffset("LEG3TOPROT.leg3top", 0, 12); - setTextureOffset("LEG3TOPROT.leg3deco", 0, 8); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 20); - - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 17F, -7F); - setRotation(BODY1ROT, 0F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("Body1", -7F, -4F, 0F, 14, 8, 4); - BODY1ROT.addBox("bodydeclef1", -5.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef1", -2F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig1", 1F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig1", 4.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("Shape1", 0F, 0F, 0F, 1, 1, 1); - BODY1ROT.addBox("bodydeclef2", -5.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef2", -2F, -5F, 2.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig2", 4.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig2", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("Body2", -7F, -4F, 0F, 14, 8, 4); - BODY2ROT.addBox("bodydeclef3", -5.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef3", -2F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig3", 4.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig3", 1F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydeclef4", -5.5F, -5F, 3F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef4", -2F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig4", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig4", 4.5F, -5F, 3F, 1, 1, 1); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(7F, 1F, 2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", 0F, -2F, -2F, 6, 4, 4); - LEG2TOPROT.addBox("leg2deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2F, 0F, -2F, 4, 4, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY2ROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-8F, 1F, 2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -5F, -2F, -2F, 6, 4, 4); - LEG1TOPROT.addBox("leg1deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -2F, 0F, -2F, 4, 4, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY2ROT.addChild(LEG1TOPROT); - BODY3ROT = new ModelRenderer(this, "BODY3ROT"); - BODY3ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY3ROT, 0F, 0F, 0F); - BODY3ROT.mirror = true; - BODY3ROT.addBox("Body3", -7F, -4F, 0F, 14, 8, 4); - BODY3ROT.addBox("bodydeclef5", -5.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig5", 4.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig5", 1F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef5", -2F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydeclef6", -5.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig6", 4.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig6", 1F, -5F, 2.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef6", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT = new ModelRenderer(this, "BODY4ROT"); - BODY4ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY4ROT, 0F, 0F, 0F); - BODY4ROT.mirror = true; - BODY4ROT.addBox("Body4", -7F, -4F, 0F, 14, 8, 4); - BODY4ROT.addBox("bodydecinrig7", 1F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef7", -2F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig7", 4.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef7", -5.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydecinrig8", 1F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef8", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef8", -5.5F, -5F, 3F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig8", 4.5F, -5F, 3F, 1, 1, 1); - BODY5ROT = new ModelRenderer(this, "BODY5ROT"); - BODY5ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY5ROT, 0F, 0F, 0F); - BODY5ROT.mirror = true; - BODY5ROT.addBox("Body5", -7F, -4F, 0F, 14, 8, 4); - BODY5ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - BODY6ROT = new ModelRenderer(this, "BODY6ROT"); - BODY6ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY6ROT, 0F, 0F, 0F); - BODY6ROT.mirror = true; - BODY6ROT.addBox("Body6", -7F, -4F, 0F, 14, 8, 4); - BODY6ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - TAIL1ROT = new ModelRenderer(this, "TAIL1ROT"); - TAIL1ROT.setRotationPoint(0F, 0F, 4F); - setRotation(TAIL1ROT, 0F, 0F, 0F); - TAIL1ROT.mirror = true; - TAIL1ROT.addBox("tail1", -6F, -3.5F, 0F, 12, 7, 3); - TAIL1ROT.addBox("bodydecinlef11", -2F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydecinrig11", 1F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydeclef11", -5F, -4.5F, 1F, 1, 1, 1); - TAIL1ROT.addBox("bodydecrig11", 4F, -4.5F, 1F, 1, 1, 1); - TAIL2ROT = new ModelRenderer(this, "TAIL2ROT"); - TAIL2ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL2ROT, 0F, 0F, 0F); - TAIL2ROT.mirror = true; - TAIL2ROT.addBox("tail2", -5.5F, -2.5F, 0F, 11, 6, 3); - TAIL2ROT.addBox("bodydeclef12", -4.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecrig12", 3.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinrig12", 1F, -3.5F, 0.5F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinlef12", -2F, -3.5F, 0.5F, 1, 1, 1); - TAIL3ROT = new ModelRenderer(this, "TAIL3ROT"); - TAIL3ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL3ROT, 0F, 0F, 0F); - TAIL3ROT.mirror = true; - TAIL3ROT.addBox("tail3", -4.5F, -1.5F, 0F, 9, 5, 4); - TAIL3ROT.addBox("bodydecrig13", 2.5F, -2.5F, 1.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinrig13", 0.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinlef13", -1.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydeclef13", -4F, -2.5F, 1.5F, 1, 1, 1); - TAILROT4 = new ModelRenderer(this, "TAILROT4"); - TAILROT4.setRotationPoint(0F, 1.5F, 4F); - setRotation(TAILROT4, 0F, 0F, 0F); - TAILROT4.mirror = true; - TAILROT4.addBox("tail4", -4F, -2F, 0F, 8, 4, 4); - TAILROT4.addBox("bodydecrig14", 2F, -3F, 1.5F, 1, 1, 1); - TAILROT4.addBox("bodydecinlef14", -0.5F, -3F, 0.5F, 1, 1, 1); - TAILROT4.addBox("bodydeclef14", -3F, -3F, 1.5F, 1, 1, 1); - TAILROT5 = new ModelRenderer(this, "TAILROT5"); - TAILROT5.setRotationPoint(0F, 0.5F, 4F); - setRotation(TAILROT5, 0F, 0F, 0F); - TAILROT5.mirror = true; - TAILROT5.addBox("tail5", -3F, -1.5F, 0F, 6, 3, 5); - TAILROT5.addBox("bodydeclef15", -2F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig16", 1F, -2.5F, 3.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig15", 1F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydeclef16", -2F, -2.5F, 3.5F, 1, 1, 1); - TAILROT6 = new ModelRenderer(this, "TAILROT6"); - TAILROT6.setRotationPoint(0F, 0.5F, 5F); - setRotation(TAILROT6, 0F, 0F, 0F); - TAILROT6.mirror = true; - TAILROT6.addBox("tail6", -2.5F, -1F, 0F, 5, 2, 5); - TAILROT6.addBox("bodydeclef17", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig17", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig18", 0.5F, -2F, 3F, 1, 1, 1); - TAILROT6.addBox("bodydeclef18", -1.5F, -2F, 3F, 1, 1, 1); - TAILROT7 = new ModelRenderer(this, "TAILROT7"); - TAILROT7.setRotationPoint(0F, 0F, 5F); - setRotation(TAILROT7, 0F, 0F, 0F); - TAILROT7.mirror = true; - TAILROT7.addBox("tail7", -2F, -1F, 0F, 4, 2, 3); - TAILROT7.addBox("bodydecrig19", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT7.addBox("bodydeclef19", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT8 = new ModelRenderer(this, "TAILROT8"); - TAILROT8.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT8, 0F, 0F, 0F); - TAILROT8.mirror = true; - TAILROT8.addBox("tail8", -1.5F, -1F, 0F, 3, 2, 2); - TAILROT8.addBox("bodydecrig20", 0.5F, -2F, 0.5F, 1, 1, 1); - TAILROT8.addBox("bodydeclef20", -1.5F, -2F, 0.5F, 1, 1, 1); - TAILROT9 = new ModelRenderer(this, "TAILROT9"); - TAILROT9.setRotationPoint(0F, 0F, 2F); - setRotation(TAILROT9, 0F, 0F, 0F); - TAILROT9.mirror = true; - TAILROT9.addBox("tail9", -1F, -1F, 0F, 2, 2, 1); - TAILROT8.addChild(TAILROT9); - TAILROT7.addChild(TAILROT8); - TAILROT6.addChild(TAILROT7); - TAILROT5.addChild(TAILROT6); - TAILROT4.addChild(TAILROT5); - TAIL3ROT.addChild(TAILROT4); - TAIL2ROT.addChild(TAIL3ROT); - TAIL1ROT.addChild(TAIL2ROT); - BODY6ROT.addChild(TAIL1ROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(7F, 1F, 0F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", 0F, -2F, -2F, 6, 4, 4); - LEG4TOPROT.addBox("leg4deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -2F, 0F, -2F, 4, 4, 4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODY6ROT.addChild(LEG4TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-8F, 1F, 0F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -5F, -2F, -2F, 6, 4, 4); - LEG3TOPROT.addBox("leg3deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -2F, 0F, -2F, 4, 4, 4); - LEG3TOPROT.addChild(LEG3BOTROT); - BODY6ROT.addChild(LEG3TOPROT); - BODY5ROT.addChild(BODY6ROT); - BODY4ROT.addChild(BODY5ROT); - BODY3ROT.addChild(BODY4ROT); - BODY2ROT.addChild(BODY3ROT); - BODY1ROT.addChild(BODY2ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 6.0F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.7F / var8, 1.7F / var8, 1.7F / var8); - GL11.glTranslatef(0.0f, field_78145_g * f5, field_78151_h * f5); - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODY1ROT.render(f5); - GL11.glPopMatrix(); - } else { - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - BODY1ROT.render(f5); - - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG2TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG1TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODY1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 0 / 4 * (float) Math.PI) * 0.1F * par3; - BODY2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; - BODY3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 2 / 4 * (float) Math.PI) * 0.1F * par3; - BODY4ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 3 / 4 * (float) Math.PI) * 0.1F * par3; - BODY5ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 4 / 4 * (float) Math.PI) * 0.1F * par3; - BODY6ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 5 / 4 * (float) Math.PI) * 0.1F * par3; - - TAIL1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 6 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 7 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 8 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT4.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 9 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT5.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 10 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT6.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 11 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT7.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 12 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT8.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 13 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT9.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 14 / 4 * (float) Math.PI) * 0.1F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - MOUTHTOPROT.rotateAngleX = -Math.abs(MathHelper.cos(f * 0.6662F) * f1) + Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - MOUTHTOPROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - - MOUTHBOTROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - MOUTHBOTROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/90d722e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/90d722e5c42100141fce95f06aba7e85 deleted file mode 100644 index c04ac8a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/90d722e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/90de989ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/90de989ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb76d8d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/90de989ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserOrigin extends KeyParserRange { - - public KeyParserOrigin(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return (int) Math.sqrt(world.getSpawnPoint().getDistanceSquared(xCoord, yCoord, zCoord)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a0965aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a0965aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a54893..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/a0965aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/b092f4fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/b092f4fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cc8eff8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/b092f4fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/e0d59dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/e0d59dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 150d09f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a0/e0d59dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/00ef91ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/00ef91ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54b0d8c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/00ef91ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/206c1601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/206c1601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index df43b34..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/206c1601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.models.ModelEagle; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EagleDeclaration extends SpawnableDeclaration { - - public EagleDeclaration() { - super("Eagle", 35, EntityEagle.class, EnumCreatureType.ambient); - setSpawnProperties(5, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (224 << 16) + (224 << 8) + 224; - eggColor2 = (28 << 16) + (21 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelEagle(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "eagle.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHillsEdge.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.MOUNTAIN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/403a2586c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/403a2586c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ca5635f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/403a2586c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/40e49200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/40e49200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8d35844..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/40e49200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,232 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/61443ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/61443ef6c42100141fce95f06aba7e85 deleted file mode 100644 index 49f38c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/61443ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/61c4d4ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/61c4d4ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cc8eff8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/61c4d4ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/70e5dbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/70e5dbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3b2fd1d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/70e5dbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,84 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/a001bac39b22001414aab7e331350948 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/a001bac39b22001414aab7e331350948 deleted file mode 100644 index 2196e35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/a001bac39b22001414aab7e331350948 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), new YellowFinchDeclaration() - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b17f14e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b17f14e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5d91deb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b17f14e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,241 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Reminder: This is technically a 'Flying' Entity - */ -public class EntityFollower extends EntityLiving { - - EntityMaster masterEntity; - int followerIndex = -1; - - public int getFollowerIndex() { - return followerIndex; - } - - private Vec3 targetPosition = Vec3.createVectorHelper(0, 0, 0); - - public void setTargetPosition(Vec3 targetPosition) { - this.targetPosition = targetPosition; - } - - float targetRotation; - - public void setTargetRotation(float targetRotation) { - this.targetRotation = wrapAngleTo360(targetRotation); - } - - boolean shouldBeDying = false; - - /* Client Side Variable that Controls if it should Sync its Contents with Client Master */ - boolean isClientSetup = false; - - public EntityFollower(World par1World) { - super(par1World); - noClip = true; - setSize(0.65f, 0.5f); - } - - public EntityFollower(World par1World, double parx, double pary, double parz, EntityMaster masterEntity, - int followerIndex) { - this(par1World); - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.followerIndex = followerIndex; - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns False so that Entity doesn't Suffocate while in a wall - */ - @Override - public boolean isEntityInsideOpaqueBlock() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - - /* - * Note that the Client Side Entity will exists for several ticks before the masterEntity is Synced from server, - * So we only Check if should SetDead on Server - * - * Also, onReload, the Server will re-create its Children, this the old Children must dye. - */ - if (masterEntity == null && ticksExisted > 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b1fa44e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b1fa44e4c42100141fce95f06aba7e85 deleted file mode 100644 index 7cadc94..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/b1fa44e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.heads.BlockMobHeads; -import projectzulu.common.blocks.heads.ItemMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d01339e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d01339e4c42100141fce95f06aba7e85 deleted file mode 100644 index fdcde8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d01339e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d0ccabf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d0ccabf9c42100141fce95f06aba7e85 deleted file mode 100644 index 8a0e161..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/d0ccabf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketPlaySound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/e087449fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/e087449fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index db8b279..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a1/e087449fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,178 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/004e2df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/004e2df9c42100141fce95f06aba7e85 deleted file mode 100644 index f1bba79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/004e2df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,143 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidBreedingItem() function - */ -public abstract class EntityGenericBreedable extends EntityGenericAgeable{ - - protected int loveTimer = 0; - public boolean isInLove(){return loveTimer > 0 ? true: false;} - public void resetInLove(){ loveTimer = 0; } - - /* How long an Entity should be in Love Mode when Fed */ - protected int loveCooldown = 600; - - public EntityGenericBreedable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* Breeding is all Done Server Side, and only while growingAge is 0 - * Thus on Client, we know that if growage is not 0 we are not breeding / in love anymore*/ - if (this.getGrowingAge() != 0) { - this.loveTimer = 0; - } - - /* Decrement loveTimer for the purpose of hearts */ - if(getEntityState() == EntityStates.inLove){ - loveTimer--; - if(loveTimer % 10 == 0){ - String var1 = "heart"; - double var2 = this.rand.nextGaussian() * 0.02D; - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var1, - this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, - this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), - this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); - } - } - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding - * This is overriden by each Entity if deviations from default are desired - */ - public boolean isValidBreedingItem(ItemStack itemStack){ - return false; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if (var2 != null && this.isValidBreedingItem(var2) && this.getGrowingAge() == 0) { - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - - this.loveTimer = loveCooldown; - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } - - return true; - } - else { - return super.interact(par1EntityPlayer); - } - } - - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityGenericBreedable targetEntity){ - /* If Passed Entity is Self or Different Type, return False */ - if(targetEntity == this || targetEntity.getClass() != this.getClass()){ - return false; - } - /* Otherwise, if Target is in Love, and Self is. Then let them mate */ - if(this.isInLove() && targetEntity.isInLove()){ - return true; - } - - return false; - } - - /** - * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal of their Type. - */ - public EntityGenericBreedable getBabyAnimalEntity(Entity par1EntityAnimal) { - Object object = null; - try { - Class thisClass = par1EntityAnimal.getClass(); - Constructor ctor= thisClass.getConstructor(World.class); - try { - object = ctor.newInstance(new Object[] { this.worldObj }); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - return (EntityGenericBreedable) object; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/01e5099ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/01e5099ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 98a7f14..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/01e5099ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockWateredDirt; -import projectzulu.common.blocks.ItemWateredDirt; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0222bc01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0222bc01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7fe473c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/0222bc01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/201cf99dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/201cf99dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3005cbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/201cf99dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLog; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/30d9212bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/30d9212bc52100141fce95f06aba7e85 deleted file mode 100644 index 26593f9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/30d9212bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/31b6bfa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/31b6bfa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7cb705d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/31b6bfa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.util.MathHelper; - -public class ModelHelper { - - /** - * Absolute Value alternative to {@link MathHelper#abs(float par0)} for Double values - */ - public static double abs(double value) { - if (value < 0) { - return 0f; - } else { - return value; - } - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value may be outside - * the range of values. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value will be clamped - * to the min.max values of the target range. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueWithClamp(float value, float set1min, float set1max, float set2min, float set2max) { - float value2 = (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - value2 = MathHelper.clamp_float(value2, set2min, set2max); - return value2; - } - - /** - * Vanilla Function used for Rotations - * - * @param par1 - * @param par2 - * @return - */ - // TODO: Rename To Something Decent, deobfuscate parameters - public static float func_78172_a(float par1, float par2) { - return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); - } - - /** - * Sets the RotationPoint of the provided Model using the value interpolated to the desired ranges foreach direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotationPoint(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotationPointX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotationPointY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotationPointZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } - - /** - * Sets the Rotation of the provided Model using the value interpolated to the desired ranges for each direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotation(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotateAngleX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotateAngleY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotateAngleZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/32c0e9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/32c0e9f9c42100141fce95f06aba7e85 deleted file mode 100644 index e482bb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/32c0e9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/411e49fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/411e49fac42100141fce95f06aba7e85 deleted file mode 100644 index b96d91e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/411e49fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/60373dfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/60373dfac42100141fce95f06aba7e85 deleted file mode 100644 index b1bd674..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/60373dfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockTumbleweed extends Block { - - public BlockTumbleweed() { - super(Material.plants); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.7F); - setStepSound(Block.soundTypeWood); - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - super.onBlockAdded(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/7031109fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/7031109fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 38dbb9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/7031109fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCentipede; -import projectzulu.common.mobs.models.ModelCentipede; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/706858ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/706858ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d3c636f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/706858ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/70d9719fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/70d9719fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d9e3e93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/70d9719fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/81f13b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/81f13b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 65979d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/81f13b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/a0d2c8fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/a0d2c8fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index db49962..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/a0d2c8fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.models.ModelArmadillo; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ArmadilloDeclaration extends SpawnableDeclaration { - - public ArmadilloDeclaration() { - super("Armadillo", 0, EntityArmadillo.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 2, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (116 << 16) + (64 << 8) + 33; - eggColor2 = (60 << 16) + (51 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/b12951f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/b12951f9c42100141fce95f06aba7e85 deleted file mode 100644 index 7fc1e9a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/b12951f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,206 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c0dd73e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c0dd73e5c42100141fce95f06aba7e85 deleted file mode 100644 index 7a14c74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c0dd73e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseWhite; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c2477201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c2477201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 747abb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c2477201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.PotionList; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.potion.effects.PotionCleansing; -import projectzulu.common.potion.effects.PotionCurse; -import projectzulu.common.potion.effects.PotionHarm2; -import projectzulu.common.potion.effects.PotionHeal2; -import projectzulu.common.potion.effects.PotionIncendiary; -import projectzulu.common.potion.effects.PotionSlowFall; -import projectzulu.common.potion.effects.PotionThorns; -import projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c2f31fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c2f31fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a9ccaf7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/c2f31fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0abe8fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0abe8fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0890879..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/d0abe8fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLeaves; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e00708f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e00708f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1f5e820..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e00708f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,334 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e0539de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e0539de4c42100141fce95f06aba7e85 deleted file mode 100644 index 7e219a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a2/e0539de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/00035f00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/00035f00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa6ed0e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/00035f00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/218d86f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/218d86f5c42100141fce95f06aba7e85 deleted file mode 100644 index 67f8f65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/218d86f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityGiraffe; -import com.ngb.projectzulu.common.mobs.models.ModelGiraffe; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/32bb56a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/32bb56a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2892f7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/32bb56a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLeaves; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/417b7ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/417b7ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 8a790af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/417b7ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/50291dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/50291dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d147f14..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/50291dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/51b64fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/51b64fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 12f3177..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/51b64fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.brewingstands.PotionIngredients; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GenericCraftingItemsDeclaration extends ItemDeclaration { - - public GenericCraftingItemsDeclaration() { - super("GenericCraftingItems1"); - } - - @Override - protected boolean createItem() { - ItemGenerics itemGenerics = (ItemGenerics) new ItemGenerics(); - ItemList.genericCraftingItems = Optional.of(itemGenerics); - PotionIngredients.addIngredientProperties(itemGenerics, itemGenerics); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.genericCraftingItems.get(); - OreDictionary.registerOre("foodSalt", new ItemStack(item, 1, ItemGenerics.Properties.Salt.meta())); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/60b9a5c6fa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/60b9a5c6fa2000141769cb1ed0c338cd deleted file mode 100644 index c97dc99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/60b9a5c6fa2000141769cb1ed0c338cd +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.API; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/60c63afac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/60c63afac42100141fce95f06aba7e85 deleted file mode 100644 index d981b13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/60c63afac42100141fce95f06aba7e85 +++ /dev/null @@ -1,12 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; -import net.minecraft.init.Blocks; - -public class BlockZuluStairs extends BlockStairs { - public BlockZuluStairs(Block par2Block, int par3) { - super(par2Block, par3); - setLightOpacity(0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/710b36fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/710b36fac42100141fce95f06aba7e85 deleted file mode 100644 index 89fcf33..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/710b36fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/71bb01f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/71bb01f7c42100141fce95f06aba7e85 deleted file mode 100644 index b035bff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/71bb01f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.ItemUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import com.ngb.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/819e30f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/819e30f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1eec992..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/819e30f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/90c5349ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/90c5349ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4d3ac86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/90c5349ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiContainerUniversalFlowerPot extends GuiContainer { - public final static ResourceLocation FLOWERPOT_GUI = new ResourceLocation(DefaultProps.coreKey, - "gui/FlowerPotGUI.png"); - - public GuiContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntity) { - super(new ContainerUniversalFlowerPot(inventoryPlayer, tileEntity)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Flower Pot", 8, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(FLOWERPOT_GUI); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/c069b99fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/c069b99fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ef33a4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/c069b99fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class TileEntityWithMeta extends BlockWithMeta { - - public TileEntity tileEntity; - - public TileEntityWithMeta(Block block, int meta, TileEntity tileEntity) { - super(block, meta); - this.tileEntity = tileEntity; - } - - public TileEntityWithMeta(Block block, TileEntity tileEntity) { - this(block, 0, tileEntity); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/d00b75f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/d00b75f6c42100141fce95f06aba7e85 deleted file mode 100644 index 194c9da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a3/d00b75f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/11c38affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/11c38affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 91d5539..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/11c38affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,230 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/307879e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/307879e4c42100141fce95f06aba7e85 deleted file mode 100644 index 0f74ce8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/307879e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class NightBloomFeature extends BiomeFeature { - private int density = 2; - - public NightBloomFeature() { - super("Night Bloom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.nightBloom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 2; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/40abe0ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/40abe0ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 69b4fa5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/40abe0ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,419 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/600fa3f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/600fa3f8c42100141fce95f06aba7e85 deleted file mode 100644 index b5a49a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/600fa3f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,326 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/604ee19dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/604ee19dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d922708..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/604ee19dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/61f1ab9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/61f1ab9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d53c409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/61f1ab9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,133 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/706deffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/706deffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 581e0fe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/706deffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.models.ModelSandWorm; -import projectzulu.common.mobs.renders.RenderGenericIdle; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80d862f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80d862f5c42100141fce95f06aba7e85 deleted file mode 100644 index 7082a77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/80d862f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntitySandWorm; -import com.ngb.projectzulu.common.mobs.models.ModelSandWorm; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericIdle; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/a1c916e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/a1c916e5c42100141fce95f06aba7e85 deleted file mode 100644 index d66a2f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/a1c916e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c02121c89a22001414aab7e331350948 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c02121c89a22001414aab7e331350948 deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c02121c89a22001414aab7e331350948 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c1787af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c1787af8c42100141fce95f06aba7e85 deleted file mode 100644 index ca0cf7c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/c1787af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingSingle extends TileEntityBrewingBase { - - public TileEntityBrewingSingle() { - brewingItemStacks = new ItemStack[2]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/d1330ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/d1330ff8c42100141fce95f06aba7e85 deleted file mode 100644 index e14370e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a4/d1330ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MimicWithMeta; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetTreasureDeadEnd implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetTreasureDeadEnd() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "deadend"; - } - - @Override - public int getWeight() { - return 50; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - cells[buildCoords.x][buildCoords.y].rawState = 2; - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 && ArchitectBase.isDeadEnd(cells, buildCoords, 1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1) { - if (random.nextInt(5) == 0) { - PyramidFeature terrainFeature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), terrainFeature.chestLootChance, - terrainFeature.chestMaxLoot); - - } else if (random.nextInt(4) == 0) { - return new MimicWithMeta(); - } - } - return new BlockWithMeta(Blocks.air); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/0122bc01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/0122bc01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 49e5c6a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/0122bc01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,225 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/0179f8ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/0179f8ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d147f14..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/0179f8ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/401e1d2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/401e1d2bc52100141fce95f06aba7e85 deleted file mode 100644 index 2900eb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/401e1d2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/408d70e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/408d70e6c42100141fce95f06aba7e85 deleted file mode 100644 index 658ee19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/408d70e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/40babc9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/40babc9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 570d7b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/40babc9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/60c19000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/60c19000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c5fd12..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/60c19000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/701a5901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/701a5901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index df69443..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/701a5901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,872 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/708684f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/708684f4c42100141fce95f06aba7e85 deleted file mode 100644 index a840d39..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/708684f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCarved; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/709a33fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/709a33fac42100141fce95f06aba7e85 deleted file mode 100644 index c9f4922..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/709a33fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/a11efd9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/a11efd9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2eca65e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/a11efd9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtByTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theOwnerAttacker; - - public EntityAIOwnerHurtByTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - }else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - } - else{ - this.theOwnerAttacker = var1.getAITarget(); - return this.isSuitableTarget(this.theOwnerAttacker, false); - } - } - } - -// /** -// * Returns whether an in-progress EntityAIBase should continue executing -// */ -// public boolean continueExecuting() { -// return shouldExecute(); -// } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/b0d667f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/b0d667f4c42100141fce95f06aba7e85 deleted file mode 100644 index 3b98b63..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/b0d667f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/c0836801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/c0836801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 99f53ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/c0836801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.Properties; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/c0c1e2f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/c0c1e2f6c42100141fce95f06aba7e85 deleted file mode 100644 index 13eaabc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/c0c1e2f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,605 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCampFire implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - RenderItem itemRenderer = new RenderItem(); - - ItemStack itemStackToRender = new ItemStack(block, 1, metadata); - - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 1.5f; - GL11.glPushMatrix(); - - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef((float) (90f * Math.PI / 180f), 1, 0, 0); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - /** - * Render Campfire Stones - */ - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case WoodFire: - case StoneFire: - /* Render If Should and Render Campfire Fire */ - renderBlockFire(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - break; - case Stone: - case Wood: - break; - } - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case Wood: - case WoodFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.35, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.24, var20, var15 + 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.24, var20, var15 - 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.21, var20, var15 + 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.21, var20, var15 - 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - break; - case Stone: - case StoneFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Stones */ - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 + 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 - 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - break; - } - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle2Sides(Block par1Block, int index1, int index2, int par2, double par3, - double par5, double par7, RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - double var13 = var10.getMinU(); - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2.01f; - double var17 = var10.getMinV(); - double var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) / 2.01f; - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 0.99f / 4f; - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 2.99f / 4f; - var17 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 0.99f / 4f; - var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 2.99f / 4f; - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle(Block par1Block, int var10, int par2, double par3, double par5, double par7, - RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 3, 2); - double var13 = icon.getMinU(); - double var15 = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / 2.01f; - double var17 = icon.getMinV(); - double var19 = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / 2.01f; - - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - return true; - } - - /** - * Renders a fire block at the given coordinates - */ - public boolean renderBlockFire(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - Tessellator var5 = Tessellator.instance; - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.fire, 0, 0); - double var9 = icon.getMinU(); - double var11 = icon.getMaxU(); - double var13 = icon.getMinV(); - double var15 = icon.getMaxV(); - - float var17 = 1.4F; - double var20; - double var22; - double var24; - double var26; - double var28; - double var30; - double var32; - - if (!World.doesBlockHaveSolidTopSurface(blockAccess, par2, par3 - 1, par4) - && !Blocks.fire.canCatchFire(blockAccess, par2, par3 - 1, par4, ForgeDirection.UP)) { - float var36 = 0.2F; - float var19 = 0.0625F; - - if ((par2 + par3 + par4 & 1) == 1) { - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - } - - if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { - var20 = var11; - var11 = var9; - var9 = var20; - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 - 1, par3, par4, ForgeDirection.EAST)) { - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 + 1, par3, par4, ForgeDirection.WEST)) { - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - var20 = par2 + 0.5D + 0.5D; // 1 - var22 = par2 + 0.5D - 0.5D; // 0 - var24 = par4 + 0.5D + 0.5D; - var26 = par4 + 0.5D - 0.5D; - - var28 = par2 + 0.5D - 0.5D; - var30 = par2 + 0.5D + 0.5D; - var32 = par4 + 0.5D - 0.5D; - double var34 = par4 + 0.5D + 0.5D; - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - ++par3; - var17 = -0.2F; - - if ((par2 + par3 + par4 & 1) == 0) { - var5.addVertexWithUV(var28, par3 + var17, par4 + 0, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 1, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 1, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(var30, par3 + var17, par4 + 1, var11, var13); - var5.addVertexWithUV(var22, par3 + 0, par4 + 1, var11, var15); - var5.addVertexWithUV(var22, par3 + 0, par4 + 0, var9, var15); - var5.addVertexWithUV(var30, par3 + var17, par4 + 0, var9, var13); - } else { - var5.addVertexWithUV(par2 + 0, par3 + var17, var34, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0, var26, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0, var26, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17, var34, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 1, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17, var32, var9, var13); - } - } - } else { - double var18 = par2 + 0.5D + 0.2D; - var20 = par2 + 0.5D - 0.2D; // - var22 = par4 + 0.5D + 0.2D; - var24 = par4 + 0.5D - 0.2D; - var26 = par2 + 0.5D - 0.3D; - var28 = par2 + 0.5D + 0.3D; - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - - var18 = par2 + 0.5D - 0.3D; // - var20 = par2 + 0.5D + 0.3D; // / - var22 = par4 + 0.5D - 0.3D; - var24 = par4 + 0.5D + 0.3D; - var26 = par2 + 0.5D - 0.3D; // - var28 = par2 + 0.5D + 0.3D; // / - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - } - - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/f08f3098052100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/f08f3098052100141769cb1ed0c338cd deleted file mode 100644 index 54b37e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a5/f08f3098052100141769cb1ed0c338cd +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/106ebbe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/106ebbe5c42100141fce95f06aba7e85 deleted file mode 100644 index 464644a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/106ebbe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/308306a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/308306a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8ab6a9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/308306a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.EnumSet; -import java.util.HashMap; - -/** - * Represent the readable Tags for OptionalSettings - */ -public enum Key { - /* Category Tags */ - spawn("spawn", KeyParserSpawn.class), despawn("despawn", KeyParserDespawn.class), - - /* Properties */ - sky("sky", KeyParserSky.class), block("block", KeyParserBlock.class), blockFoot("blockFoot", - KeyParserBlockFoot.class), light("light", KeyParserLight.class), entityCap("cap", KeyParserEntityCap.class), spawnRange( - "spawnRange", KeyParserSpawnRange.class), maxSpawnRange("maxSpawnRange", KeyParserMaxSpawnRange.class), despawnAge( - "despawnAge", KeyParserDespawnAge.class), spawnRate("spawnRate", KeyParserSpawnRate.class), blockRange( - "blockRange", KeyParserBlockRange.class), material("material", null), minSpawnHeight("minSpawnHeight", - KeyParserMinHeight.class), maxSpawnHeight("maxSpawnHeight", KeyParserMaxHeight.class), normal("normal", - KeyParserNormalCube.class), liquid("liquid", KeyParserLiquid.class), opaque("opaque", - KeyParserOpaqueBlock.class), solidSide("solidSide", KeyParserSolidSide.class), difficulty("difficulty", - KeyParserDifficulty.class), torchLight("torchLight", KeyParserTorchLight.class), ground("ground", - KeyParserGround.class), top("top", KeyParserTop.class), fill("fill", KeyParserFill.class), modspawn( - "modSpawn", KeyParserModSpawn.class), origin("origin", KeyParserOrigin.class), players("players", - KeyParserPlayers.class), entities("entities", KeyParserEntities.class), random("random", - KeyParserRandom.class), writenbt("writenbt", KeyParserWriteNBT.class), - - /* Sub Tags */ - blockRangeX("blockRangeX", null), blockRangeY("blockRangeY", null), blockRangeZ("blockRangeZ", null), - - /**/ - UNKNOWN("", null); - - public final String key; - private static final HashMap lookupEnum = new HashMap(); - static { - for (Key key : EnumSet.allOf(Key.class)) - lookupEnum.put(key.key.toUpperCase(), key); - } - - public KeyParser keyParser; - - Key(String key, Class keyParserClass) { - this.key = key; - if (keyParserClass != null) { - try { - keyParser = keyParserClass.getConstructor(new Class[] { Key.class }).newInstance(new Object[] { this }); - } catch (Exception exception) { - exception.printStackTrace(); - return; - } - } - } - - /** - * Gets the Key associated with the String. Is not case Sensitive - * - * @param string - * @return - */ - public static Key getKeybyString(String string) { - Key value = lookupEnum.get(string.toUpperCase()); - if (value != null) { - return value; - } else { - return UNKNOWN; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/40df8afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/40df8afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c9f545..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/40df8afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/60b722f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/60b722f4c42100141fce95f06aba7e85 deleted file mode 100644 index 42e7bd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/60b722f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,107 +0,0 @@ -//package projectzulu.experimental; -// -//import java.util.List; -//import java.util.Random; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.creativetab.CreativeTabs; -//import net.minecraft.item.ItemStack; -//import com.ngb.projectzulu.common.core.DefaultProps; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -// -//public class BlockHoloPalmTree extends Block{ -// -// public BlockHoloPalmTree(int par1, int par2){ -// super(par1, Material.wood); -// -// this.setTickRandomly(true); -// -// this.setCreativeTab(CreativeTabs.tabBlock); -// } -// -// //TODO Commented -//// public int getIcon(int par1, int par2) -//// { -//// switch (par2) { -//// case 0: -//// return 17; -//// case 1: -//// return 19; -//// case 2: -//// return 18; -//// default: -//// return 17; -//// } -//// } -// -// public int damageDropped(int par1) -// { -// return par1; -// } -// -// //This may be neccesary cause otherwise Install will fail on server? -// @SideOnly(Side.CLIENT) -// public String getTextureFile() -// { -// return DefaultProps.blockSpriteSheet; -// } -// -// public int idDropped(int par1, Random par2Random, int par3) -// { -// switch(par1) -// { -// case 0: -// return this.blockID; -// case 1: -// return this.blockID; -// default: -// return this.blockID; -// } -// } -// -// -// public int quantityDropped(Random par1Random) -// { -// return par1Random.nextInt(2) + 1; -// } -// -// @SideOnly(Side.CLIENT) -// public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) -// { -// for (int var4 = 0; var4 < 11; ++var4) -// { -// par3List.add(new ItemStack(par1, 1, var4)); -// } -// } -// -// -// @SideOnly(Side.CLIENT) -// /** -// * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -// */ -// public int getRenderBlockPass() -// { -// return 0; -// } -// -// /** -// * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -// * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -// */ -// public boolean isOpaqueCube() -// { -// return false; -// } -// -// /** -// * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -// */ -// public boolean renderAsNormalBlock() -// { -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/60ef76089eac0014171585e4f63f5ff8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/60ef76089eac0014171585e4f63f5ff8 new file mode 100644 index 0000000..6a7b538 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/60ef76089eac0014171585e4f63f5ff8 @@ -0,0 +1,52 @@ +package com.stek101.projectzulu.common.core; + + +public class DefaultProps { + + /* ModIDs, Dependencies, and Version */ + public static final String DesiredBefore = "after:ExtrabiomesXL@"; + public static final String VERSION_STRING = "1.7.10-1.4b3"; + public static final int Version_Code = 1710135; + public static final String CoreModId = "ProjectZulu|Core"; + public static final String BlocksModId = "ProjectZulu|Block"; + public static final String MobsModId = "ProjectZulu|Mob"; + public static final String WorldModId = "ProjectZulu|World"; + public static final String DungeonModId = "ProjectZulu|Dungeon"; + public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; + + /* Packet Channels */ + public static final String defaultChannel = "Channel_Zulu"; + + /* Module Directory Keys */ + public static final String coreKey = "projectzulucore"; + public static final String mobKey = "projectzulumob"; + public static final String blockKey = "projectzulublock"; + public static final String worldKey = "projectzuluworld"; + public static final String dungeonKey = "projectzuludungeon"; + + /* Module Resource Directories */ + public static final String coreDiretory = "/mods/" + coreKey + "/"; + public static final String mobDiretory = "/mods/" + mobKey + "/"; + public static final String blockDiretory = "/mods/" + blockKey + "/"; + public static final String worldDiretory = "/mods/" + worldKey + "/"; + public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; + public static final String entitySoundDir = "mob/"; + public static final String entitySounds = entitySoundDir.replace("/", "."); + + /* Common Resource Sub-Directories */ + public static final String itemSubDir = "textures/blocks/"; + public static final String blockSubDir = "textures/blocks/"; +// public static final String blockSpriteSheet = blockDiretory + "/textures/blocks_projectzulu.png"; // TODO: Delete +// public static final String itemSpriteSheet = blockDiretory + "/textures/items_projectzulu.png"; // TODO: Delete + + /* Config Directories */ + public static final String configDirectory = "/Project Zulu/"; + public static final String customResourcesDirectory = "CustomResources/"; + public static final String streamingResourcesDirectory = "streaming/"; + public static final String soundResourcesDirectory = "sound/"; + public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; + public static final String moduleConfigFile = "ProjectZuluModules.cfg"; + public static final String tempConfigFile = "tempSettingsConfig.cfg"; + public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; + public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/70223400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/70223400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 01d1ae2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/70223400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/705e41a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/705e41a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c87ec0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/705e41a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAloeVeraSeeds; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/718ed0f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/718ed0f5c42100141fce95f06aba7e85 deleted file mode 100644 index fa35eff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/718ed0f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,158 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.util.DamageSource; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public abstract class EntityMaster extends EntityGenericAnimal { - - List followerList = new ArrayList(); - int numberOfFollowers = 9; - - boolean spawnFollowers = true; - - /* Represents the increments between each slave-Piece, used to determine number of locations needed to track */ - int distanceIncrements = 10; - float distancePerIncrement; - - boolean isPositionListSetup = false; - LinkedList positionList = new LinkedList(); - - public EntityMaster(World par1World) { - super(par1World); - - distancePerIncrement = width / distanceIncrements; - while (followerList.size() < numberOfFollowers) { - followerList.add(null); - } - } - - @Override - public boolean canBePushed() { - return false; - } - - /* Handling of Child Entities Position Must be Handled on Server and Client Side */ - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - if (!isPositionListSetup) { - double xzOffset = 0; - while (positionList.size() < numberOfFollowers * distanceIncrements + 1) { - positionList.add(Vec3.createVectorHelper(posX + xzOffset, posY, posZ)); - xzOffset += distancePerIncrement; - } - isPositionListSetup = true; - } - - /* Calculate Position Array, used to set the target position for Followers */ - double minDistanceToIterateList = distancePerIncrement; - while (calcDistance(posX, posZ, positionList.getFirst().xCoord, positionList.getFirst().zCoord) > minDistanceToIterateList) { - - double xDist = posX - positionList.getFirst().xCoord; - double zDist = posZ - positionList.getFirst().zCoord; - - double scaleFactor = (minDistanceToIterateList / calcDistance(posX, posZ, positionList.getFirst().xCoord, - positionList.getFirst().zCoord)); - double actualXCoord = positionList.getFirst().xCoord + xDist * scaleFactor; - double actualZCoord = positionList.getFirst().zCoord + zDist * scaleFactor; - - positionList.addFirst(Vec3.createVectorHelper(actualXCoord, posY, actualZCoord)); - positionList.removeLast(); - } - - /* - * Store the Values Gotten from positionList.get from previous iteration Used to Calculate TargetRotation - */ - double prevX = posX; - double prevZ = posZ; - for (int i = 0; i < followerList.size(); i++) { - - if (followerList.get(i) != null) { - EntityFollower entityFollower = followerList.get(i); - - /* Get Position From Position List */ - double setXAround = positionList.get((i + 1) * distanceIncrements).xCoord; - double setZAround = positionList.get((i + 1) * distanceIncrements).zCoord; - double setYAround = positionList.get((i + 1) * distanceIncrements).yCoord; - entityFollower.setTargetPosition(Vec3.createVectorHelper(setXAround, posY, setZAround)); - - entityFollower - .setTargetRotation((float) (Math.atan2(setXAround - prevX, prevZ - setZAround) * (180.0 / Math.PI))); - prevX = setXAround; - prevZ = setZAround; - - /* Check if Prev Point is Dead, is so, I should probably be killed to */ - if (i > 0 && followerList.get(i - 1) != null) { - if (followerList.get(i - 1).isDead) { - entityFollower.shouldBeDying = true; - } - } - } - } - } - - /* Creation of Child Entities should only be Done on Server */ - @Override - public void updateAITick() { - - /* Count Number of Followers, used to determine if more followers should be spawned */ - int currentNumOfFollowers = 0; - for (int i = 0; i < followerList.size(); i++) { - /* Spawn new Followers if Neccesary */ - if (followerList.get(i) == null || (followerList.get(i).isDead && spawnFollowers)) { - followerList.set(i, new EntityFollower(worldObj, posX, posY, posZ, this, i)); - worldObj.spawnEntityInWorld(followerList.get(i)); - } - EntityFollower entityFollower = followerList.get(i); - - /* Count Number of Followers, used to determine if more followers should be spawned */ - if (!entityFollower.isDead) { - currentNumOfFollowers += 1; - } - } - - /* Check if We should Spawn More Followers */ - spawnFollowers = currentNumOfFollowers < numberOfFollowers ? true : false; - super.updateAITick(); - } - - /** - * Code to Assign body to Head, called by Body client Side to establish link - */ - public boolean linkFollowerWithMaster(EntityFollower entityFollower, int followerIndex) { - if (followerList.get(followerIndex) != null && !followerList.get(followerIndex).isDead) { - return false; - } - followerList.set(followerIndex, entityFollower); - return true; - } - - /* Shares Damage with Followers */ - public boolean attackEntityFromChild(EntityFollower var1, DamageSource var2, float var3) { - if (super.attackEntityFrom(var2, var3)) { - for (int i = 0; i < followerList.size(); i++) { - EntityFollower entityFollower = followerList.get(i); - if (entityFollower != null) { - entityFollower.hurtChildFromMaster(var2, var3); - } - } - return true; - } - return false; - } - - @Override - protected boolean canDespawn() { - return true; - } - - private double calcDistance(double x1, double z1, double x2, double z2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (z2 - z1) * (z2 - z1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/8108c1e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/8108c1e4c42100141fce95f06aba7e85 deleted file mode 100644 index 7cddd77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/8108c1e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,322 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/81fd9ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/81fd9ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89d0736..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/81fd9ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomMid extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomMid(boolean inverted) { - super(inverted); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (inverted) { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(piecePos.posX + 1) == 0) { - return true; - } - } else { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(cellSize - 1 - piecePos.posX + 1) == 0) { - return true; - } - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randomMid"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/a04ee6e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/a04ee6e5c42100141fce95f06aba7e85 deleted file mode 100644 index eb38494..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/a04ee6e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import projectzulu.common.potion.subitem.SubItemPotionHarm; -import projectzulu.common.potion.subitem.SubItemPotionHeal; -import projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import projectzulu.common.potion.subitem.SubItemPotionNightVision; -import projectzulu.common.potion.subitem.SubItemPotionPoison; -import projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/c1c6ee9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/c1c6ee9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0ac6e9c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/c1c6ee9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.mobs.entity; - -public enum EntityStates { - /* Primary States : Practically used by Everything */ - idle(0), - looking(1), - attacking(2), - - /* Secondary States : Common */ - fleeing(7), - following(6), - inLove(8), - sitting(9), - - /* Tertiary States : Used Rarely */ - stayStill(11), - posture(5), - inCover(10), - unknown(-1); - - public final int index; - public int index() { return index; } - - EntityStates(int index) { - this.index = index; - } - - /* Return unknown if State Cannot be Found */ - public static EntityStates getEntityByIndex(int index){ - for (EntityStates entityState : EntityStates.values()) { - if(entityState.index == index){ - return entityState; - } - } - return unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/d04fa0e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/d04fa0e6c42100141fce95f06aba7e85 deleted file mode 100644 index 43a02d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/d04fa0e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCemetary; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f02796e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f02796e4c42100141fce95f06aba7e85 deleted file mode 100644 index 625be61..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f02796e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,150 +0,0 @@ -package projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - player.posY + player.getEyeHeight(), player.posZ), - worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - entity.posZ)) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f06a73a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f06a73a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a5e1db0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a6/f06a73a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/00b06ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/00b06ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ccb92fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/00b06ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/107352e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/107352e5c42100141fce95f06aba7e85 deleted file mode 100644 index cd28663..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/107352e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/12cdcf9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/12cdcf9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8211f0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/12cdcf9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,105 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/211cf99dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/211cf99dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1d3b1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/211cf99dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreePlank; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/324d81ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/324d81ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5ac5964..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/324d81ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,107 +0,0 @@ -//package projectzulu.experimental; -// -//import java.util.List; -//import java.util.Random; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.creativetab.CreativeTabs; -//import net.minecraft.item.ItemStack; -//import projectzulu.common.core.DefaultProps; -//import cpw.mods.fml.relauncher.Side; -//import cpw.mods.fml.relauncher.SideOnly; -// -//public class BlockHoloPalmTree extends Block{ -// -// public BlockHoloPalmTree(int par1, int par2){ -// super(par1, Material.wood); -// -// this.setTickRandomly(true); -// -// this.setCreativeTab(CreativeTabs.tabBlock); -// } -// -// //TODO Commented -//// public int getIcon(int par1, int par2) -//// { -//// switch (par2) { -//// case 0: -//// return 17; -//// case 1: -//// return 19; -//// case 2: -//// return 18; -//// default: -//// return 17; -//// } -//// } -// -// public int damageDropped(int par1) -// { -// return par1; -// } -// -// //This may be neccesary cause otherwise Install will fail on server? -// @SideOnly(Side.CLIENT) -// public String getTextureFile() -// { -// return DefaultProps.blockSpriteSheet; -// } -// -// public int idDropped(int par1, Random par2Random, int par3) -// { -// switch(par1) -// { -// case 0: -// return this.blockID; -// case 1: -// return this.blockID; -// default: -// return this.blockID; -// } -// } -// -// -// public int quantityDropped(Random par1Random) -// { -// return par1Random.nextInt(2) + 1; -// } -// -// @SideOnly(Side.CLIENT) -// public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) -// { -// for (int var4 = 0; var4 < 11; ++var4) -// { -// par3List.add(new ItemStack(par1, 1, var4)); -// } -// } -// -// -// @SideOnly(Side.CLIENT) -// /** -// * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -// */ -// public int getRenderBlockPass() -// { -// return 0; -// } -// -// /** -// * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -// * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -// */ -// public boolean isOpaqueCube() -// { -// return false; -// } -// -// /** -// * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -// */ -// public boolean renderAsNormalBlock() -// { -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/418f1f2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/418f1f2bc52100141fce95f06aba7e85 deleted file mode 100644 index 7efa47e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/418f1f2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/502fa1e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/502fa1e5c42100141fce95f06aba7e85 deleted file mode 100644 index 19b2f62..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/502fa1e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,222 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/61d574a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/61d574a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 97fffc4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/61d574a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,102 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/61de9a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/61de9a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f6d5d99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/61de9a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,160 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/7040d1f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/7040d1f7c42100141fce95f06aba7e85 deleted file mode 100644 index d3b3ad9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/7040d1f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/8019d69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/8019d69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 43f0275..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/8019d69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/a09e1e00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/a09e1e00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2d54d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/a09e1e00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b10887a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b10887a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e3884bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/b10887a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/d10ea2e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/d10ea2e4c42100141fce95f06aba7e85 deleted file mode 100644 index 3a3f71c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a7/d10ea2e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,111 +0,0 @@ -//package projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import projectzulu.common.core.packets.PacketPlaySound; -//import projectzulu.common.core.packets.PacketStreamSound; -//import projectzulu.common.dungeon.packets.PacketMobSpawner; -//import projectzulu.common.mobs.packets.PacketAnimTime; -//import projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/0014ffa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/0014ffa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e280e25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/0014ffa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.mobs.models; -//package projectzulu.common.mobs; -// -//import net.minecraft.src.Entity; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.MathHelper; -//import net.minecraft.src.ModelBase; -//import net.minecraft.src.ModelRenderer; -// -//public class ModelZulu extends ModelBase -//{ -// -// public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.render(entity, f, f1, f2, f3, f4, f5); -// setRotationAngles(f, f1, f2, f3, f4, f5); -// if(this.isChild){ -// HEADROT.render(f5); -// BODYROT.render(f5); -// } -// -// } -// public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.setRotationAngles(f, f1, f2, f3, f4, f5); -// } -// -// -// -// @Override -// public void setLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4) { -// super.setLivingAnimations(par1EntityLiving, par2, par3, par4); -// } -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/20628af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/20628af9c42100141fce95f06aba7e85 deleted file mode 100644 index 18a260b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/20628af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,367 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/307febf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/307febf7c42100141fce95f06aba7e85 deleted file mode 100644 index e9e0aa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/307febf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,66 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; - -public class MazeCell { - - /** Size of the Cell. All Cells are by definition square */ - public final int size; - - /* - * Initial block of this cell in the world - */ - public final ChunkCoordinates initialPos; - - /** - * Represents randomizer metadata applied to the Cell. This data is used to help the Architect place buildings. - * - * i.e. In WalledMazeConstruction: 1 means wall, 0 means hallway - */ - public int rawState = 0; - - /* - * String Identifier used by the Architect representing the structure to be built here. Typically of the form - * - - */ - private String buildingID = ""; - - public String getBuildingID() { - return buildingID; - } - - private CellIndexDirection direction; - - public CellIndexDirection getDirection() { - return direction; - } - - public void setBuildingProperties(String buildingID, CellIndexDirection direction) { - if (buildingID == null || direction == null) { - throw new IllegalArgumentException(buildingID == null ? "buildingID" : "CellDirection" + " cannot be null"); - } - this.buildingID = buildingID; - this.direction = direction; - } - - /* Height of this cell in blocks */ - private int height; - - public int getHeight() { - return height; - } - - public void setHeight(int height) { - if (height < 1) { - throw new IllegalArgumentException("Cell Height cannot be less than 1"); - } - this.height = height; - } - - public MazeCell(int size, int height, ChunkCoordinates initialPos) { - this.size = size; - this.height = height; - this.initialPos = initialPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/400a7cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/400a7cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 82b7e16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/400a7cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/50163de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/50163de5c42100141fce95f06aba7e85 deleted file mode 100644 index e2b4a0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/50163de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/51181c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/51181c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e1f8c30..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/51181c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/600a0cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/600a0cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 83e7ffe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/600a0cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/602629a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/602629a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 897b6f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/602629a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/7001f500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/7001f500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 90c3aab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/7001f500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,66 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityGenericCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityGenericCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/800327a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/800327a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c69c938..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/800327a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/80c6bba5c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/80c6bba5c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3060a18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/80c6bba5c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,232 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/814965f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/814965f5c42100141fce95f06aba7e85 deleted file mode 100644 index d4be09a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/814965f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRabbit; -import com.ngb.projectzulu.common.mobs.models.ModelRabbit; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RabbitDeclaration extends SpawnableDeclaration { - - public RabbitDeclaration() { - super("Rabbit", 21, EntityRabbit.class, EnumCreatureType.creature); - setSpawnProperties(15, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (239 << 16) + (179 << 8) + 83; - eggColor2 = (237 << 16) + (208 << 8) + 166; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.RabbitsFoot.meta(), 8); - customMobData.entityProperties = new EntityProperties(10f, 1.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/917229f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/917229f8c42100141fce95f06aba7e85 deleted file mode 100644 index 98567ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/917229f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world2.Direction; -import com.ngb.projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/a16925fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/a16925fac42100141fce95f06aba7e85 deleted file mode 100644 index f24384b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/a16925fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,52 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelPenguinHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelPenguinHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 24F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0f5e862ccab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0f5e862ccab00141ee9bf3050c1025b new file mode 100644 index 0000000..bd09f64 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/b0f5e862ccab00141ee9bf3050c1025b @@ -0,0 +1,299 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate = 5; + private int stickSpawnRate = 5; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(101); + + if (stickDrop <= stickSpawnRate) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(101) <= bugReleaseRate) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c11e18f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c11e18f6c42100141fce95f06aba7e85 deleted file mode 100644 index 61eca55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/c11e18f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,133 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/f0339ff7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/f0339ff7c42100141fce95f06aba7e85 deleted file mode 100644 index 39203a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a8/f0339ff7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class BlueClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public BlueClothArmorDeclaration(int renderIndex) { - super(new String[] { "BlueClothHelmet", "BlueClothChest", "BlueClothLegs", "BlueClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.blueClothHead = Optional.of(item); - return true; - case 1: - ItemList.blueClothChest = Optional.of(item); - return true; - case 2: - ItemList.blueClothLeg = Optional.of(item); - return true; - case 3: - ItemList.blueClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.blueClothHead.get(); - break; - case 1: - item = ItemList.blueClothChest.get(); - break; - case 2: - item = ItemList.blueClothLeg.get(); - break; - case 3: - item = ItemList.blueClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/104621e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/104621e4c42100141fce95f06aba7e85 deleted file mode 100644 index 09736a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/104621e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - - - -public class ModelTreeEntHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer NOSEROT; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer BACKTREESTEM6; - - public ModelTreeEntHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("BODYROT.mosscb2", 0, 28); - setTextureOffset("BODYROT.mosscb", 0, 20); - setTextureOffset("HEADROT.head", 88, 0); - setTextureOffset("HEADROT.brow5", 98, 18); - setTextureOffset("HEADROT.brow4", 98, 18); - setTextureOffset("HEADROT.brow3", 98, 18); - setTextureOffset("HEADROT.brow2", 106, 17); - setTextureOffset("HEADROT.brow1", 106, 13); - setTextureOffset("NOSEROT.nose1", 90, 16); - setTextureOffset("NOSEROT.nose2", 94, 20); - setTextureOffset("NOSEROT.nose3", 90, 22); - setTextureOffset("BACKTREESTEM5.backtreestem5", 32, 28); - setTextureOffset("BACKTREESTEM5.backtreesleaves5", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreesleaves6", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreestem6", 32, 28); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 24F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 0F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("mosscb2", -3.5F, -3F, 1F, 7, 3, 4); - BODYROT.addBox("mosscb", -4.5F, -3F, -3F, 9, 3, 4); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2.5F, -9F, -2.5F, 5, 12, 4); - HEADROT.addBox("brow5", 1.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow4", -0.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow3", -2.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow2", -2.5F, -3.5F, -3.5F, 5, 3, 1); - HEADROT.addBox("brow1", -2.5F, -7.5F, -3.5F, 5, 2, 1); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - NOSEROT.addBox("nose1", -0.5F, 0F, -2.5F, 1, 1, 2); - NOSEROT.addBox("nose2", -0.5F, 1F, -2.5F, 1, 1, 1); - NOSEROT.addBox("nose3", -1F, 2F, -3F, 2, 2, 2); - HEADROT.addChild(NOSEROT); - BODYROT.addChild(HEADROT); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BACKTREESTEM5.setRotationPoint(3F, -3F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - BACKTREESTEM5.addBox("backtreestem5", -0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addBox("backtreesleaves5", -3F, -7F, -3F, 6, 3, 6); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BACKTREESTEM6.setRotationPoint(-3F, -3F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - BACKTREESTEM6.addBox("backtreesleaves6", -3F, -7F, -3F, 6, 3, 6); - BACKTREESTEM6.addBox("backtreestem6", -0.5F, -4F, -0.5F, 1, 4, 1); - BODYROT.addChild(BACKTREESTEM6); - CENTERROT.addChild(BODYROT); - } - - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BACKTREESTEM5.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM5.rotateAngleZ = (float)(+20*Math.PI/180f); - - BACKTREESTEM6.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM6.rotateAngleZ = (float)(-20*Math.PI/180f); - - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/1057c1f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/1057c1f6c42100141fce95f06aba7e85 deleted file mode 100644 index bd38950..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/1057c1f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.util; - -import com.google.common.base.CharMatcher; - -public class StringHelper { - - public static String simplifyStringNameForDisplay(String string, int characterLimit, String splitString){ - /* Remove Surpluous Creature Data (ProjectZulu.Armadillo) */ - String[] stringParts = string.split(splitString); - String displayName; - /* Shorten Name to Declared Number of Character */ - if(stringParts.length > 0){ - displayName = stringParts[stringParts.length-1]; - }else{ - displayName = string; - } - - if(displayName.length() > characterLimit){ - displayName = displayName.substring(0, characterLimit); - } - return displayName; - } - - public static String toTitleCase(String string){ - return string.toUpperCase().replace(string.toUpperCase().substring(1), string.substring(1).toLowerCase()); - } - - public static int parseInteger(String integer, String regexRetain){ - return Integer.parseInt(CharMatcher.anyOf(regexRetain).retainFrom(integer)); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/321d1ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/321d1ff9c42100141fce95f06aba7e85 deleted file mode 100644 index a5a2abf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/321d1ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/40f5dbf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/40f5dbf4c42100141fce95f06aba7e85 deleted file mode 100644 index 921714c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/40f5dbf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionDigslowdown extends SubItemPotionHalfPower { - - public SubItemPotionDigslowdown(Item itemID, int subID) { - super(itemID, subID, "Fatique"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/41ccaae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/41ccaae5c42100141fce95f06aba7e85 deleted file mode 100644 index 650c119..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/41ccaae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelPolarBear extends ModelBear { - - public ModelPolarBear() { - super(12); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 2 * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/80cb7ff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/80cb7ff4c42100141fce95f06aba7e85 deleted file mode 100644 index f18147e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/80cb7ff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/905b05fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/905b05fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1dbf0a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/905b05fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,22 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/90ae65fec82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/90ae65fec82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f806cd0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/90ae65fec82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/910367fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/910367fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ba05fb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/910367fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/a180c99dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/a180c99dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a160c8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/a180c99dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelLizardHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADBASE; - private ModelRenderer FRILL3ROT; - private ModelRenderer FRILL4ROT; - - public ModelLizardHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("FRILL3ROT.Frill3", 37, 22); - setTextureOffset("HEADBASE.head", 0, 0); - setTextureOffset("HEADBASE.Frill1", 29, 22); - setTextureOffset("HEADBASE.Frill2", 29, 22); - setTextureOffset("FRILL4ROT.Frill4", 37, 22); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 0F, 3F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - FRILL3ROT = new ModelRenderer(this, "FRILL3ROT"); - FRILL3ROT.setRotationPoint(1F, -2F, -2.5F); - setRotation(FRILL3ROT, 0F, 0F, 0F); - FRILL3ROT.mirror = true; - FRILL3ROT.addBox("Frill3", 0F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL3ROT); - HEADBASE.addBox("head", -3F, -3F, -8F, 6, 6, 8); - HEADBASE.addBox("Frill1", 3F, -2F, -3F, 3, 5, 1); - HEADBASE.addBox("Frill2", -6F, -2F, -3F, 3, 5, 1); - FRILL4ROT = new ModelRenderer(this, "FRILL4ROT"); - FRILL4ROT.setRotationPoint(-1F, -2F, -2.5F); - setRotation(FRILL4ROT, 0F, 0F, 0F); - FRILL4ROT.mirror = true; - FRILL4ROT.addBox("Frill4", -4F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL4ROT); - CENTERROT.addChild(HEADBASE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - FRILL3ROT.rotateAngleZ = (float)( -45*Math.PI/180 ); - FRILL4ROT.rotateAngleZ = (float)( 45*Math.PI/180 ); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/b03d1efac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/b03d1efac42100141fce95f06aba7e85 deleted file mode 100644 index 1765f3e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/b03d1efac42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemAnkh extends Item { - - /** - * - * @param i - * @param name Name to use as base for Unlocalized name - */ - public ItemAnkh(String name) { - super(); - maxStackSize = 1; - setMaxDamage(200); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = true; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { - if (player.getHealth() > 1f) { - shootFireball(world, player); - if (!player.capabilities.isCreativeMode) { - player.heal(-1); - } - } - return itemstack; - } - - public void shootFireball(World world, EntityPlayer player) { - - if (!world.isRemote) { - int holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionX = player.posX + holditemRand; - // double sourcePositionY = par3EntityPlayer.posY+30; - double sourcePositionY = world.getActualHeight() - 15; - holditemRand = itemRand.nextInt(10) - 5; - double sourcePositionZ = player.posZ + holditemRand; - - double var11 = player.posX - sourcePositionX; - double var13 = player.boundingBox.minY + (double) (player.height / 2.0F) - - (sourcePositionY + (double) (player.height / 2.0F)); - double var15 = player.posZ - sourcePositionZ; - player.renderYawOffset = player.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F - / (float) Math.PI; - - world.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) player.posX, (int) player.posY, - (int) player.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(world, player, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = player.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + (double) (player.height / 2.0F) + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - world.spawnEntityInWorld(var17); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e07da1f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e07da1f7c42100141fce95f06aba7e85 deleted file mode 100644 index 40bc684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e07da1f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemAloeVeraSeeds; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraSeedsDeclaration extends ItemDeclaration { - - public AloeVeraSeedsDeclaration() { - super("AloeVeraSeeds", 1); - } - - @Override - protected boolean createItem() { - if (BlockList.aloeVera.isPresent()) { - ItemList.aloeVeraSeeds = Optional.of(new ItemAloeVeraSeeds(BlockList.aloeVera.get(), name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerItem() { - Item item = ItemList.aloeVeraSeeds.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e1a559f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e1a559f4c42100141fce95f06aba7e85 deleted file mode 100644 index 28ff81c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e1a559f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,141 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e2872dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e2872dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d824e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/e2872dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/f0bc9dabad200014194ac3df013eb76e b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/f0bc9dabad200014194ac3df013eb76e deleted file mode 100644 index ca5eb45..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/f0bc9dabad200014194ac3df013eb76e +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/f1b59fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/f1b59fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cd28663..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/a9/f1b59fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/01cc8ae6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/01cc8ae6c42100141fce95f06aba7e85 deleted file mode 100644 index c0b3479..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/01cc8ae6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,137 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.Blueprint; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BPSetCathedral implements BlueprintSet { - boolean isAssigned = false; - - Blueprint dome = new BPCathedralDome(); - Blueprint hallway = new BPCathedralHallway(); - Blueprint hallwayEnd = new BPCathedralHallwayEnd(); - Blueprint hallwayEnt = new BPCathedralHallwayEntrance(); - Blueprint entrance = new BPCathedralEntrance(); - Blueprint west_tower = new BPCathedralWestTower(); - Blueprint east_tower = new BPCathedralEastTower(); - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return !isAssigned; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.EastWall); - - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthWall); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 5, entrance.getIdentifier(),// entrance - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 5, entrance.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 5, west_tower.getIdentifier(), // west_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 5, west_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 6].getHeight()); - - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 5, east_tower.getIdentifier(), // east_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 5, east_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 6].getHeight()); - isAssigned = true; - return true; - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection) { - applyBlueprintToCell(cellList, xCell, zCell, subBuildingID, cellDirection, 0); - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection, int heightIncrease) { - cellList[xCell][zCell].setBuildingProperties(getIdentifier().concat("-").concat(subBuildingID), cellDirection); - cellList[xCell][zCell].rawState = -1; - cellList[xCell][zCell].setHeight(cellList[xCell][zCell].getHeight() + heightIncrease); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String childBuildingID = buildingID.split("-")[1]; - if (childBuildingID != null) { - if (childBuildingID.equals(dome.getIdentifier())) { - return dome.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallway.getIdentifier())) { - return hallway.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnd.getIdentifier())) { - return hallwayEnd.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnt.getIdentifier())) { - return hallwayEnt.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(entrance.getIdentifier())) { - return entrance.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(west_tower.getIdentifier())) { - return west_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(east_tower.getIdentifier())) { - return east_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - } - return null; - } - - @Override - public String getIdentifier() { - return "Cathedral"; - } - - @Override - public int getWeight() { - return 20; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/10acaaf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/10acaaf4c42100141fce95f06aba7e85 deleted file mode 100644 index 204f7c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/10acaaf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempArmor { - - /** - * Factor that adds to the current Player Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Item is Equipped - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/10ebca9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/10ebca9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee7feb4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/10ebca9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Class Holds Entity Age Methods - * such as setting and saving age - */ -public class EntityGenericAgeable extends EntityGenericCreature{ - - public EntityGenericAgeable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Growing Age */ - this.dataWatcher.addObject(12, new Integer(0)); - } - /** - * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's - * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the - * Entity is considered a child. - */ - public int getGrowingAge() { return this.dataWatcher.getWatchableObjectInt(12); } - public void setGrowingAge(int par1) { this.dataWatcher.updateObject(12, Integer.valueOf(par1)); } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onUpdate() { - super.onUpdate(); - int var1 = this.getGrowingAge(); - - if (var1 < 0){ - ++var1; - this.setGrowingAge(var1); - } - else if (var1 > 0){ - --var1; - this.setGrowingAge(var1); - } - } - - @Override - public boolean isChild() { - return getGrowingAge() < 0; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/1159faa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/1159faa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 068d4dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/1159faa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,439 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30572001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30572001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1127336..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30572001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGreenFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30bb56a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30bb56a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41a9242..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/30bb56a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockNightBloom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class NightBloomDeclaration extends BlockDeclaration { - - public NightBloomDeclaration() { - super("NightBloom"); - } - - @Override - protected boolean createBlock() { - BlockList.nightBloom = Optional.of(new BlockNightBloom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.nightBloom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/405d879fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/405d879fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c4a496..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/405d879fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/608fdf9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/608fdf9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dd67271..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/608fdf9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,141 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralDome implements Blueprint { - List wallBlocks = new ArrayList(3); - - public BPCathedralDome() { - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getDomeBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return new BlockWithMeta(Blocks.air); - } - - private BlockWithMeta getDomeBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int diagonalIndex = piecePos.posZ + piecePos.posX; - int domeFloor = cellHeight - (cellSize + 1); - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - if (piecePos.posY > domeFloor) { - int slope = CellHelper.getSlopeIndex(piecePos, 2 * cellSize - diagonalIndex - 1, 2, - BoundaryPair.createPair(cellSize - 4, cellSize * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posX == 0) { - return piecePos.posZ % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - return piecePos.posX % 2 == 0 ? (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks) : new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posY == domeFloor && diagonalIndex > 2 && diagonalIndex < cellSize * 2 - 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 4) { - return new BlockWithMeta(Blocks.iron_bars); - } else if (piecePos.posY == domeFloor + 1 && diagonalIndex == cellSize * 2 - 5 && piecePos.posX != cellSize - 1 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.iron_bars); - } - - if (diagonalIndex == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posY == 0 && diagonalIndex > 2) { - if (diagonalIndex == 3) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - if (diagonalIndex > 6) { - if (piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ >= cellSize - 3 && piecePos.posX == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == cellSize - 3 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX >= cellSize - 3 && piecePos.posZ == cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 3 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - return new BlockWithMeta(Blocks.stone_slab, 5); - } else if (piecePos.posY == 3) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 2 && piecePos.posX > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == cellSize - 2 && piecePos.posZ > cellSize - 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - } - - if (piecePos.posY == 1) { - if (diagonalIndex == 4 + 2 && piecePos.posZ == cellSize - 1 - && cellIndexDirection == CellIndexDirection.NorthEastCorner || diagonalIndex == 4 + 2 - && piecePos.posX == cellSize - 1 && cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (diagonalIndex > 4) { - return new BlockWithMeta(Blocks.carpet, 14); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "CathedralDome"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/7047a1a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/7047a1a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e0669ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/7047a1a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomPoint extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomPoint() { - super(false); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ > 0 || random.nextInt(3) == 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randompoint"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/b1e8b0ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/b1e8b0ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index fc1a690..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/b1e8b0ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAnkh; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/c0c40fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/c0c40fe5c42100141fce95f06aba7e85 deleted file mode 100644 index e446697..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/c0c40fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d0c0a2e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d0c0a2e6c42100141fce95f06aba7e85 deleted file mode 100644 index f670851..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d0c0a2e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectOasis; -import projectzulu.common.world2.randomizer.EdgeRandomizer; -import projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d18bb19dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d18bb19dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a9ccaf7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/d18bb19dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e15834e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e15834e4c42100141fce95f06aba7e85 deleted file mode 100644 index a18dc98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e15834e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCampfire; -import projectzulu.common.blocks.ItemCampFire; -import projectzulu.common.blocks.RenderCampFire; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e1f0e3fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e1f0e3fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 76531c7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/e1f0e3fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.heads.BlockMobHeads; -import projectzulu.common.blocks.heads.ItemMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeads; -import projectzulu.common.blocks.heads.TileEntityMobHeadsRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MobSkullsDeclaration extends BlockDeclaration { - - public MobSkullsDeclaration() { - super("MobSkulls"); - } - - @Override - protected boolean createBlock() { - BlockList.mobHeads = Optional.of(new BlockMobHeads().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.mobHeads.get(); - GameRegistry.registerBlock(block, ItemMobHeads.class, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityMobHeads.class, "TileEntityMobHead"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMobHeads.class, new TileEntityMobHeadsRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f03d429fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f03d429fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1a9641a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f03d429fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,156 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFinch; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f0b693e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f0b693e4c42100141fce95f06aba7e85 deleted file mode 100644 index 0c06600..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f0b693e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraftforge.common.config.Configuration; - -public class EntityProperties { - public final float maxHealth; - public final float attackDamage; - public final float moveSpeed; - public final float followRange; - public final float knockbackResistance; - public final float flightChance; - - public EntityProperties(float health, float strength, float moveSpeed) { - this(health, strength, moveSpeed, 0); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance) { - this(health, strength, moveSpeed, flightChance, 0.0f, 32.0f); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance, float knockback, float followRange) { - this.maxHealth = health; - this.attackDamage = strength; - this.moveSpeed = moveSpeed; - this.flightChance = flightChance; - this.knockbackResistance = knockback; - this.followRange = followRange; - } - - public EntityProperties createFromConfig(Configuration config, String entityName) { - float maxHealth = (float) config.get("MOB CONTROLS." + entityName, "maxHealth", this.maxHealth).getDouble( - this.maxHealth); - float attackDamage = (float) config.get("MOB CONTROLS." + entityName, "attackDamage", this.attackDamage) - .getDouble(this.attackDamage); - float moveSpeed = (float) config.get("MOB CONTROLS." + entityName, "moveSpeed", this.moveSpeed).getDouble( - this.moveSpeed); - float flightChance = (float) config.get("MOB CONTROLS." + entityName, "flightChance", this.flightChance) - .getDouble(this.flightChance); - float knockbackResistance = (float) config.get("MOB CONTROLS." + entityName, "knockbackResistance", - this.knockbackResistance).getDouble(this.knockbackResistance); - float followRange = (float) config.get("MOB CONTROLS." + entityName, "followRange", this.followRange) - .getDouble(this.followRange); - return new EntityProperties(maxHealth, attackDamage, moveSpeed, flightChance, knockbackResistance, followRange); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f1510fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f1510fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 38cb32d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/aa/f1510fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,230 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/008dc500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/008dc500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b256384..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/008dc500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/01301fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/01301fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9c1304e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/01301fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,143 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/117f5bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/117f5bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 411eb90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/117f5bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDigspeed extends SubItemPotionHalfPower { - - public SubItemPotionDigspeed(Item itemID, int subID) { - super(itemID, subID, "Haste"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.SmallUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.DIG_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.DIG_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/21a480e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/21a480e4c42100141fce95f06aba7e85 deleted file mode 100644 index 34926a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/21a480e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerUniversalFlowerPot extends Container{ - protected TileEntityUniversalFlowerPot tileEntity; - - public ContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntityUniversalFlowerPot){ - this.tileEntity = tileEntityUniversalFlowerPot; - - // The Slot constructor takes the IInventory and the slot number in that it binds to - // and the x-y coordinates it resides on-screen - addSlotToContainer(new Slot(tileEntity, 0, 79, 17)); - - // Commonly used vanilla code that adds the player's inventory - bindPlayerInventory(inventoryPlayer); - } - - protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { - for (int i = 0; i < 3; i++) { - for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - for (int i = 0; i < 9; i++) { - addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public boolean canInteractWith(EntityPlayer player) { - return tileEntity.isUseableByPlayer(player); - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { - ItemStack stack = null; - Slot slotObject = (Slot) inventorySlots.get(slot); - - //null checks and checks if the item can be stacked (maxStackSize > 1) - if (slotObject != null && slotObject.getHasStack()) { - ItemStack stackInSlot = slotObject.getStack(); - stack = stackInSlot.copy(); - - //merges the item into player inventory since its in the tileEntity - //this assumes only 1 slot, for inventories with > 1 slots, check out the Chest Container. - if (slot == 0) { - if (!mergeItemStack(stackInSlot, 1, inventorySlots.size(), true)) { - return null; - } - //places it into the tileEntity is possible since its in the player inventory - } else if (!mergeItemStack(stackInSlot, 0, 1, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slotObject.putStack(null); - } else { - slotObject.onSlotChanged(); - } - } - - return stack; - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/3072eea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/3072eea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e07ef90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/3072eea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,213 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/30c0e9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/30c0e9f9c42100141fce95f06aba7e85 deleted file mode 100644 index 92324ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/30c0e9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/4049ba9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/4049ba9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a2e5ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/4049ba9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,232 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/5231809fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/5231809fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3c3394a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/5231809fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.effects; - -public class PotionThorns extends PotionZulu { - - public PotionThorns(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/802125e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/802125e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5b430b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/802125e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/809227e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/809227e5c42100141fce95f06aba7e85 deleted file mode 100644 index 1967446..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/809227e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/817338a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/817338a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 840c92b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/817338a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/9098c9a9022100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/9098c9a9022100141769cb1ed0c338cd deleted file mode 100644 index fa5eaa3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/9098c9a9022100141769cb1ed0c338cd +++ /dev/null @@ -1,233 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import net.minecraft.entity.ai.EntityAIPanic; -//import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/a05558f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/a05558f9c42100141fce95f06aba7e85 deleted file mode 100644 index 8db5cd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/a05558f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/a0bfe8e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/a0bfe8e5c42100141fce95f06aba7e85 deleted file mode 100644 index c9fa6dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/a0bfe8e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/c07d86a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/c07d86a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54de43c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/c07d86a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/c1b042e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/c1b042e4c42100141fce95f06aba7e85 deleted file mode 100644 index dbc2fe1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/c1b042e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/e0538300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/e0538300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 64db679..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ab/e0538300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/0117d29ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/0117d29ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b693589..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/0117d29ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityGreenFinch extends EntityFinch{ - - public EntityGreenFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/203a4e00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/203a4e00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41da414..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/203a4e00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,93 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/30b91df5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/30b91df5c42100141fce95f06aba7e85 deleted file mode 100644 index 4b16818..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ac/30b91df5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.BossHealthDisplayTicker; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import com.ngb.projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/12f734fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/12f734fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f7b2878..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/12f734fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/21628af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/21628af9c42100141fce95f06aba7e85 deleted file mode 100644 index 7dfc7fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/21628af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; - -import org.lwjgl.util.Point; - -public class GuiSaveableTextField extends GuiTextField { - - public GuiSaveableTextField(FontRenderer fontRenderer, int xPos, int yPos, int width, int height) { - super(fontRenderer, xPos, yPos, width, height); - } - - public GuiSaveableTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(maxTextChars); - } - - public GuiSaveableTextField(GuiSaveableTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setText(oldTextFields.getText()); - setupTextField(maxTextChars); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/313683f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/313683f9c42100141fce95f06aba7e85 deleted file mode 100644 index d5842c3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/313683f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,144 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/408ab8a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/408ab8a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b3fbd64..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/408ab8a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import net.minecraft.util.Vec3; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - // player.posY + player.getEyeHeight(), player.posZ), - Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), - // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - // entity.posZ) - Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) - ) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/40ba2da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/40ba2da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 33df0df..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/40ba2da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/608d00e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/608d00e6c42100141fce95f06aba7e85 deleted file mode 100644 index 8506d03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/608d00e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWaterBreathing extends SubItemPotionGeneric { - - public SubItemPotionWaterBreathing(Item itemID, int subID) { - super(itemID, subID, "potion.waterBreathing"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.waterBreathing); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/617b129fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/617b129fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c5217a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/617b129fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.models.ModelFollower; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/70419101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/70419101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 80f3042..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/70419101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.MinecraftForge; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import projectzulu.common.dungeon.itemblockdeclaration.LimitedMobSpawnerDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Dungeon extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.DungeonModId; - } - - @Override - public void registration(ItemBlockManager manager) { - ItemBlockManager.INSTANCE.addItemBlock(new LimitedMobSpawnerDeclaration()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - MinecraftForge.EVENT_BUS.register(new DeathGamerules().loadConfiguration(event.getModConfigurationDirectory())); - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - event.registerServerCommand(new CommandPlaySound()); - event.registerServerCommand(new CommandStreamSound()); - event.registerServerCommand(new CommandSpawnEntity()); - event.registerServerCommand(new CommandPlaceBlock()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/a0b964fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/a0b964fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d369eb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/a0b964fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,109 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/b08686f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/b08686f8c42100141fce95f06aba7e85 deleted file mode 100644 index cb84299..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/b08686f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/b1c5a9e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/b1c5a9e6c42100141fce95f06aba7e85 deleted file mode 100644 index 625408c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/b1c5a9e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/e0afdea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/e0afdea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6ff9375..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ad/e0afdea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/20a480e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/20a480e4c42100141fce95f06aba7e85 deleted file mode 100644 index edc63b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/20a480e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/304d81ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/304d81ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 014faa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/304d81ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.awt.Point; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class SelectedFewRandomizer extends Randomizer { - - Random random; - int maxSelected; - int selectionChance; - boolean allowTouching; - - public SelectedFewRandomizer(Random random, int maxSelected, int selectionChance, boolean allowTouching) { - this.random = random; - this.maxSelected = maxSelected; - this.selectionChance = selectionChance; - this.allowTouching = allowTouching; - } - - @Override - public void randomize(MazeCell[][] cells) { - int[] indexes = new int[cells.length * cells[0].length]; - for (int i = 0; i < indexes.length; i++) { - indexes[i] = i; - } - shuffleArray(indexes); - - int count = 0; - for (int index : indexes) { - int i = (int) (index / cells[0].length); - int k = index % cells[0].length; - if (random.nextInt(100) <= selectionChance - && (allowTouching || ArchitectBase.isTouchingAmount(cells, new Point(i, k), 0, 0, true, 1))) { - cells[i][k].rawState = 1; - count++; - if (maxSelected > -1 && count >= maxSelected) { - return; - } - } - } - } - - private void shuffleArray(int[] array) { - Random random = new Random(); - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - /* Simple swap */ - int tempValue = array[index]; - array[index] = array[i]; - array[i] = tempValue; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/31b977e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/31b977e6c42100141fce95f06aba7e85 deleted file mode 100644 index 5722f80..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/31b977e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericCarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/41dd4af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/41dd4af8c42100141fce95f06aba7e85 deleted file mode 100644 index 90999ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/41dd4af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionThorns extends SubItemPotionGeneric { - - public SubItemPotionThorns(Item itemID, int subID) { - super(itemID, subID, "potion.thorn"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.thorn; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Bark.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.RESISTANCE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.RESISTANCE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/517ae89dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/517ae89dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bcfe6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/517ae89dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutSeed; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/52c5fdfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/52c5fdfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 19e24b7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/52c5fdfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,253 +0,0 @@ -// Date: 21/08/2012 16:58:44 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityLizard; - -public class ModelLizard extends ModelBase { - ModelRenderer leg1; - ModelRenderer leg1u; - ModelRenderer leg2; - ModelRenderer leg2u; - - ModelRenderer TAILROT; - ModelRenderer Tail3; - ModelRenderer Tail2; - ModelRenderer Tail1; - - ModelRenderer FRONTROT; - ModelRenderer HEADBASE; - ModelRenderer Frill1; - ModelRenderer Frill2; - ModelRenderer Frill3; - ModelRenderer Frill4; - ModelRenderer head; - ModelRenderer leg3u; - ModelRenderer leg3; - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg4u; - - public ModelLizard() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TAILROT.dltfold1", 0, 0); - setTextureOffset("FRONTROT.dltfold3", 0, 0); - - leg1 = new ModelRenderer(this, 20, 22); - leg1.addBox(-3F, 0F, -1F, 2, 6, 2); - leg1.setRotationPoint(-4F, 18F, 6F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg1u = new ModelRenderer(this, 14, 22); - leg1u.addBox(-1F, 0F, -1F, 1, 2, 2); - leg1u.setRotationPoint(-4F, 18F, 6F); - leg1u.setTextureSize(64, 32); - leg1u.mirror = true; - setRotation(leg1u, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 20, 22); - leg2.addBox(1F, 0F, -1F, 2, 6, 2); - leg2.setRotationPoint(4F, 18F, 6F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg2u = new ModelRenderer(this, 14, 22); - leg2u.addBox(0F, 0F, -1F, 1, 2, 2); - leg2u.setRotationPoint(4F, 18F, 6F); - leg2u.setTextureSize(64, 32); - leg2u.mirror = true; - setRotation(leg2u, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 9F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - Tail3 = new ModelRenderer(this, 0, 17); - Tail3.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail3); - Tail3.setRotationPoint(0F, -1F, 10F); - Tail3.setTextureSize(64, 32); - Tail3.mirror = true; - setRotation(Tail3, 0F, 0F, 0F); - Tail2 = new ModelRenderer(this, 0, 17); - Tail2.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail2); - Tail2.setRotationPoint(0F, -1F, 5F); - Tail2.setTextureSize(64, 32); - Tail2.mirror = true; - setRotation(Tail2, 0F, 0F, 0F); - Tail1 = new ModelRenderer(this, 0, 17); - Tail1.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail1); - Tail1.setRotationPoint(0F, -1F, 0F); - Tail1.setTextureSize(64, 32); - Tail1.mirror = true; - setRotation(Tail1, 0F, 0F, 0F); - FRONTROT = new ModelRenderer(this, "FRONTROT"); - FRONTROT.setRotationPoint(0F, 19F, 6F); - setRotation(FRONTROT, 0F, 0F, 0F); - FRONTROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - FRONTROT.addChild(HEADBASE); - HEADBASE.setRotationPoint(0F, 0F, -13F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - Frill2 = new ModelRenderer(this, 29, 22); - Frill2.addBox(-3F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill2); - Frill2.setRotationPoint(-3F, 1F, -3F); - Frill2.setTextureSize(64, 32); - Frill2.mirror = true; - setRotation(Frill2, 0F, 0.0371786F, 0F); - Frill4 = new ModelRenderer(this, 37, 22); - Frill4.addBox(-4F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill4); - Frill4.setRotationPoint(-1F, -2F, -3F); - Frill4.setTextureSize(64, 32); - Frill4.mirror = true; - setRotation(Frill4, 0F, 0F, 0F); - Frill1 = new ModelRenderer(this, 29, 22); - Frill1.addBox(0F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill1); - Frill1.setRotationPoint(3F, 1F, -3F); - Frill1.setTextureSize(64, 32); - Frill1.mirror = true; - setRotation(Frill1, 0F, 0.0371786F, 0F); - - Frill3 = new ModelRenderer(this, 37, 22); - Frill3.addBox(0F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill3); - Frill3.setRotationPoint(1F, -2F, -3F); - Frill3.setTextureSize(64, 32); - Frill3.mirror = true; - setRotation(Frill3, 0F, 0F, 0F); - Frill3.mirror = false; - head = new ModelRenderer(this, 0, 0); - head.addBox(-4F, -4F, -9F, 6, 6, 8); - HEADBASE.addChild(head); - head.setRotationPoint(1F, 1F, 1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(HEADBASE); - leg3u = new ModelRenderer(this, 14, 22); - leg3u.addBox(-1F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg3u); - leg3u.setRotationPoint(-4F, -1F, -12F); - leg3u.setTextureSize(64, 32); - leg3u.mirror = true; - setRotation(leg3u, 0F, 0F, 0F); - body = new ModelRenderer(this, 10, 0); - body.addBox(-4F, -2F, -9F, 8, 4, 18); - FRONTROT.addChild(body); - body.setRotationPoint(0F, 0F, -6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4u = new ModelRenderer(this, 14, 22); - leg4u.addBox(0F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg4u); - leg4u.setRotationPoint(4F, -1F, -12F); - leg4u.setTextureSize(64, 32); - leg4u.mirror = true; - setRotation(leg4u, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 20, 22); - leg4.addBox(1F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg4); - leg4.setRotationPoint(4F, -1F, -12F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 20, 22); - leg3.addBox(-3F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg3); - leg3.setRotationPoint(-4F, -1F, -12F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - FRONTROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - FRONTROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityLizard var5 = (EntityLizard) par1EntityLiving; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - if (var5.prepareToSpit == true) { - Frill1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.0F * par3; - Frill2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 1.0F * par3; - - Frill3.rotateAngleZ = (float) (-45 * Math.PI / 180); - Frill3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - Frill3.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - - Frill4.rotateAngleZ = (float) (45 * Math.PI / 180); - Frill4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - Frill4.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - } else { - Frill1.rotateAngleZ = (float) (-90 * Math.PI / 180); // This is on Right - Frill2.rotateAngleZ = (float) (90 * Math.PI / 180); // This is on Left - - Frill3.rotateAngleY = (float) (-90 * Math.PI / 180); - Frill4.rotateAngleY = (float) (90 * Math.PI / 180); - } - leg1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - leg3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADBASE.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADBASE.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a0a8639fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a0a8639fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f2c90d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a0a8639fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a0a8eef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a0a8eef6c42100141fce95f06aba7e85 deleted file mode 100644 index ee17c58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/a0a8eef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,163 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.terrain.CathedralFeature; -import com.ngb.projectzulu.common.world.terrain.CemetaryFeature; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; -import com.ngb.projectzulu.common.world.terrain.OasisFeature; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/b1b84ef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/b1b84ef9c42100141fce95f06aba7e85 deleted file mode 100644 index 822a258..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/b1b84ef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/c002e1f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/c002e1f8c42100141fce95f06aba7e85 deleted file mode 100644 index b792e21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/c002e1f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityFox; -import com.ngb.projectzulu.common.mobs.models.ModelFox; -import com.ngb.projectzulu.common.mobs.renders.RenderTameable; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d1de9de6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d1de9de6c42100141fce95f06aba7e85 deleted file mode 100644 index 227aed0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ae/d1de9de6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,92 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCathedral; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/001a7000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/001a7000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b2c3189..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/001a7000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/008d6b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/008d6b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6ff9375..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/008d6b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/01fb9aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/01fb9aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4282098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/01fb9aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,25 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Comparator; - -import net.minecraft.entity.Entity; -public class EntityAINearestAttackableTargetSorter implements Comparator{ - private Entity theEntity; - - final EntityAINearestAttackableTarget parent; - - public EntityAINearestAttackableTargetSorter(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, Entity par2Entity){ - this.parent = par1EntityAINearestAttackableTarget; - this.theEntity = par2Entity; - } - - public int compareDistanceSq(Entity par1Entity, Entity par2Entity){ - double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); - double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - - public int compare(Object par1Obj, Object par2Obj){ - return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/5063182bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/5063182bc52100141fce95f06aba7e85 deleted file mode 100644 index 0ea25f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/5063182bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,527 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/514f64ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/514f64ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 49e5c6a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/514f64ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,225 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/805e9907cbab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/805e9907cbab00141ee9bf3050c1025b new file mode 100644 index 0000000..fd49caa --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/805e9907cbab00141ee9bf3050c1025b @@ -0,0 +1,297 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(101) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/8123049fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/8123049fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2503ef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/8123049fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,174 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/90f086e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/90f086e5c42100141fce95f06aba7e85 deleted file mode 100644 index 30f2faf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/90f086e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,182 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityBear; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/a061c6fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/a061c6fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 630eed2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/a061c6fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIWander extends EntityAIBase -{ - private EntityCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0a5d101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0a5d101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa5814f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0a5d101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectLabyrinth; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0f71c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0f71c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9ea7694..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/d0f71c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,104 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e07198e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e07198e4c42100141fce95f06aba7e85 deleted file mode 100644 index 8552024..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e07198e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e0dfe29ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e0dfe29ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d96fbb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e0dfe29ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e0e9109ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e0e9109ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ccb92fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e0e9109ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e1b908fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e1b908fac42100141fce95f06aba7e85 deleted file mode 100644 index a39b802..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/af/e1b908fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class IronScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public IronScaleArmorDeclaration(int renderIndex) { - super(new String[] { "IronScaleHelmet", "IronScaleChest", "IronScaleLegs", "IronScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.ironScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.ironScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.ironScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.ironScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.ironScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.ironScaleArmorHead.get(); - break; - case 1: - item = ItemList.ironScaleArmorChest.get(); - break; - case 2: - item = ItemList.ironScaleArmorLeg.get(); - break; - case 3: - item = ItemList.ironScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/10db14a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/10db14a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 262ce65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/10db14a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/205860a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/205860a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 132c1ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/205860a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public ScaleArmorDeclaration(int renderIndex) { - super(new String[] { "ScaleHelmet", "ScaleChest", "ScaleLegs", "ScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.scaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.scaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.scaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.scaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.scaleArmorHead.get(); - break; - case 1: - item = ItemList.scaleArmorChest.get(); - break; - case 2: - item = ItemList.scaleArmorLeg.get(); - break; - case 3: - item = ItemList.scaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/3104bf9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/3104bf9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 880a9b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/3104bf9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/310fa901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/310fa901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f733b4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/310fa901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/403cc0fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/403cc0fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7aff6f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/403cc0fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,203 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/415524fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/415524fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c21dff8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/415524fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/50999f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/50999f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6e837bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/50999f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/708bf996beab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/708bf996beab00141ee9bf3050c1025b new file mode 100644 index 0000000..a2b1037 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/708bf996beab00141ee9bf3050c1025b @@ -0,0 +1,292 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(50) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/70ba6e00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/70ba6e00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 025521a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/70ba6e00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/80741201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/80741201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0962a56..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/80741201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlueFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/80f1c6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/80f1c6f5c42100141fce95f06aba7e85 deleted file mode 100644 index 1a58fa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/80f1c6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/8123edfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/8123edfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c68292..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/8123edfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRhino; -import projectzulu.common.mobs.models.ModelRhino; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/a13a19e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/a13a19e5c42100141fce95f06aba7e85 deleted file mode 100644 index d361281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/a13a19e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,340 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.Properties; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/b10be5f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/b10be5f6c42100141fce95f06aba7e85 deleted file mode 100644 index 9df30d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/b10be5f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelTombstone extends ModelBase -{ - //fields - ModelRenderer baserig; - ModelRenderer body4; - ModelRenderer topcenter; - ModelRenderer baselef; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - private ModelRenderer CENTERROT; - private ModelRenderer TOPLEFROT; - private ModelRenderer TOPRIGROT; - - public ModelTombstone(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TOPLEFROT.topleft", 0, 17); - setTextureOffset("TOPRIGROT.topright", 0, 17); - - body4 = new ModelRenderer(this, 28, 15); - body4.addBox(0F, -18F, -4.5F, 9, 8, 9); - body4.setRotationPoint(0F, 28F, 0F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - topcenter = new ModelRenderer(this, 28, 16); - topcenter.addBox(-4.5F, -4F, -4.5F, 9, 4, 9); - topcenter.setRotationPoint(0F, 2F, 0F); - topcenter.setTextureSize(64, 32); - topcenter.mirror = true; - setRotation(topcenter, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 28, 15); - body3.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body3.setRotationPoint(0F, 28F, 0F); - body3.setTextureSize(64, 32); - body3.mirror = true; - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body3.mirror = false; - body2 = new ModelRenderer(this, 28, 15); - body2.addBox(0F, -18F, -4.5F, 9, 8, 9); - body2.setRotationPoint(0F, 20F, 0F); - body2.setTextureSize(64, 32); - body2.mirror = true; - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body2.mirror = false; - body1 = new ModelRenderer(this, 28, 15); - body1.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body1.setRotationPoint(0F, 20F, 0F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - baselef = new ModelRenderer(this, 0, 0); - baselef.addBox(-12F, -3F, -6F, 12, 6, 12); - baselef.setRotationPoint(0F, 21F, 0F); - baselef.setTextureSize(64, 32); - baselef.mirror = true; - baselef.mirror = true; - setRotation(baselef, 0F, 0F, 0F); - baselef.mirror = false; - baserig = new ModelRenderer(this, 0, 0); - baserig.addBox(0F, -3F, -6F, 12, 6, 12); - baserig.setRotationPoint(0F, 21F, 0F); - baserig.setTextureSize(64, 32); - baserig.mirror = true; - baserig.mirror = true; - setRotation(baserig, 0F, 0F, 0F); - baserig.mirror = false; - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 1.2F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - TOPLEFROT = new ModelRenderer(this, "TOPLEFROT"); - TOPLEFROT.setRotationPoint(-5.8F, 0F, 0F); - setRotation(TOPLEFROT, 0F, 0F, 0.837758F); - TOPLEFROT.mirror = true; - TOPLEFROT.addBox("topleft", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPLEFROT); - TOPRIGROT = new ModelRenderer(this, "TOPRIGROT"); - TOPRIGROT.setRotationPoint(5.8F, 0F, 0F); - setRotation(TOPRIGROT, 0F, 0F, -0.837758F); - TOPRIGROT.mirror = true; - TOPRIGROT.addBox("topright", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPRIGROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - baserig.render(f5); - body4.render(f5); - topcenter.render(f5); - baselef.render(f5); - body3.render(f5); - body2.render(f5); - body1.render(f5); - - CENTERROT.render(f5); - - } - - public void render1(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - body4.rotateAngleY = (float) (angle*Math.PI/180); - body4.render(f5); - topcenter.rotateAngleY = (float) (angle*Math.PI/180); - topcenter.render(f5); - - body3.rotateAngleY = (float) (angle*Math.PI/180); - body3.render(f5); - body2.rotateAngleY = (float) (angle*Math.PI/180); - body2.render(f5); - body1.rotateAngleY = (float) (angle*Math.PI/180); - body1.render(f5); - - baselef.rotateAngleY = (float) (angle*Math.PI/180); - baselef.render(f5); - baserig.rotateAngleY = (float) (angle*Math.PI/180); - baserig.render(f5); - } - - public void render2(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - CENTERROT.rotateAngleY = (float) (angle*Math.PI/180); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } - -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/d1b603e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/d1b603e5c42100141fce95f06aba7e85 deleted file mode 100644 index 3250ae2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/d1b603e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0676ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0676ae5c42100141fce95f06aba7e85 deleted file mode 100644 index c2c00dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0676ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.models.ModelHauntedArmor; -import projectzulu.common.mobs.renders.RenderHauntedArmor; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0e4799ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0e4799ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index feb0740..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b/e0e4799ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,577 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/013f6ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/013f6ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a480ea0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/013f6ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/0188d49ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/0188d49ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c04ac8a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/0188d49ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/20f63cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/20f63cf4c42100141fce95f06aba7e85 deleted file mode 100644 index eb9f691..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/20f63cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithPalmTree; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/21bfc39ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/21bfc39ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e2694c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/21bfc39ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,121 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityElephant extends EntityGenericAnimal { - - private float ridingRotation = 0; - - public EntityElephant(World par1World) { - super(par1World); - setSize(4.0f, 5.4f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 4.0f * 4.0f)); - - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.leaves), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephantlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "elephanthurtsound"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 17), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/60eed8a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/60eed8a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 468931c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/60eed8a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import projectzulu.common.mobs.models.ModelTreeEnt; -import projectzulu.common.mobs.renders.RenderSnow; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/70de04f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/70de04f9c42100141fce95f06aba7e85 deleted file mode 100644 index 54887ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/70de04f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/71c3c5e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/71c3c5e4c42100141fce95f06aba7e85 deleted file mode 100644 index 9dff344..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/71c3c5e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,139 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/a0fdb9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/a0fdb9f9c42100141fce95f06aba7e85 deleted file mode 100644 index 4cf36c8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/a0fdb9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.core; - - -public enum GuiID { - Tombstone(0), - FlowerPot(1), - AnimalName(2), - MobSpawner(3), - BrewingStand(4), - Unknown(-1); - - private int iD; - private GuiID(int iD) { - this.iD = iD; - } - - public int getID(){ - return iD; - } - - public static GuiID getGuiIDByID(int iD){ - for (GuiID guiID : GuiID.values()) { - if(guiID.iD == iD){ - return guiID; - } - } - return Unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/d14232ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/d14232ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 07d7f25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/d14232ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/f1b366f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/f1b366f6c42100141fce95f06aba7e85 deleted file mode 100644 index 18a260b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b0/f1b366f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,367 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/20a60d6ac92100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/20a60d6ac92100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0442f68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/20a60d6ac92100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,563 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getAABBPool() - .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/302a20f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/302a20f5c42100141fce95f06aba7e85 deleted file mode 100644 index 4327108..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/302a20f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/30a2f29fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/30a2f29fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b025cfc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/30a2f29fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/50a4eff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/50a4eff4c42100141fce95f06aba7e85 deleted file mode 100644 index 95a3cc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/50a4eff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,143 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotion; -import com.ngb.projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/617933e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/617933e5c42100141fce95f06aba7e85 deleted file mode 100644 index 808036c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/617933e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,154 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/80cb4effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/80cb4effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7e8f393..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/80cb4effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/90f7f8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/90f7f8f8c42100141fce95f06aba7e85 deleted file mode 100644 index 631fe99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/90f7f8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/a06492a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/a06492a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d3022d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/a06492a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/c0c679f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/c0c679f6c42100141fce95f06aba7e85 deleted file mode 100644 index 2626abb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/c0c679f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/f0bb2ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/f0bb2ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 5c5f1b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/f0bb2ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockAloeVera; -import projectzulu.common.blocks.ItemAloeVera; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/f0db75a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/f0db75a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 72744fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/f0db75a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,163 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.terrain.TerrainFeature; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/0008f6ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/0008f6ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d0a628b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/0008f6ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/20abf2f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/20abf2f7c42100141fce95f06aba7e85 deleted file mode 100644 index dc670d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/20abf2f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectCemetary; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/40ad1a2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/40ad1a2bc52100141fce95f06aba7e85 deleted file mode 100644 index 72c2cc9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/40ad1a2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/416207ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/416207ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3540cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/416207ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,1046 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/50a20df7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/50a20df7c42100141fce95f06aba7e85 deleted file mode 100644 index 0714f67..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/50a20df7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public ScaleArmorDeclaration(int renderIndex) { - super(new String[] { "ScaleHelmet", "ScaleChest", "ScaleLegs", "ScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.scaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.scaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.scaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.scaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.scaleArmorHead.get(); - break; - case 1: - item = ItemList.scaleArmorChest.get(); - break; - case 2: - item = ItemList.scaleArmorLeg.get(); - break; - case 3: - item = ItemList.scaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/704d2ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/704d2ce5c42100141fce95f06aba7e85 deleted file mode 100644 index d236a83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/704d2ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/81a33ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/81a33ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c8212d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/81a33ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/a1785fa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/a1785fa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d361281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/a1785fa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,340 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.Properties; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/a1dfbef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/a1dfbef9c42100141fce95f06aba7e85 deleted file mode 100644 index 6da58f1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b2/a1dfbef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,25 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public interface EntityDeclaration { - public abstract boolean shouldExist(); - - /** - * Returns the Entities Unique Identifier. Typically the Entity name, i.e. "Alligator" or "Red Finch" - */ - public abstract String getIdentifier(); - public abstract void loadCreaturesFromConfig(Configuration config); - public abstract void loadBiomesFromConfig(Configuration config); - public abstract void loadCustomMobData(File configDirectory); - public abstract void registerEntity(); - public abstract void registerEgg(); - public abstract void addSpawn(); - - @SideOnly(Side.CLIENT) - public abstract void registerModelAndRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/000f68a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/000f68a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0fc7033..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/000f68a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class MobSpawnerWithMeta extends BlockWithMeta { - - String mobName; - - public MobSpawnerWithMeta(String mobName) { - super(Blocks.mob_spawner); - this.mobName = mobName; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - /* Create Mob Spawner */ - world.setBlock(position.posX, position.posY, position.posZ, block); - TileEntityMobSpawner tileEntityMobSpawner = (TileEntityMobSpawner) world.getTileEntity(position.posX, - position.posY, position.posZ); - - if (tileEntityMobSpawner != null) { - tileEntityMobSpawner.func_145881_a().setEntityName(mobName); - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/005d372bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/005d372bc52100141fce95f06aba7e85 deleted file mode 100644 index 54a5075..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/005d372bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,164 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import projectzulu.common.blocks.FurPeltDeclaration; -import projectzulu.common.blocks.ItemBlockRecipeManager; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import projectzulu.common.blocks.terrain.AloeVeraFeature; -import projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import projectzulu.common.blocks.terrain.NightBloomFeature; -import projectzulu.common.blocks.terrain.PalmTreeFeature; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.PotionEvents; -import projectzulu.common.potion.EventHandleNullPotions; -import projectzulu.common.potion.PZExtraPotionDeclaration; -import projectzulu.common.potion.PZVanillaPotionDeclaration; -import projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/0129c0e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/0129c0e5c42100141fce95f06aba7e85 deleted file mode 100644 index cd68e3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/0129c0e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,200 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.Properties; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/200886ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/200886ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7639a38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/200886ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public abstract class BaseModule implements Module { - - @Override - public void registration(ItemBlockManager manager) { - } - - @Override - public void registration(CustomEntityManager manager) { - } - - @Override - public void registration(FeatureGenerator manager) { - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - } - - @Override - public void init(FMLInitializationEvent event, File configDirectory) { - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - } - - @Override - public void serverStart(FMLServerStartedEvent event, File configDirectory) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/20fe88f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/20fe88f5c42100141fce95f06aba7e85 deleted file mode 100644 index 90055a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/20fe88f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityFrog; -import com.ngb.projectzulu.common.mobs.models.ModelFrog; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/225354f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/225354f8c42100141fce95f06aba7e85 deleted file mode 100644 index 155b406..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/225354f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionInvisibility extends SubItemPotionGeneric { - - public SubItemPotionInvisibility(Item itemID, int subID) { - super(itemID, subID, "potion.invisibility"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.invisibility); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/30a9c17fc6ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/30a9c17fc6ab00141ee9bf3050c1025b new file mode 100644 index 0000000..5cd9205 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/30a9c17fc6ab00141ee9bf3050c1025b @@ -0,0 +1,130 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.Random; + +import net.minecraft.entity.EntityList; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + + +public class EntityBeetleAS extends EntityGenericAnimal implements IAnimals { + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + + public EntityBeetleAS(World par1World) { + super(par1World); + this.setSize(0.35f, 0.35f); + this.setPosition(this.posX, this.posY, this.posZ); + + Random rand1 = new Random(); + this.textureID = rand1.nextInt(3); + + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIWander(this, 1.0f, 120)); + + /* Attack On Collide Declared in SubClass */ + tasks.addTask(5, new EntityAIMate(this, 1.0f)); + tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.potato, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0f)); + + //targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); + //targetTasks.addTask(4, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityPlayer.class, 16.0F, 0, true)); + // targetTasks.addTask(5, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlelivingsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlehurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.potato); + } + + if (this.ticksExisted > 10000){ + //this.despawnEntity(); + this.setDead(); + } + } + + @Override + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 0; + } + + @Override + protected void updateAITick() { + super.updateAITick(); + } + + /** + * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each + * Entity if deviations from default are desired + */ + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null + && (itemStack.getItem() == Items.potato)) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + } else { + return super.isValidBreedingItem(itemStack); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/3180ab01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/3180ab01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 94b6064..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/3180ab01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/511bd4e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/511bd4e4c42100141fce95f06aba7e85 deleted file mode 100644 index 5b8088e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/511bd4e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,93 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/605da2f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/605da2f6c42100141fce95f06aba7e85 deleted file mode 100644 index f4a83ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/605da2f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraft.item.Item; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public ItemDeclaration(String name) { - this(name, 0); - } - - public ItemDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("item", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createItem(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerItem(); - if (!side.isServer()) { - clientRegisterItem(); - } - } - } - - protected abstract void registerItem(); - - protected void clientRegisterItem() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/606239f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/606239f6c42100141fce95f06aba7e85 deleted file mode 100644 index 5f75eee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/606239f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/60d8479ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/60d8479ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 625be61..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/60d8479ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,150 +0,0 @@ -package projectzulu.common.core; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; -import projectzulu.common.api.ItemList; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHookContainerClass { - // zLevel is protected float copied from GUI along with drawTexturedModelRect - protected float zLevel = 0.0F; - boolean nearBossTriggered = false; - - Random classRand = new Random(); - - @SubscribeEvent - public void onPlayerUpdateStarve(LivingUpdateEvent event) { - World worldObj = event.entity.worldObj; - if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { - - EntityPlayer thePlayer = (EntityPlayer) event.entity; - - int var1 = MathHelper.floor_double(thePlayer.posX); - int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); - int var3 = MathHelper.floor_double(thePlayer.posZ); - BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); - boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true - && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true - && Loader.isModLoaded(DefaultProps.BlocksModId)) { - float exhaustion = 0.0032f; - switch (worldObj.difficultySetting) { - case PEACEFUL: - exhaustion = 0.0f; - break; - case EASY: - exhaustion = 0.0032f * 1; - break; - case NORMAL: - exhaustion = 0.0032f * 2; - break; - case HARD: - exhaustion = 0.0032f * 3; - default: - break; - } - - for (int i = 0; i < 4; i++) { - if (thePlayer.inventory.armorInventory[i] == null) { - exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; - break; - } - } - thePlayer.addExhaustion(Math.max(exhaustion, 0)); - } - } - } - - /* Armor Effect Only Occurs When Block/Item Package is Installed */ - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null - && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { - EntityPlayer hurtEntity = (EntityPlayer) event.entity; - EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); - if (attackingEntity != null && event.source.getDamageType() == "mob") { - - double cactusDamage = 0; - if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() - && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() - && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() - && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { - cactusDamage += 0.5; - } - if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() - && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { - cactusDamage += 0.5; - } - - if (cactusDamage > 0) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), - MathHelper.ceiling_double_int(cactusDamage)); - } - - } - } - } - - /** - * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only - * notifies TreeEnts that are looking at the Player - */ - @SubscribeEvent - public void treeEntDefendForest(BreakSpeed event) { - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (event.entity != null && event.entity instanceof EntityPlayer - && (event.block == Blocks.log || event.block == Blocks.log2)) { - EntityPlayer player = (EntityPlayer) (event.entity); - World worldObj = player.worldObj; - AxisAlignedBB playerBounding = player.boundingBox.copy(); - playerBounding = playerBounding.expand(24, 24, 24); - List listOfTreeEnts = player.worldObj - .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); - if (!listOfTreeEnts.isEmpty()) { - Iterator entIterator = listOfTreeEnts.iterator(); - while (entIterator.hasNext()) { - Entity entity = (Entity) entIterator.next(); - if (((EntityTreeEnt) entity).getAngerLevel() <= 0 - && worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(player.posX, - player.posY + player.getEyeHeight(), player.posZ), - worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, - entity.posZ)) == null) { - if (!worldObj.isRemote) { - ((EntityTreeEnt) entity).setAttackTarget(player); - } - ((EntityTreeEnt) entity).setAngerLevel(60); - } - } - } - } - } - - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/701dcef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/701dcef5c42100141fce95f06aba7e85 deleted file mode 100644 index eb270e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/701dcef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,116 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/c1e4e5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/c1e4e5f8c42100141fce95f06aba7e85 deleted file mode 100644 index bb8a64c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/c1e4e5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBoar; -import com.ngb.projectzulu.common.mobs.models.ModelBoar; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d1acd5e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d1acd5e5c42100141fce95f06aba7e85 deleted file mode 100644 index dacf718..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/d1acd5e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHarm2 extends PotionZulu { - - public PotionHarm2(int par1, boolean par2) { - super(par1, par2, 4393481); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase entityLiving, int amplifier) { - if (!entityLiving.isEntityUndead()) { - entityLiving.attackEntityFrom(DamageSource.magic, amplifier * 3); - } else { - entityLiving.heal(amplifier * 3); - } - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (!par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e18565e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e18565e5c42100141fce95f06aba7e85 deleted file mode 100644 index da9b6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/e18565e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFrog; -import projectzulu.common.mobs.models.ModelFrog; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/f0b008a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/f0b008a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f2c90d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/f0b008a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/f1dd40fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/f1dd40fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5795c3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b3/f1dd40fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,322 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/0229c0e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/0229c0e5c42100141fce95f06aba7e85 deleted file mode 100644 index 36bfbe4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/0229c0e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.entity.Render; - -/** - * Interface to hide ClientSide Render in objects on Server when Side.Client is insufficient i.e. abstract methods - */ -public interface RenderWrapper { - public Render getRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/303b1af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/303b1af9c42100141fce95f06aba7e85 deleted file mode 100644 index 4f68641..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/303b1af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,167 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/322a7ae6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/322a7ae6c42100141fce95f06aba7e85 deleted file mode 100644 index 43f0275..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/322a7ae6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/409979f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/409979f9c42100141fce95f06aba7e85 deleted file mode 100644 index 880806b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/409979f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/41bc80a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/41bc80a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a6c438d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/41bc80a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,404 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/4205e5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/4205e5f9c42100141fce95f06aba7e85 deleted file mode 100644 index d179fd8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/4205e5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemWateredDirt extends ItemBlock { - - public ItemWateredDirt(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "soil_1"; - break; - } - case 1: { - name = "soil_2"; - break; - } - case 2: { - name = "soil_3"; - break; - } - case 3: { - name = "soil_4"; - break; - } - case 4: { - name = "sand_1"; - break; - } - case 5: { - name = "sand_2"; - break; - } - case 6: { - name = "sand_3"; - break; - } - case 7: { - name = "sand_4"; - break; - } - default: - name = "ore"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/50289d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/50289d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c9c238..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/50289d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/519604e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/519604e4c42100141fce95f06aba7e85 deleted file mode 100644 index 05d1d4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/519604e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/524ae49fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/524ae49fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 799993f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/524ae49fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,334 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/6173a8a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/6173a8a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 227aed0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/6173a8a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCathedral; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/91d98cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/91d98cf6c42100141fce95f06aba7e85 deleted file mode 100644 index eaab901..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/91d98cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/b06d269ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/b06d269ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54de43c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/b06d269ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/b18d5dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/b18d5dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11bc37a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/b18d5dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c0b71200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c0b71200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index dd2714b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c0b71200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c13c889ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c13c889ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b585ce1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c13c889ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c194b1f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c194b1f5c42100141fce95f06aba7e85 deleted file mode 100644 index d44ca4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/c194b1f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/d1354ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/d1354ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41da414..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b4/d1354ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,93 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00af6601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00af6601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4be9047..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/00af6601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/114621e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/114621e4c42100141fce95f06aba7e85 deleted file mode 100644 index 80f72f2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/114621e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,93 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelVultureHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer HEADROT; - - - public ModelVultureHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("NECKROT1.neck1", 8, 10); - setTextureOffset("NECKROT2.neck2", 8, 10); - setTextureOffset("NECKROT3.neck3", 8, 10); - setTextureOffset("HEADROT.mouthbot", 0, 25); - setTextureOffset("HEADROT.mouthtal", 6, 25); - setTextureOffset("HEADROT.mouthtop", 0, 21); - setTextureOffset("HEADROT.head", 0, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F, 24.5F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, 0F, 1F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -0.5F, -2F, -0.5F, 1, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("mouthbot", -0.5F, 0.5F, -4F, 1, 1, 2); - HEADROT.addBox("mouthtal", -1F, 0.5F, -5F, 2, 2, 1); - HEADROT.addBox("mouthtop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - NECKROT3.addChild(HEADROT); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - BODYROT.addChild(NECKROT1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); - break; - - default: - NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/1157c1f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/1157c1f6c42100141fce95f06aba7e85 deleted file mode 100644 index ac1f061..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/1157c1f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityUniversalFlowerPotRenderer extends TileEntitySpecialRenderer { - private RenderBlocks blockRenderer = new RenderBlocks(); - private RenderItem itemRenderer = new RenderItem(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - - renderTileEntityUniversalFlowerPotAt((TileEntityUniversalFlowerPot) tileEntity, xRenderCoord, yRenderCoord, - zRenderCoord, var8); - } - - private void renderTileEntityUniversalFlowerPotAt(TileEntityUniversalFlowerPot tileEntity, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float var8) { - - ItemStack itemStackToRender = tileEntity.getStackInSlot(0); - - if (itemStackToRender != null) { - Item itemToRender = itemStackToRender.getItem(); - - /* Try to See if I should render as Block */ - if (itemToRender != null && itemToRender instanceof ItemBlock - && Block.getBlockFromItem(itemToRender).getRenderType() != -1) { - Block blockToRender = Block.getBlockFromItem(itemToRender); - int meta = itemStackToRender.getItemDamage() > 16 ? 16 : itemStackToRender.getItemDamage() < 0 ? 0 - : itemStackToRender.getItemDamage(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glPushMatrix(); - float scaleBlock = (float) (0.29f / (blockToRender.getBlockBoundsMaxX() - blockToRender - .getBlockBoundsMinX())); - float scaleY = (float) (scaleBlock * (blockToRender.getBlockBoundsMaxY() - blockToRender - .getBlockBoundsMinY())); - - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.2 + scaleY), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleBlock, scaleBlock, scaleBlock); - - float brightness = 15f; - this.blockRenderer.renderBlockAsItem(blockToRender, meta, brightness); - GL11.glPopMatrix(); - return; - } - - /* Finally, try to render as Item */ - if (itemToRender != null) { - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(tileEntity.getWorldObj(), xRenderCoord, yRenderCoord, - zRenderCoord, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 0.6f; - GL11.glPushMatrix(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - - } - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/12d2669ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/12d2669ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 528bf77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/12d2669ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLimitedMobSpawner extends BlockContainer { - - public BlockLimitedMobSpawner() { - super(Material.rock); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, - float par7, float par8, float par9) { - if (player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isCreativeMode) { - ((EntityPlayer) player).openGui(ProjectZulu_Core.modInstance, GuiID.MobSpawner.getID(), par1World, par2, - par3, par4); - return true; - } - return super.onBlockActivated(par1World, par2, par3, par4, player, par6, par7, par8, par9); - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityLimitedMobSpawner(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/20bfc39ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/20bfc39ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 82e5329..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/20bfc39ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/21f63cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/21f63cf4c42100141fce95f06aba7e85 deleted file mode 100644 index a84e914..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/21f63cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/3131f09fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/3131f09fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89d0736..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/3131f09fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomMid extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomMid(boolean inverted) { - super(inverted); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (inverted) { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(piecePos.posX + 1) == 0) { - return true; - } - } else { - if (piecePos.posZ > 1 || piecePos.posZ == 1 && random.nextInt(cellSize - 1 - piecePos.posX + 1) == 0) { - return true; - } - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randomMid"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/418002ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/418002ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 202fbfd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/418002ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,326 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/42b7e9a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/42b7e9a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 37a69c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/42b7e9a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,159 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/505c78f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/505c78f5c42100141fce95f06aba7e85 deleted file mode 100644 index bbcd41c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/505c78f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/50caa7f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/50caa7f8c42100141fce95f06aba7e85 deleted file mode 100644 index 8bff96e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/50caa7f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,351 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/51bbe69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/51bbe69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6097c98..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/51bbe69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryEdge implements Blueprint { - - List wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/812f6efec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/812f6efec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f5e998..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/812f6efec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRate extends KeyParserBase { - - public KeyParserSpawnRate(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRate(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/90c355e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/90c355e4c42100141fce95f06aba7e85 deleted file mode 100644 index 456469b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/90c355e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/b0f280f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/b0f280f6c42100141fce95f06aba7e85 deleted file mode 100644 index 9de21f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/b0f280f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public interface TerrainFeature { - - /** - * The ordinal declaration of this ENUM determines priority during feature generation. Value declared first gets - * precedent. - */ - enum Size { - /* Feature is larger than a single chunk */ - LARGE, - /* Is approximately the size of a chunk */ - MEDIUM, - /* Size is less than a chunk, but more than a block */ - SMALL, - /* Spans a single or a couple blocks */ - TINY - } - - public enum FeatureDirection { - /* Structure should be centered on Current Block */ - CENTERED, - /* Structure should be centered along X but generate along -Z axis away from this block */ - NORTH, - /* Structure should be centered along X but generate along +Z axis away from this block */ - SOUTH, - /* Structure should be centered along Z but generate along -X axis away from this block */ - WEST, - /* Structure should be centered along Z but generate along +X axis away from this block */ - EAST; - } - - public abstract String getFeatureName(); - - public abstract boolean isEnabled(); - - public abstract Size getFeatureSize(); - - public abstract void initialize(File modConfigDirectory); - - /** - * From the World and Chunk. Generates an array of positions to attempt to generate the feature at. - * - * Each Point should be able to spawn - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @return - */ - public abstract ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ); - - /** - * Determines if the Feature can generate at the specified coordinates - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @param genBlockCoords Coordinates to generate at - * @param random - * @return - */ - public abstract boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random, FeatureDirection direction); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d03bd3e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d03bd3e5c42100141fce95f06aba7e85 deleted file mode 100644 index 25a049d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/d03bd3e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,24 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionCleansing extends PotionZulu { - - public PotionCleansing(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(1, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - super.performEffect(effectedEntity, par2); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/e05fa6f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/e05fa6f7c42100141fce95f06aba7e85 deleted file mode 100644 index 790e033..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b5/e05fa6f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/00a1389fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/00a1389fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b74157..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/00a1389fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBrownBear extends ModelBear { - - public ModelBrownBear() { - super(7); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.4f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/1059faa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/1059faa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 58633e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/1059faa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,173 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelRhino extends ModelBase { - float heightToRaise = 9f; - float renderScale = 1.6f; - - ModelRenderer LEG3ROT; - ModelRenderer LEG4ROT; - ModelRenderer LEG2ROT; - ModelRenderer HEADROT; - ModelRenderer LEG1ROT; - ModelRenderer TAILROT; - ModelRenderer BODYROT; - - public ModelRhino() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG3ROT.leg3", 48, 13); - setTextureOffset("LEG3ROT.toe31", 0, 0); - setTextureOffset("LEG3ROT.toe32", 0, 0); - setTextureOffset("LEG3ROT.toe33", 0, 0); - setTextureOffset("LEG4ROT.leg4", 68, 13); - setTextureOffset("LEG4ROT.toe41", 0, 0); - setTextureOffset("LEG4ROT.toe42", 0, 0); - setTextureOffset("LEG4ROT.toe43", 0, 0); - setTextureOffset("LEG2ROT.leg2", 68, 0); - setTextureOffset("LEG2ROT.toe21", 0, 0); - setTextureOffset("LEG2ROT.toe22", 0, 0); - setTextureOffset("LEG2ROT.toe23", 0, 0); - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - setTextureOffset("LEG1ROT.toe11", 0, 0); - setTextureOffset("LEG1ROT.toe12", 0, 0); - setTextureOffset("LEG1ROT.toe13", 0, 0); - setTextureOffset("LEG1ROT.leg1", 48, 0); - setTextureOffset("TAILROT.tail", 0, 25); - setTextureOffset("BODYROT.leg1dec", 20, 25); - setTextureOffset("BODYROT.leg2dec", 20, 25); - setTextureOffset("BODYROT.body", 0, 32); - - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG3ROT.addBox("toe31", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe32", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe33", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG4ROT.addBox("toe41", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe42", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe43", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(4F, 15F - heightToRaise, -5F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2.5F, 1F, -2.5F, 5, 8, 5); - LEG2ROT.addBox("toe21", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe22", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe23", 1.5F, 8F, -3.5F, 1, 1, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 9F - heightToRaise, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-4F, 15F - heightToRaise, -5F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("toe11", -2.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe12", -0.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe13", 1.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("leg1", -2.5F, 1F, -2F, 5, 8, 5); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 9F - heightToRaise, 12F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.5F, -0.5F, 0F, 1, 1, 6); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F - heightToRaise, -8F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("leg1dec", -7F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("leg2dec", 1F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("body", -7F, -7F, 0F, 14, 12, 20); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 6.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(renderScale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - GL11.glPopMatrix(); - } else { - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - HEADROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Constant Animation Rotations */ - LEG1ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - TAILROT.rotateAngleX = (float) (-90 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/11ebca9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/11ebca9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d361281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/11ebca9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,340 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.Properties; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/20f187f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/20f187f9c42100141fce95f06aba7e85 deleted file mode 100644 index f4f9d36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/20f187f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/314fe7f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/314fe7f9c42100141fce95f06aba7e85 deleted file mode 100644 index ee17c58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/314fe7f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,163 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.terrain.CathedralFeature; -import com.ngb.projectzulu.common.world.terrain.CemetaryFeature; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; -import com.ngb.projectzulu.common.world.terrain.OasisFeature; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/329d5ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/329d5ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2bb5234..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/329d5ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluStairs; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/419e85a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/419e85a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ac94f9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/419e85a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/52206be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/52206be4c42100141fce95f06aba7e85 deleted file mode 100644 index e404ac4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/52206be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemWateredDirt extends ItemBlock { - - public ItemWateredDirt(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "soil_1"; - break; - } - case 1: { - name = "soil_2"; - break; - } - case 2: { - name = "soil_3"; - break; - } - case 3: { - name = "soil_4"; - break; - } - case 4: { - name = "sand_1"; - break; - } - case 5: { - name = "sand_2"; - break; - } - case 6: { - name = "sand_3"; - break; - } - case 7: { - name = "sand_4"; - break; - } - default: - name = "ore"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/60e941a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/60e941a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dbe60f3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/60e941a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/71b6c8ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/71b6c8ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0890879..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/71b6c8ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLeaves; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLeavesDeclaration extends BlockDeclaration { - - public PalmTreeLeavesDeclaration() { - super("PalmTreeLeaves"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLeaves = Optional.of((new BlockPalmTreeLeaves()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLeaves.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("leaves", new ItemStack(block)); - OreDictionary.registerOre("leavesPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/8005099fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/8005099fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a9f4fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/8005099fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.models.ModelArmadillo; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ArmadilloDeclaration extends SpawnableDeclaration { - - public ArmadilloDeclaration() { - super("Armadillo", 0, EntityArmadillo.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 2, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (116 << 16) + (64 << 8) + 33; - eggColor2 = (60 << 16) + (51 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/807d66a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/807d66a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8211f0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/807d66a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,105 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGiraffe extends EntityGenericAnimal { - - public EntityGiraffe(World par1World) { - super(par1World); - setSize(2.3f, 4.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.3D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 8), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/81999d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/81999d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 33df0df..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/81999d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/904da200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/904da200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6003006..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/904da200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityCentipede extends EntityMaster implements IMob { - - public EntityCentipede(World par1World) { - super(par1World); - setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - - return var4 <= this.rand.nextInt(8); - } - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void updateAITick() { - super.updateAITick(); - /* Become Hostile at Night */ - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/b081f39ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/b081f39ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 89c12e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/b081f39ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/b17a7de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/b17a7de5c42100141fce95f06aba7e85 deleted file mode 100644 index 2795ab9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/b17a7de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; -import projectzulu.common.mobs.renders.RenderMummyPharaoh; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/c1f6d7e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/c1f6d7e5c42100141fce95f06aba7e85 deleted file mode 100644 index 581f7d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/c1f6d7e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionIncendiary extends PotionZulu { - - public PotionIncendiary(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(1, 2); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int par2) { - super.performEffect(par1EntityLiving, par2); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int par3, double par4) { - par2EntityLiving.setFire((int) (2 + 1.5 * par3)); - super.affectEntity(par1EntityLiving, par2EntityLiving, par3, par4); - } - - @Override - public boolean isInstant() { - return true; - } - - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d05ed6e7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d05ed6e7c42100141fce95f06aba7e85 deleted file mode 100644 index 787fbd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d05ed6e7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d068aaf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d068aaf5c42100141fce95f06aba7e85 deleted file mode 100644 index 75f7c84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d068aaf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,25 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Comparator; - -import net.minecraft.entity.Entity; -public class EntityAINearestAttackableTargetSorter implements Comparator{ - private Entity theEntity; - - final EntityAINearestAttackableTarget parent; - - public EntityAINearestAttackableTargetSorter(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, Entity par2Entity){ - this.parent = par1EntityAINearestAttackableTarget; - this.theEntity = par2Entity; - } - - public int compareDistanceSq(Entity par1Entity, Entity par2Entity){ - double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); - double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - - public int compare(Object par1Obj, Object par2Obj){ - return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d11cebfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d11cebfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77e0029..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/d11cebfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f0173c2bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f0173c2bc52100141fce95f06aba7e85 deleted file mode 100644 index 26593f9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f0173c2bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f065dca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f065dca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 86de767..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f065dca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon; - -public enum ButtonIDs { - NEWENTRY(-1), SAVENCLOSE(-2), DELENTRY(-6), CANCEL(-3), FORWARD(-4), BACKWARDS(-5); - - int index; - - ButtonIDs(int index) { - this.index = index; - } - - public static ButtonIDs getButtonByIndex(int index) { - for (ButtonIDs buttonID : ButtonIDs.values()) { - if (buttonID.index == index) { - return buttonID; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f13b63e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f13b63e5c42100141fce95f06aba7e85 deleted file mode 100644 index 6c5217a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f13b63e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.models.ModelFollower; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f1c29cf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f1c29cf7c42100141fce95f06aba7e85 deleted file mode 100644 index bea983d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b6/f1c29cf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import com.ngb.projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import com.ngb.projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import com.ngb.projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/015ba39dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/015ba39dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c228621..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/015ba39dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,332 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/0288d49ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/0288d49ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b338830..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/0288d49ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/107f5bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/107f5bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 3b2599b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/107f5bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/10bd0201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/10bd0201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3976acd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/10bd0201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/21abf2f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/21abf2f7c42100141fce95f06aba7e85 deleted file mode 100644 index 2b7fc01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/21abf2f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectCathedral; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/4194e2f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/4194e2f9c42100141fce95f06aba7e85 deleted file mode 100644 index 9df30d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/4194e2f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelTombstone extends ModelBase -{ - //fields - ModelRenderer baserig; - ModelRenderer body4; - ModelRenderer topcenter; - ModelRenderer baselef; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - private ModelRenderer CENTERROT; - private ModelRenderer TOPLEFROT; - private ModelRenderer TOPRIGROT; - - public ModelTombstone(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TOPLEFROT.topleft", 0, 17); - setTextureOffset("TOPRIGROT.topright", 0, 17); - - body4 = new ModelRenderer(this, 28, 15); - body4.addBox(0F, -18F, -4.5F, 9, 8, 9); - body4.setRotationPoint(0F, 28F, 0F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - topcenter = new ModelRenderer(this, 28, 16); - topcenter.addBox(-4.5F, -4F, -4.5F, 9, 4, 9); - topcenter.setRotationPoint(0F, 2F, 0F); - topcenter.setTextureSize(64, 32); - topcenter.mirror = true; - setRotation(topcenter, 0F, 0F, 0F); - body3 = new ModelRenderer(this, 28, 15); - body3.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body3.setRotationPoint(0F, 28F, 0F); - body3.setTextureSize(64, 32); - body3.mirror = true; - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body3.mirror = false; - body2 = new ModelRenderer(this, 28, 15); - body2.addBox(0F, -18F, -4.5F, 9, 8, 9); - body2.setRotationPoint(0F, 20F, 0F); - body2.setTextureSize(64, 32); - body2.mirror = true; - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body2.mirror = false; - body1 = new ModelRenderer(this, 28, 15); - body1.addBox(-9F, -18F, -4.5F, 9, 8, 9); - body1.setRotationPoint(0F, 20F, 0F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - baselef = new ModelRenderer(this, 0, 0); - baselef.addBox(-12F, -3F, -6F, 12, 6, 12); - baselef.setRotationPoint(0F, 21F, 0F); - baselef.setTextureSize(64, 32); - baselef.mirror = true; - baselef.mirror = true; - setRotation(baselef, 0F, 0F, 0F); - baselef.mirror = false; - baserig = new ModelRenderer(this, 0, 0); - baserig.addBox(0F, -3F, -6F, 12, 6, 12); - baserig.setRotationPoint(0F, 21F, 0F); - baserig.setTextureSize(64, 32); - baserig.mirror = true; - baserig.mirror = true; - setRotation(baserig, 0F, 0F, 0F); - baserig.mirror = false; - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 1.2F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - TOPLEFROT = new ModelRenderer(this, "TOPLEFROT"); - TOPLEFROT.setRotationPoint(-5.8F, 0F, 0F); - setRotation(TOPLEFROT, 0F, 0F, 0.837758F); - TOPLEFROT.mirror = true; - TOPLEFROT.addBox("topleft", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPLEFROT); - TOPRIGROT = new ModelRenderer(this, "TOPRIGROT"); - TOPRIGROT.setRotationPoint(5.8F, 0F, 0F); - setRotation(TOPRIGROT, 0F, 0F, -0.837758F); - TOPRIGROT.mirror = true; - TOPRIGROT.addBox("topright", -1.5F, -3F, -4.5F, 3, 6, 9); - CENTERROT.addChild(TOPRIGROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - baserig.render(f5); - body4.render(f5); - topcenter.render(f5); - baselef.render(f5); - body3.render(f5); - body2.render(f5); - body1.render(f5); - - CENTERROT.render(f5); - - } - - public void render1(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - body4.rotateAngleY = (float) (angle*Math.PI/180); - body4.render(f5); - topcenter.rotateAngleY = (float) (angle*Math.PI/180); - topcenter.render(f5); - - body3.rotateAngleY = (float) (angle*Math.PI/180); - body3.render(f5); - body2.rotateAngleY = (float) (angle*Math.PI/180); - body2.render(f5); - body1.rotateAngleY = (float) (angle*Math.PI/180); - body1.render(f5); - - baselef.rotateAngleY = (float) (angle*Math.PI/180); - baselef.render(f5); - baserig.rotateAngleY = (float) (angle*Math.PI/180); - baserig.render(f5); - } - - public void render2(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, float angle){ - CENTERROT.rotateAngleY = (float) (angle*Math.PI/180); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } - -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/517045f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/517045f6c42100141fce95f06aba7e85 deleted file mode 100644 index 880806b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/517045f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/51864ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/51864ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 62e8ae8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/51864ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/518be2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/518be2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a8131d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/518be2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,556 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/7061f9e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/7061f9e5c42100141fce95f06aba7e85 deleted file mode 100644 index c91fc31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/7061f9e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/80158a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/80158a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ffdc47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/80158a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/81160afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/81160afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ad2b0ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/81160afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,163 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.terrain.TerrainFeature; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; - -public class ItemStructurePlacer extends Item { - - String[] structureName = new String[] { "Oasis", "Pyramid", "Labyrinth", "Cemetary", "Cathedral" }; - - public ItemStructurePlacer(String baseName) { - super(); - setHasSubtypes(true); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(baseName); - setTextureName("paper"); - } - - @Override - public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { - if (!par2World.isRemote) { - int buildingID = par1ItemStack.getItemDamage(); - int Xcoord = (int) par3EntityPlayer.posX; - int Zcoord = (int) par3EntityPlayer.posZ; - int Ycoord = ((int) par3EntityPlayer.posY) - 1; - - switch (buildingID) { - case 0: { - /* Oasis Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(OasisFeature.OASIS); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 1: { - /* Pyramid Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 2: { - /* Labyrinth Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 3: { - /* Cemetary Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CemetaryFeature.CEMETARY); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - case 4: { - /* Cathedral Generation */ - TerrainFeature terrainFeature = ProjectZulu_Core.featureGenerator - .getRegisteredStructure(CathedralFeature.CATHEDRAL); - if (terrainFeature != null) { - terrainFeature.generateFeature(par2World, Xcoord / 16, Zcoord / 16, new ChunkCoordinates(Xcoord, - Ycoord + 1, Zcoord), par2World.rand, calculateFeatureDirection(par3EntityPlayer)); - } - break; - } - default: - break; - } - } - - if (!par3EntityPlayer.capabilities.isCreativeMode) { - par1ItemStack.stackSize--; - } - - } - - private FeatureDirection calculateFeatureDirection(EntityPlayer player) { - if (player.isSneaking()) { - return FeatureDirection.CENTERED; - } else { - int direction = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - if (direction == 0) { - return FeatureDirection.SOUTH; - } else if (direction == 1) { - return FeatureDirection.WEST; - } else if (direction == 2) { - return FeatureDirection.NORTH; - } else if (direction == 3) { - return FeatureDirection.EAST; - } - } - throw new IllegalArgumentException(); - } - - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 16; - } - - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - return par1ItemStack; - } - - /** - * Return an item rarity from EnumRarity - */ - @Override - public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - try { - return super.getUnlocalizedName().concat(".") - .concat(structureName[itemstack.getItemDamage()].toLowerCase()); - } catch (Exception e) { - return ""; - } - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (int i = 0; i < structureName.length; i++) { - par3List.add(new ItemStack(par1, 1, i)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/90137f9bbeab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/90137f9bbeab00141ee9bf3050c1025b new file mode 100644 index 0000000..791ea17 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/90137f9bbeab00141ee9bf3050c1025b @@ -0,0 +1,292 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(24) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a0f71e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a0f71e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3400199..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/a0f71e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGorilla; -import projectzulu.common.mobs.models.ModelGorilla; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GorillaDeclaration extends SpawnableDeclaration { - - public GorillaDeclaration() { - super("Gorilla", 25, EntityGorilla.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (25 << 16) + (25 << 8) + 25; - eggColor2 = (93 << 16) + (93 << 8) + 93; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGorilla(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "gorilla.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b086e400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b086e400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75ca5c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/b086e400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c123aff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c123aff5c42100141fce95f06aba7e85 deleted file mode 100644 index 505a6c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/c123aff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,157 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/d10daea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/d10daea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 61489ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/d10daea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBoar; -import projectzulu.common.mobs.models.ModelBoar; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/d130b8fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/d130b8fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7590b03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/d130b8fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; -import net.minecraft.util.MathHelper; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f1749df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f1749df9c42100141fce95f06aba7e85 deleted file mode 100644 index 19addc9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b7/f1749df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10c38affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10c38affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 44aafec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10c38affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,382 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - //return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - // par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - return AxisAlignedBB.getBoundingBox(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10e127f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10e127f7c42100141fce95f06aba7e85 deleted file mode 100644 index 80bcc79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/10e127f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/207988ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/207988ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5dcdd90..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/207988ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,264 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/20c962a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/20c962a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee4d172..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/20c962a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.spike.BlockSpikes; -import projectzulu.common.blocks.spike.RenderSpike; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/31c56dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/31c56dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index db7fd86..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/31c56dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,95 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY % 2 == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "cemeterytomb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/500aa201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/500aa201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6616e7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/500aa201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprint.cathedral.BPSetCathedral; - -public class ArchitectCathedral extends ArchitectBase { - - public ArchitectCathedral(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetCathedral()); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - set = stockpile.getRandomApplicable(cells, buildCoords); - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/514ae0f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/514ae0f9c42100141fce95f06aba7e85 deleted file mode 100644 index 13eaabc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/514ae0f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,605 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCampFire implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - RenderItem itemRenderer = new RenderItem(); - - ItemStack itemStackToRender = new ItemStack(block, 1, metadata); - - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 1.5f; - GL11.glPushMatrix(); - - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef((float) (90f * Math.PI / 180f), 1, 0, 0); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - /** - * Render Campfire Stones - */ - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case WoodFire: - case StoneFire: - /* Render If Should and Render Campfire Fire */ - renderBlockFire(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - break; - case Stone: - case Wood: - break; - } - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case Wood: - case WoodFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.35, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.24, var20, var15 + 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.24, var20, var15 - 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.21, var20, var15 + 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.21, var20, var15 - 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - break; - case Stone: - case StoneFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Stones */ - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 + 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 - 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - break; - } - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle2Sides(Block par1Block, int index1, int index2, int par2, double par3, - double par5, double par7, RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - double var13 = var10.getMinU(); - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2.01f; - double var17 = var10.getMinV(); - double var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) / 2.01f; - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 0.99f / 4f; - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 2.99f / 4f; - var17 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 0.99f / 4f; - var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 2.99f / 4f; - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle(Block par1Block, int var10, int par2, double par3, double par5, double par7, - RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 3, 2); - double var13 = icon.getMinU(); - double var15 = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / 2.01f; - double var17 = icon.getMinV(); - double var19 = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / 2.01f; - - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - return true; - } - - /** - * Renders a fire block at the given coordinates - */ - public boolean renderBlockFire(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - Tessellator var5 = Tessellator.instance; - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.fire, 0, 0); - double var9 = icon.getMinU(); - double var11 = icon.getMaxU(); - double var13 = icon.getMinV(); - double var15 = icon.getMaxV(); - - float var17 = 1.4F; - double var20; - double var22; - double var24; - double var26; - double var28; - double var30; - double var32; - - if (!World.doesBlockHaveSolidTopSurface(blockAccess, par2, par3 - 1, par4) - && !Blocks.fire.canCatchFire(blockAccess, par2, par3 - 1, par4, ForgeDirection.UP)) { - float var36 = 0.2F; - float var19 = 0.0625F; - - if ((par2 + par3 + par4 & 1) == 1) { - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - } - - if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { - var20 = var11; - var11 = var9; - var9 = var20; - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 - 1, par3, par4, ForgeDirection.EAST)) { - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 + 1, par3, par4, ForgeDirection.WEST)) { - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - var20 = par2 + 0.5D + 0.5D; // 1 - var22 = par2 + 0.5D - 0.5D; // 0 - var24 = par4 + 0.5D + 0.5D; - var26 = par4 + 0.5D - 0.5D; - - var28 = par2 + 0.5D - 0.5D; - var30 = par2 + 0.5D + 0.5D; - var32 = par4 + 0.5D - 0.5D; - double var34 = par4 + 0.5D + 0.5D; - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - ++par3; - var17 = -0.2F; - - if ((par2 + par3 + par4 & 1) == 0) { - var5.addVertexWithUV(var28, par3 + var17, par4 + 0, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 1, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 1, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(var30, par3 + var17, par4 + 1, var11, var13); - var5.addVertexWithUV(var22, par3 + 0, par4 + 1, var11, var15); - var5.addVertexWithUV(var22, par3 + 0, par4 + 0, var9, var15); - var5.addVertexWithUV(var30, par3 + var17, par4 + 0, var9, var13); - } else { - var5.addVertexWithUV(par2 + 0, par3 + var17, var34, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0, var26, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0, var26, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17, var34, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 1, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17, var32, var9, var13); - } - } - } else { - double var18 = par2 + 0.5D + 0.2D; - var20 = par2 + 0.5D - 0.2D; // - var22 = par4 + 0.5D + 0.2D; - var24 = par4 + 0.5D - 0.2D; - var26 = par2 + 0.5D - 0.3D; - var28 = par2 + 0.5D + 0.3D; - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - - var18 = par2 + 0.5D - 0.3D; // - var20 = par2 + 0.5D + 0.3D; // / - var22 = par4 + 0.5D - 0.3D; - var24 = par4 + 0.5D + 0.3D; - var26 = par2 + 0.5D - 0.3D; // - var28 = par2 + 0.5D + 0.3D; // / - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - } - - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/725935f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/725935f8c42100141fce95f06aba7e85 deleted file mode 100644 index a930008..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/725935f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.ChestGenHooks; - -public class ChestWithMeta extends BlockWithMeta { - - int lootChance; - int maxLoot; - TileEntityChest tileEntityChest; - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance) { - this(block, meta, tileEntityChest, lootChance, -1); - } - - public ChestWithMeta(Block block, int meta, TileEntityChest tileEntityChest, int lootChance, int maxLoot) { - super(block, meta); - this.tileEntityChest = tileEntityChest; - this.lootChance = lootChance; - this.maxLoot = maxLoot; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntityChest); - int amountOfLoot = 0; - for (int slot = 0; slot < tileEntityChest.getSizeInventory(); slot++) { - if (lootChance - random.nextInt(100) >= 0) { - tileEntityChest.setInventorySlotContents(slot, ChestGenHooks.getOneItem(DUNGEON_CHEST, random)); - amountOfLoot++; - if (maxLoot > 0 && amountOfLoot >= maxLoot) { - break; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/810236a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/810236a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5dd694e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/810236a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionBlindness; -import projectzulu.common.potion.subitem.SubItemPotionBubbling; -import projectzulu.common.potion.subitem.SubItemPotionCleansing; -import projectzulu.common.potion.subitem.SubItemPotionCurse; -import projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import projectzulu.common.potion.subitem.SubItemPotionJump; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionResistance; -import projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import projectzulu.common.potion.subitem.SubItemPotionThorns; -import projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/8194069fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/8194069fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4038f7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/8194069fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCrocodile; -import projectzulu.common.mobs.models.ModelCrocodile; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/9054329ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/9054329ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index edc63b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/9054329ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/91d197a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/91d197a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2d2cce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/91d197a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,107 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a0f156f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a0f156f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2d8060b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a0f156f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,198 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -public class ModelCentipede extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelCentipede() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - sidebody2.render(f5); - body.render(f5); - sidebody3.render(f5); - sidebody1.render(f5); - ANTENLEFROT1.render(f5); - ANTENRIGROT1.render(f5); - LEG11ROT.render(f5); - LEG21ROT.render(f5); - LEG31ROT.render(f5); - LEG41ROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - - ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a1c1c79fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a1c1c79fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 146cbb6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a1c1c79fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Random; - -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BlueprintSetStockpile { - private HashMap blueprintSetList = new HashMap(); - public Random random; - - BlueprintSetStockpile(Random random) { - this.random = random; - } - - public void addBlueprintSet(BlueprintSet blueprintSet) { - if (blueprintSet == null || blueprintSetList.containsKey(blueprintSet.getIdentifier())) { - throw new IllegalArgumentException("BlueprintSet " + blueprintSet == null ? "cannot be null" - : "ID is already taken"); - } - blueprintSetList.put(blueprintSet.getIdentifier(), blueprintSet); - } - - public BlueprintSet getBlueprintSet(String setID) { - return blueprintSetList.get(setID); - } - - public BlueprintSet getBlueprintSet(MazeCell cell) { - String[] parts = cell.getBuildingID().split("-"); - String setCategory = parts[0]; - return blueprintSetList.get(setCategory); - } - - /** - * Gets a random applicable blueprint for the given BuildCoords - */ - public BlueprintSet getRandomApplicable(MazeCell[][] cells, Point buildCoords) { - int totalWeight = 0; - Collection applicableSets = new ArrayList(); - for (BlueprintSet set : blueprintSetList.values()) { - if (set.isApplicable(cells, buildCoords, random) && set.getWeight() > 0) { - totalWeight += set.getWeight(); - applicableSets.add(set); - } - } - totalWeight = random.nextInt(totalWeight + 1); - for (BlueprintSet set : applicableSets) { - totalWeight -= set.getWeight(); - if (totalWeight <= 0) { - return set; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a1ecbff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a1ecbff5c42100141fce95f06aba7e85 deleted file mode 100644 index 83e7ffe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/a1ecbff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/b110f19ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/b110f19ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f68843a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/b110f19ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c15a7ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c15a7ff8c42100141fce95f06aba7e85 deleted file mode 100644 index d675fc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/c15a7ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.HashMap; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class PotionIngredients { - - public static interface IngredientProperty { - public abstract boolean isIngredient(ItemStack ingredient); - } - - public static class OverrideIngredient implements IngredientProperty { - boolean isIngredient = true; - - @Override - public boolean isIngredient(ItemStack ingredient) { - return isIngredient; - } - } - - private static HashMap ingredientProperties = new HashMap(); - - static { - addIngredientProperties(Items.feather, new OverrideIngredient()); - } - - public static void addIngredientProperties(Item item, IngredientProperty ingredientProperty) { - ingredientProperties.put(item, ingredientProperty); - } - - public static boolean isPotionIngredient(ItemStack ingredient) { - if (ingredient == null) { - return false; - } - - IngredientProperty property = ingredientProperties.get(ingredient.getItem()); - if (property != null) { - return property.isIngredient(ingredient); - } else { - return ingredient != null ? ingredient.getItem().isPotionIngredient(ingredient) : false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/d029e59ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/d029e59ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5414777..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/d029e59ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,152 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.client.model.ModelRenderer; -/** - * Used for Models that need to Track their Rotation - * i.e. Rotate based on their previous rotation angle - * See {@link #ModelArmadillo} - */ -public class EntityModelRotation { - public float rotateAngleX = 0; - public float rotateAngleY = 0; - public float rotateAngleZ = 0; - - public float rotationPointX; - public float rotationPointY; - public float rotationPointZ; - - public Boolean isSetup = false; - public String assignedPiece = "nothing"; - - private int xAngleDirec = 1; - private int yAngleDirec = 1; - public int zAngleDirec = 1; - - public EntityModelRotation() {} - - public void setup(ModelRenderer modelRenderer){ - rotateAngleX = modelRenderer.rotateAngleX; - rotateAngleY = modelRenderer.rotateAngleY; - rotateAngleZ = modelRenderer.rotateAngleZ; - rotationPointX = modelRenderer.rotationPointX; - rotationPointY = modelRenderer.rotationPointY; - rotationPointZ = modelRenderer.rotationPointZ; - - isSetup = true; - assignedPiece = modelRenderer.boxName; - } - - public float rotateX(float increment, float min, float max){ - rotateAngleX = clamp(rotateAngleX+increment, min, max); - return rotateAngleX; - } - - public float rotateY(float increment, float min, float max){ - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - public float rotateZ(float increment, float min, float max){ - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - - /** - * rotateZ Angle. - * par4 = 0 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min - */ - public float rotateZ(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleZ; - - case 2: - if(rotateAngleZ+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = max; - return rotateAngleZ; - } - - if(rotateAngleZ+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = min; - return rotateAngleZ; - } - - rotateAngleZ = rotateAngleZ+increment*zAngleDirec; - return rotateAngleZ; - - default: - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - } - - /* - * rotateY Angle. - * par4 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min (Uses Cosine) - */ - public float rotateY(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleY; - - case 2: - if(rotateAngleY+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = max; - return rotateAngleY; - } - - if(rotateAngleY+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = min; - return rotateAngleY; - } - - rotateAngleY = rotateAngleY+increment*zAngleDirec; - return rotateAngleY; - - default: - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - } - - - - private float clamp(float number, float min, float max){ - return Math.max(Math.min(number, max), min); - } - private float loop(float number, float min, float max){ - if(number>max){ - return min+number-max; - } - if(number - * Command stringArgs == 2: /spawnentity @p entityName - * Command stringArgs == 5: /spawnentity @p entityName - * Command stringArgs == 7: /spawnentity @p entityName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs){ - if(stringArgs.length < 2){ - throw new WrongUsageException("commands.spawnentity.usage", new Object[0]); - }else{ - double spawnTargetX = 0; - double spawnTargetY = 0; - double spawnTargetZ = 0; - float rotYaw = 0; - float rotPitch = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if(targetPlayer == null){ - throw new PlayerNotFoundException(); - } - - Entity spawnableEntity = EntityList.createEntityByName(stringArgs[1], targetPlayer.worldObj); - if(spawnableEntity == null){ - System.out.println("Entity is Null"); - throw new WrongUsageException("commands.spawnentity.noentity", new Object[0]); - } - - if(stringArgs.length == 2){ - spawnTargetX = (int)targetPlayer.posX; - spawnTargetY = (int)targetPlayer.posY; - spawnTargetZ = (int)targetPlayer.posZ; - }else if(stringArgs.length == 5 || stringArgs.length == 7){ - int indexOfPos = stringArgs.length - 3; - spawnTargetX = (int)parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - spawnTargetY = (int)parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, 0); - spawnTargetZ = (int)parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - if(stringArgs.length == 7){ - rotYaw = parseIntBounded(commandSender, stringArgs[2], 0, 360); - rotPitch = parseIntBounded(commandSender, stringArgs[3], 0, 360); - } - -// ProjectZuluLog.info("Placing Block at %s, %s, %s with Yaw %s and pitch %s", spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch ); - spawnableEntity.setLocationAndAngles(spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch); - targetPlayer.worldObj.spawnEntityInWorld(spawnableEntity); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr){ - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble){ - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, int lowerLimit, int upperLimit){ - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1){ - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords){ - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords){ - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0){ - if (targetPos < (double)lowerLimit){ - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(targetPos), Integer.valueOf(lowerLimit)}); - } - - if (targetPos > (double)upperLimit){ - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(targetPos), Integer.valueOf(upperLimit)}); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e0afc700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e0afc700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4493e5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e0afc700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e111ab9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e111ab9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 521c87e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e111ab9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempArmor { - - /** - * Factor that adds to the current Player Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Item is Equipped - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Item is Equipped - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e1eacc01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e1eacc01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8dd52fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/e1eacc01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.BlockWithPalmTree; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f0039bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f0039bf9c42100141fce95f06aba7e85 deleted file mode 100644 index 9a8ecc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f0039bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.world.World; - -public class TerrainFeatureHelper { - - /** - * Method to evaluate the terrain variation. Compares the height along each point of an X to the center. - * If greater than provided difference return false; - * @param world - * @param Xcoord - * @param Ycoord - * @param Zcoord - * @param maxDifference - * @param squareLength - * @return - */ - public static boolean doesTerrainFluctuate(World world, int Xcoord, int Ycoord, int Zcoord, int maxDifference, int squareLength){ - if( Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord+squareLength) - Ycoord) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord+squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference){ - return false; - } - - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f19f0e9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f19f0e9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a480ea0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b8/f19f0e9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,19 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/00f16ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/00f16ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1c230cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/00f16ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.world.terrain; - -import net.minecraft.util.WeightedRandom; - -public class EntityEntry extends WeightedRandom.Item { - - public final String entityname; - - public EntityEntry(String entityname, int spawnWeight) { - super(spawnWeight); - if (entityname == null || entityname.trim() == "") { - throw new IllegalArgumentException("Entity Name Cannot be " + entityname == null ? "null" : "blank"); - } - this.entityname = entityname.trim(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/104400f0bfab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/104400f0bfab00141ee9bf3050c1025b new file mode 100644 index 0000000..8bf89f2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/104400f0bfab00141ee9bf3050c1025b @@ -0,0 +1,105 @@ +package com.stek101.projectzulu.common.mobs; + +import java.io.File; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.config.Configuration; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; + +public class BossHealthDisplayTicker { + + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + public static EntityGenericAnimal targetBoss; + protected Minecraft mc = Minecraft.getMinecraft(); + protected float zLevel = 0.0F; + static EntityPlayer player; + private Configuration config; + private boolean displayBossHealth = true; + private boolean bugRelease = true; + + // public BossHealthDisplayTicker (EntityGenericAnimal mobEntity) { + // this.targetBoss = mobEntity; + // } + + public static void registerEntity(EntityGenericAnimal newTicker) { + targetBoss = newTicker; + } + + public static boolean validTargetPresent(EntityGenericAnimal targetBoss) { + if (Minecraft.getMinecraft().thePlayer != null){ + //return targetBoss != null && !targetBoss.isDead && targetBoss.canEntityBeSeen(Minecraft.getMinecraft().thePlayer); + return targetBoss != null && !targetBoss.isDead && Minecraft.getMinecraft().thePlayer.canEntityBeSeen(targetBoss) + && (targetBoss.getDistanceToEntity(Minecraft.getMinecraft().thePlayer) < 16.0f); + } + else + return false; + } + + @SubscribeEvent + public void TickEvent(RenderTickEvent event) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + config.save(); + + if (event.phase == Phase.END && displayBossHealth) { + if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { + renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health"); + } + + } + } + + public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { + + FontRenderer fontRenderer = mc.fontRenderer; + + /* Draw Title */ + ScaledResolution var3 = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); + int screenWidth = var3.getScaledWidth(); + byte healthBarHeight = 12; + fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) + / 2, healthBarHeight - 10, 16711935); + + /* Draw Health Bar */ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(icons).getGlTextureId()); + short fullHealthBarWidth = 182; + int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; + int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); + + this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); + if (currHealthBarWidth > 0) { + this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); + var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); + var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); + var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); + var9.draw(); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/2130c69ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/2130c69ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d91deb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/2130c69ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,241 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Reminder: This is technically a 'Flying' Entity - */ -public class EntityFollower extends EntityLiving { - - EntityMaster masterEntity; - int followerIndex = -1; - - public int getFollowerIndex() { - return followerIndex; - } - - private Vec3 targetPosition = Vec3.createVectorHelper(0, 0, 0); - - public void setTargetPosition(Vec3 targetPosition) { - this.targetPosition = targetPosition; - } - - float targetRotation; - - public void setTargetRotation(float targetRotation) { - this.targetRotation = wrapAngleTo360(targetRotation); - } - - boolean shouldBeDying = false; - - /* Client Side Variable that Controls if it should Sync its Contents with Client Master */ - boolean isClientSetup = false; - - public EntityFollower(World par1World) { - super(par1World); - noClip = true; - setSize(0.65f, 0.5f); - } - - public EntityFollower(World par1World, double parx, double pary, double parz, EntityMaster masterEntity, - int followerIndex) { - this(par1World); - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.followerIndex = followerIndex; - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns False so that Entity doesn't Suffocate while in a wall - */ - @Override - public boolean isEntityInsideOpaqueBlock() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - - /* - * Note that the Client Side Entity will exists for several ticks before the masterEntity is Synced from server, - * So we only Check if should SetDead on Server - * - * Also, onReload, the Server will re-create its Children, this the old Children must dye. - */ - if (masterEntity == null && ticksExisted > 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/224ebdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/224ebdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 9451fa1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/224ebdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,140 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBeaver extends ModelBase { - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer HEADROT; - ModelRenderer TAILROT; - - public ModelBeaver() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - setTextureOffset("TAILROT.tail1", 0, 0); - setTextureOffset("TAILROT.tail2", 0, 3); - setTextureOffset("TAILROT.tail3", 0, 5); - setTextureOffset("TAILROT.tail4", 12, 0); - setTextureOffset("TAILROT.tail5", 12, 5); - - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -4F, -10F, 9, 8, 10); - body.setRotationPoint(0F, 18F, 7F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 8, 10); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - leg4.setRotationPoint(3.5F, 22F, 6F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 10); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - leg3.setRotationPoint(-3.5F, 22F, 6F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 10); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - leg1.setRotationPoint(-3.5F, 22F, -2F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 8, 10); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - leg2.setRotationPoint(3.5F, 22F, -2F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 18F, -3F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 1F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 3F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 3F, -5F, 1, 1, 1); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 7F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail1", -1.5F, -0.5F, 0F, 3, 1, 2); - TAILROT.addBox("tail2", -2F, -0.5F, 2F, 4, 1, 1); - TAILROT.addBox("tail3", -2.5F, -0.5F, 3F, 5, 1, 1); - TAILROT.addBox("tail4", -3F, -0.5F, 4F, 6, 1, 4); - TAILROT.addBox("tail5", -2.5F, -0.5F, 8F, 5, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - body.render(f5); - leg4.render(f5); - leg3.render(f5); - leg1.render(f5); - leg2.render(f5); - HEADROT.render(f5); - TAILROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - TAILROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/3001eca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/3001eca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6dbc811..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/3001eca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,262 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/40a67af5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/40a67af5c42100141fce95f06aba7e85 deleted file mode 100644 index fa65857..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/40a67af5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseBrown; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/40ec849fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/40ec849fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3ba720..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/40ec849fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/51d44aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/51d44aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bcfe6c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/51d44aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutSeed; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutSeedDeclaration extends ItemDeclaration { - - public CoconutSeedDeclaration() { - super("CoconutSeed"); - } - - @Override - protected boolean createItem() { - ItemList.coconutSeed = Optional.of(new ItemCoconutSeed(6, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutSeed.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/61d668e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/61d668e4c42100141fce95f06aba7e85 deleted file mode 100644 index fd1d328..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/61d668e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/7129a6a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/7129a6a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 50108b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/7129a6a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,5 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -public interface BuildingManager { - public abstract void generate(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/815d32f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/815d32f6c42100141fce95f06aba7e85 deleted file mode 100644 index 5a9b49b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/815d32f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/817ba29ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/817ba29ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1e5246b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/817ba29ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/902e76f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/902e76f4c42100141fce95f06aba7e85 deleted file mode 100644 index fe2c17e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/902e76f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/f2b8729ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/f2b8729ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f92b50a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b9/f2b8729ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; - -import org.lwjgl.util.Point; - -public class GuiSaveableTextField extends GuiTextField { - - public GuiSaveableTextField(FontRenderer fontRenderer, int xPos, int yPos, int width, int height) { - super(fontRenderer, xPos, yPos, width, height); - } - - public GuiSaveableTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(maxTextChars); - } - - public GuiSaveableTextField(GuiSaveableTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setText(oldTextFields.getText()); - setupTextField(maxTextChars); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/116ebbe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/116ebbe5c42100141fce95f06aba7e85 deleted file mode 100644 index d2424d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/116ebbe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/40b077ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/40b077ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a2ea3da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/40b077ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCathedral; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/606566e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/606566e4c42100141fce95f06aba7e85 deleted file mode 100644 index ad2f1ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/606566e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,139 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemFoodProjectZulu extends ItemFood { - /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; - - /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; - - /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; - - /** - * If this field is true, the food can be consumed even if the player don't need to eat. - */ - private boolean alwaysEdible; - - /** - * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect - */ - private int potionId; - - /** set by setPotionEffect */ - private int potionDuration; - - /** set by setPotionEffect */ - private int potionAmplifier; - - /** probably of the set potion effect occurring */ - private float potionEffectProbability; - - public ItemFoodProjectZulu(int par2, float par3, boolean par4, String name) { - super(par2, par3, par4); - itemUseDuration = 32; - healAmount = par2; - isWolfsFavoriteMeat = par4; - saturationModifier = par3; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - --par1ItemStack.stackSize; - par3EntityPlayer.getFoodStats().func_151686_a(this, par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); - this.func_77849_c(par1ItemStack, par2World, par3EntityPlayer); - return par1ItemStack; - } - - protected void func_77849_c(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/608704a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/608704a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d756151..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/608704a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/61e708f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/61e708f7c42100141fce95f06aba7e85 deleted file mode 100644 index 9ebec94..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/61e708f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemFoodProjectZulu; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/9129c1f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/9129c1f9c42100141fce95f06aba7e85 deleted file mode 100644 index 95a0081..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/9129c1f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.core; - -public class DefaultProps { - - /* ModIDs, Dependencies, and Version */ - public static final String DesiredBefore = "after:ExtrabiomesXL@"; - public static final String VERSION_STRING = "1.1.7.3"; - public static final String CoreModId = "ProjectZulu|Core"; - public static final String BlocksModId = "ProjectZulu|Block"; - public static final String MobsModId = "ProjectZulu|Mob"; - public static final String WorldModId = "ProjectZulu|World"; - public static final String DungeonModId = "ProjectZulu|Dungeon"; - public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; - - /* Packet Channels */ - public static final String defaultChannel = "Channel_Zulu"; - - /* Module Directory Keys */ - public static final String coreKey = "projectzulucore"; - public static final String mobKey = "projectzulumob"; - public static final String blockKey = "projectzulublock"; - public static final String worldKey = "projectzuluworld"; - public static final String dungeonKey = "projectzuludungeon"; - - /* Module Resource Directories */ - public static final String coreDiretory = "/mods/" + coreKey + "/"; - public static final String mobDiretory = "/mods/" + mobKey + "/"; - public static final String blockDiretory = "/mods/" + blockKey + "/"; - public static final String worldDiretory = "/mods/" + worldKey + "/"; - public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; - public static final String entitySoundDir = "mob/"; - public static final String entitySounds = entitySoundDir.replace("/", "."); - - /* Common Resource Sub-Directories */ - public static final String itemSubDir = "textures/blocks/"; - public static final String blockSubDir = "textures/blocks/"; -// public static final String blockSpriteSheet = blockDiretory + "blocks_projectzulu.png"; // TODO: Delete -// public static final String itemSpriteSheet = blockDiretory + "items_projectzulu.png"; // TODO: Delete - - /* Config Directories */ - public static final String configDirectory = "/Project Zulu/"; - public static final String customResourcesDirectory = "CustomResources/"; - public static final String streamingResourcesDirectory = "streaming/"; - public static final String soundResourcesDirectory = "sound/"; - public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; - public static final String moduleConfigFile = "ProjectZuluModules.cfg"; - public static final String tempConfigFile = "tempSettingsConfig.cfg"; - public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; - public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/a0ab1be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/a0ab1be5c42100141fce95f06aba7e85 deleted file mode 100644 index a2d89cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/a0ab1be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,217 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; - -public abstract class EntityGenericCreature extends EntityAerial { - private PathEntity pathToEntity; - - public boolean hasPath() { - return this.pathToEntity != null; - } - - /** The Entity this EntityCreature is set to attack. */ - protected Entity entityToAttack; - - public Entity getEntityToAttack() { - return this.entityToAttack; - } - - public void setTarget(Entity par1Entity) { - this.entityToAttack = par1Entity; - } - - private float maximumHomeDistance = -1.0F; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); - private boolean field_110180_bt; - // Cooldown instituted on the entity when it attempts to find a path but fails. - private int leashPathCooldown = 0; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0f); - - /** - * returns true if a creature has attacked recently only used for creepers and skeletons - */ - /* Do I need this? */ - // protected boolean hasAttacked = false; - - /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick = 0; - - public int getFleeTick() { - return fleeingTick; - } - - public void setFleeTick(int fleeingTick) { - this.fleeingTick = fleeingTick; - } - - /* Entity State Variables */ - protected int animTime = 0; - - public int getAnimTime() { - return animTime; - } - - public void setAnimTime(int animTime) { - this.animTime = animTime; - } - - protected int angerLevel = 0; - - public int getAngerLevel() { - return angerLevel; - } - - public void setAngerLevel(int angerLevel) { - this.angerLevel = angerLevel; - } - - protected EntityStates entityState = EntityStates.idle; - - public EntityStates getEntityState() { - return entityState; - } - - public EntityGenericCreature(World par1World) { - super(par1World); - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - attackTime = Math.max(attackTime - 1, 0); - fleeingTick = Math.max(fleeingTick - 1, 0); - angerLevel = Math.max(angerLevel - 1, 0); - } - - @Override - public void onUpdate() { - super.onUpdate(); - leashPathCooldown = Math.max(leashPathCooldown - 1, 0); - } - - @Override - protected void updateLeashedState() { - super.updateLeashedState(); - - if (this.getLeashed() && this.getLeashedToEntity() != null - && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity entity = this.getLeashedToEntity(); - this.setHomeArea((int) entity.posX, (int) entity.posY, (int) entity.posZ, 5); - float f = this.getDistanceToEntity(entity); - - if (this instanceof EntityGenericTameable && ((EntityGenericTameable) this).isSitting()) { - if (f > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b0388ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b0388ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 184c18f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b0388ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class CreeperBlossomFeature extends BiomeFeature { - private int density = 1; - - public CreeperBlossomFeature() { - super("Creeper Blossom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.creeperBlossom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.forest.biomeName, BiomeGenBase.forestHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.dirt || iDBelow == Blocks.grass) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.creeperBlossom.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b0b3b7f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b0b3b7f9c42100141fce95f06aba7e85 deleted file mode 100644 index 474f140..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b0b3b7f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; - -public interface ItemBlockDeclaration { - - public enum Type { - Block, Item; - } - - public abstract Type getType(); - - public abstract int getRegisterPass(); - - /** - * Loads ands saves the ItemBlock from the configuration filed. - * - * Called twice. Once for ItemBlocks already in the Config and again for new Items. Pass is indicated by readOnly - * boolean. - * - * @param config Configuration file to read save from - * @param readOnly Boolean indicating this is the pass for ItemBlock already in the Configuration file - */ - public abstract void createWithConfig(Configuration config, boolean readOnly); - - /** - * Registers the Created Block with the Environment - * - * i.e GameRegistry - */ - public abstract void register(Side side); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b29a40ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b29a40ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8cf2954..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b29a40ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b2f5ade4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b2f5ade4c42100141fce95f06aba7e85 deleted file mode 100644 index bd7cf6a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/b2f5ade4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/f03b33e9caab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/f03b33e9caab00141ee9bf3050c1025b new file mode 100644 index 0000000..d8fca7e --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/f03b33e9caab00141ee9bf3050c1025b @@ -0,0 +1,297 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(2) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/f14dc301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/f14dc301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b5cc916..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ba/f14dc301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,107 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - boolean isNorth = cellIndexDirection == CellIndexDirection.NorthMiddle; - if (piecePos.posZ == (isNorth ? 0 : cellSize - 1)) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isNorth ? 2 : 3); - } else if (piecePos.posX == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } else { - boolean isWest = cellIndexDirection == CellIndexDirection.WestMiddle; - if (piecePos.posX == (isWest ? 0 : cellSize - 1)) { - if (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, isWest ? 0 : 1); - } else if (piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } - } - - if (piecePos.posX > 0 && piecePos.posX < cellSize - 1 && piecePos.posZ > 0 && piecePos.posZ < cellSize - 1) { - return new BlockWithMeta(Blocks.water); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if (piecePos.posY == 2) { - if (cellIndexDirection == CellIndexDirection.NorthMiddle - || cellIndexDirection == CellIndexDirection.SouthMiddle) { - int zStart = cellIndexDirection == CellIndexDirection.NorthMiddle ? 0 : cellSize - 1; - int zEnd = cellIndexDirection == CellIndexDirection.NorthMiddle ? cellSize - 1 : 0; - if (piecePos.posZ == zEnd) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ != zStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else { - int xStart = cellIndexDirection == CellIndexDirection.WestMiddle ? 0 : cellSize - 1; - int xEnd = cellIndexDirection == CellIndexDirection.WestMiddle ? cellSize - 1 : 0; - if (piecePos.posX == xEnd) { - if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - if ((piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) && piecePos.posX != xStart) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - } - - if (piecePos.posY == 3) { - if (piecePos.posX != 0 && piecePos.posX != cellSize - 1 && piecePos.posZ != 0 - && piecePos.posZ != cellSize - 1) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/00f03852ecac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/00f03852ecac0014196dc3517d78505a new file mode 100644 index 0000000..5209b0b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/00f03852ecac0014196dc3517d78505a @@ -0,0 +1,253 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelMonkeyTailed extends ModelBase { + + float heightToRaise = 1f; + float renderScale = 0.80f; + + //fields + ModelRenderer HEAD; + ModelRenderer neck; + ModelRenderer snoutHEAD; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer BODYbase; + ModelRenderer BODYtop; + ModelRenderer leftTopArm; + ModelRenderer leftBotArm; + ModelRenderer rightTopArm; + ModelRenderer rightBotArm; + ModelRenderer leftTopLeg; + ModelRenderer leftBotLeg; + ModelRenderer rightTopLeg; + ModelRenderer rightBotLeg; + ModelRenderer tailBase; + ModelRenderer tailExt1; + ModelRenderer tailExt2; + + public ModelMonkeyTailed() + { + textureWidth = 64; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -4F, -3F, 5, 5, 5); + HEAD.setRotationPoint(0.5F, 11F - heightToRaise, -5F); + HEAD.setTextureSize(64, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.1745329F, 0F, 0F); + neck = new ModelRenderer(this, 19, 44); + neck.addBox(-2F, -2F, -1F, 3, 4, 3); + neck.setRotationPoint(1.5F, 11F - heightToRaise, -4F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, 0.0174533F, 0F, 0F); + snoutHEAD = new ModelRenderer(this, 21, 1); + snoutHEAD.addBox(-1F, -1F, -3F, 3, 3, 5); + //snoutHEAD.setRotationPoint(0.5F, 10.2F, -7F); + snoutHEAD.setRotationPoint(0F, -0.9F, -1.0F); + snoutHEAD.setTextureSize(64, 64); + snoutHEAD.mirror = true; + setRotation(snoutHEAD, 0.1745329F, 0F, 0F); + HEAD.addChild(snoutHEAD); + earLeft = new ModelRenderer(this, 1, 44); + earLeft.addBox(0F, -1F, 0F, 3, 3, 1); + //earLeft.setRotationPoint(2F, 8.4F, -5F); + earLeft.setRotationPoint(2.0F, -2.6F, 0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0.1396263F, 0F, 0F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 1, 50); + earRight.addBox(-2F, -1F, 0F, 3, 3, 1); + //earRight.setRotationPoint(-1F, 8.4F, -5F); + earRight.setRotationPoint(-2.0F, -2.6F, 0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0.1396263F, 0F, 0F); + HEAD.addChild(earRight); + BODYbase = new ModelRenderer(this, 1, 12); + BODYbase.addBox(-2F, -2F, -2F, 6, 5, 12); + BODYbase.setRotationPoint(0F, 11F - heightToRaise, -1F); + BODYbase.setTextureSize(64, 64); + BODYbase.mirror = true; + setRotation(BODYbase, -0.2974289F, 0F, 0F); + BODYtop = new ModelRenderer(this, 1, 30); + BODYtop.addBox(-2F, -1F, -2F, 5, 4, 8); + BODYtop.setRotationPoint(0.5F, 9.5F - heightToRaise, 0F); + BODYtop.setTextureSize(64, 64); + BODYtop.mirror = true; + setRotation(BODYtop, -0.2974289F, 0F, 0F); + leftTopArm = new ModelRenderer(this, 37, 1); + leftTopArm.addBox(0F, -1F, -1F, 3, 7, 3); + leftTopArm.setRotationPoint(3F, 11F - heightToRaise, -2F); + leftTopArm.setTextureSize(64, 64); + leftTopArm.mirror = true; + setRotation(leftTopArm, -0.1858931F, 0F, 0F); + leftBotArm = new ModelRenderer(this, 37, 12); + leftBotArm.addBox(-1F, 0F, -1F, 3, 8, 3); + //leftBotArm.setRotationPoint(4F, 16F, -3F); + leftBotArm.setRotationPoint(1.0F, 5.0F, 0.0F); + leftBotArm.setTextureSize(64, 64); + leftBotArm.mirror = true; + setRotation(leftBotArm, -0.5576792F, 0F, 0F); + leftTopArm.addChild(leftBotArm); + rightTopArm = new ModelRenderer(this, 51, 1); + rightTopArm.addBox(-2F, -1F, -1F, 3, 7, 3); + rightTopArm.setRotationPoint(-2F, 11F - heightToRaise, -2F); + rightTopArm.setTextureSize(64, 64); + rightTopArm.mirror = true; + setRotation(rightTopArm, -0.1858931F, 0F, 0F); + rightBotArm = new ModelRenderer(this, 51, 12); + rightBotArm.addBox(-1F, 0F, -1F, 3, 8, 3); + //rightBotArm.setRotationPoint(-3F, 16F, -3F); + rightBotArm.setRotationPoint(-1.0F, 5.0F, 0.0F); + rightBotArm.setTextureSize(64, 64); + rightBotArm.mirror = true; + setRotation(rightBotArm, -0.5576792F, 0F, 0F); + rightTopArm.addChild(rightBotArm); + leftTopLeg = new ModelRenderer(this, 37, 25); + leftTopLeg.addBox(0F, -1F, -1F, 3, 7, 3); + leftTopLeg.setRotationPoint(2F, 13F - heightToRaise, 6F); + leftTopLeg.setTextureSize(64, 64); + leftTopLeg.mirror = true; + setRotation(leftTopLeg, -0.6108652F, 0F, 0F); + leftBotLeg = new ModelRenderer(this, 37, 36); + leftBotLeg.addBox(-1F, 0F, -1F, 3, 7, 3); + //leftBotLeg.setRotationPoint(3F, 17F, 3F); + leftBotLeg.setRotationPoint(1F, 4F, 0F); + leftBotLeg.setTextureSize(64, 64); + leftBotLeg.mirror = true; + setRotation(leftBotLeg, 0.3717861F, 0F, 0F); + leftTopLeg.addChild(leftBotLeg); + rightTopLeg = new ModelRenderer(this, 51, 25); + rightTopLeg.addBox(-2F, -1F, -1F, 3, 7, 3); + rightTopLeg.setRotationPoint(-1F, 13F - heightToRaise, 6F); + rightTopLeg.setTextureSize(64, 64); + rightTopLeg.mirror = true; + setRotation(rightTopLeg, -0.6108652F, 0F, 0F); + rightBotLeg = new ModelRenderer(this, 51, 36); + rightBotLeg.addBox(-1F, 0F, -1F, 3, 7, 3); + //rightBotLeg.setRotationPoint(-2F, 17F, 3F); + rightBotLeg.setRotationPoint(-1F, 4F, 0F); + rightBotLeg.setTextureSize(64, 64); + rightBotLeg.mirror = true; + setRotation(rightBotLeg, 0.3717861F, 0F, 0F); + rightTopLeg.addChild(rightBotLeg); + tailBase = new ModelRenderer(this, 1, 56); + tailBase.addBox(0F, 0F, 0F, 1, 1, 6); + tailBase.setRotationPoint(0.5F, 13F - heightToRaise, 7F); + tailBase.setTextureSize(64, 64); + tailBase.mirror = true; + setRotation(tailBase, 0F, 0F, 0F); + tailExt1 = new ModelRenderer(this, 16, 56); + tailExt1.addBox(0F, 0F, 0F, 1, 1, 6); + tailExt1.setRotationPoint(0.5F, 13F - heightToRaise, 13F); + tailExt1.setTextureSize(64, 64); + tailExt1.mirror = true; + setRotation(tailExt1, -0.5576792F, 0F, 0F); + tailExt2 = new ModelRenderer(this, 29, 55); + tailExt2.addBox(0F, 0F, 0F, 1, 1, 7); + tailExt2.setRotationPoint(0.5F, 15.9F - heightToRaise, 18F); + tailExt2.setTextureSize(64, 64); + tailExt2.mirror = true; + setRotation(tailExt2, -0.9856463F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neck.render(renderScale * f5); + BODYbase.render(renderScale * f5); + BODYtop.render(renderScale * f5); + leftTopArm.render(renderScale * f5); + rightTopArm.render(renderScale * f5); + leftTopLeg.render(renderScale * f5); + rightTopLeg.render(renderScale * f5); + tailBase.render(renderScale * f5); + tailExt1.render(renderScale * f5); + tailExt2.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //GL11.glPushMatrix(); + // GL11.glScalef(0.85F, 0.85F, 0.85F); + // GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(f5); + neck.render(f5); + //snoutHEAD.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + BODYbase.render(f5); + BODYtop.render(f5); + leftTopArm.render(f5); + //leftBotArm.render(f5); + rightTopArm.render(f5); + //rightBotArm.render(f5); + leftTopLeg.render(f5); + //leftBotLeg.render(f5); + rightTopLeg.render(f5); + //rightBotLeg.render(f5); + tailBase.render(f5); + tailExt1.render(f5); + tailExt2.render(f5); + // GL11.glPopMatrix(); + } + + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + + leftTopArm.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + rightTopArm.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + + leftTopLeg.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + rightTopLeg.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + leftBotLeg.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + rightBotLeg.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + HEAD.rotateAngleX = f3 / (180F / (float)Math.PI); + //HEAD.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + //HEAD.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/117352e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/117352e5c42100141fce95f06aba7e85 deleted file mode 100644 index c2a9162..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/117352e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,186 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/31e64ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/31e64ef6c42100141fce95f06aba7e85 deleted file mode 100644 index 3d5fc59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/31e64ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; - -public class NBTTree { - private NBTNode root; - - public NBTTree(NBTBase rootData, String rootName) { - root = new NBTNode(rootData, null, rootName); - } - - public NBTNode getRootNode() { - return root; - } - - public boolean addNode(NBTBase data, NBTNode parent, String tagName) { - return parent.addChild(data, tagName); - } - - public void removeChildNode(NBTNode nodeToRemove, NBTNode parentNode) { - parentNode.removeChild(nodeToRemove); - } - - public NBTTagCompound toNBTTagCompound() { - NBTTagCompound nbtTagCompound = new NBTTagCompound(); - root.writeNodeandChildrenToNBT(nbtTagCompound); - return (NBTTagCompound) nbtTagCompound.getTag("Properties"); - } - - public ArrayList toArrayList() { - ArrayList nodeList = new ArrayList(); - root.writeNodeandChildrenToArrayList(nodeList); - return nodeList; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/502486fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/502486fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c5fd12..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/502486fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/70aff8e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/70aff8e3c42100141fce95f06aba7e85 deleted file mode 100644 index c228621..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/70aff8e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,332 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/711d439ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/711d439ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ef93884..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/711d439ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,25 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public interface EntityDeclaration { - public abstract boolean shouldExist(); - - /** - * Returns the Entities Unique Identifier. Typically the Entity name, i.e. "Alligator" or "Red Finch" - */ - public abstract String getIdentifier(); - public abstract void loadCreaturesFromConfig(Configuration config); - public abstract void loadBiomesFromConfig(Configuration config); - public abstract void loadCustomMobData(File configDirectory); - public abstract void registerEntity(); - public abstract void registerEgg(); - public abstract void addSpawn(); - - @SideOnly(Side.CLIENT) - public abstract void registerModelAndRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/807b2df6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/807b2df6c42100141fce95f06aba7e85 deleted file mode 100644 index 819a0fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/807b2df6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserPlayers extends KeyParserBase { - - public KeyParserPlayers(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 5) { - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[1], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[3], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[4], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), minSearchRange, - maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int minSearch = (Integer) values[1]; - int maxSearch = (Integer) values[2]; - - int current = countNearbyPlayers(world, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[3]; - int maxRange = (Integer) values[4]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyPlayers(World world, int xCoord, int yCoord, int zCoord, int minRange, int maxRange) { - int count = 0; - for (int i = 0; i < world.playerEntities.size(); ++i) { - EntityPlayer player = (EntityPlayer) world.playerEntities.get(i); - if (player.isEntityAlive()) { - int distance = (int) Math.sqrt(player.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/811173fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/811173fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb99a41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/811173fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.NBTWriter; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/914f26f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/914f26f6c42100141fce95f06aba7e85 deleted file mode 100644 index 136b9d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/914f26f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/91cacb9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/91cacb9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b0cf84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/91cacb9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,135 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelOstrichHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - - public ModelOstrichHead(){ - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 26F, -1F); - setRotation(BODYROT, -1.570796F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK1ROT.addChild(NECK3ROT); - BODYROT.addChild(NECK1ROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - switch ((int)skullState) { - case 1: - BODYROT.rotateAngleX = (float) (-90*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-10*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (25*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (30*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (40*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (30*Math.PI/180); - HEADROT.rotateAngleX = (float) (20*Math.PI/180); - break; - default: - BODYROT.rotateAngleX = (float) (0*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-35*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-30*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-25*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (-20*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (+25*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (+30*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (+35*Math.PI/180); - HEADROT.rotateAngleX = (float) (+50*Math.PI/180); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b1293effc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b1293effc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 46d4960..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b1293effc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b1fc239ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b1fc239ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 48c8070..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/b1fc239ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,617 +0,0 @@ -package projectzulu.common.blocks.spike; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpike implements ISimpleBlockRenderingHandler { - - /* Leaving This here For Reference */ - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94216_b %s", var10.func_94216_b()); // 192 - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94212_f %s", var10.getMaxU()); // 0.5 - // ProjectZuluLog.info("func_94214_a %s", var10.getInterpolatedU(8D)); // 0: 0.46875, 8: 0.484375 - // ProjectZuluLog.info("func_94206_g %s", var10.getMinV()); // 0.375 - // ProjectZuluLog.info("func_94210_h %s", var10.getMaxV()); // 0.40625 - // ProjectZuluLog.info("func_94207_b %s", var10.func_94207_b(8D)); // 0: 0.375, 8: 0.390625 - // ProjectZuluLog.info("func_94215_i %s", var10.func_94215_i()); // NAME - // ProjectZuluLog.info("func_94213_j %s", var10.func_94213_j()); // 512 - // ProjectZuluLog.info("func_94208_k %s", var10.func_94208_k()); // 512 - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - return Render(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - } - - private boolean Render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - // // if (par1Block == Block.tallGrass) - // // { - // // long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; - // // var17 = var17 * var17 * 42317861L + var17 * 11L; - // // var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; - // // var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // } - if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars - || blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - // renderAsSpike(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - RenderFencePikes(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - - } else if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - boolean isNegZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - /* Check For Along Z */ - if (isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 0); - } else if (!isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 1); - } else if (isNegZ && !isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 2); - } - - /* Check For Along X */ - if (isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 0); - } else if (!isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 1); - } else if (isNegX && !isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 2); - } - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - drawSpikeCross(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - - } else { - // renderer.drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, - // var15, 1.0f); - drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - return true; - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block par1) { - return par1.isOpaqueCube() || par1 == Blocks.iron_bars || par1 == Blocks.glass; - } - - public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, - RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - 0.5D; - double var23 = par3 + 0.5D + 0.5D; - double var25 = par7 + 0.5D - 0.5D; - double var27 = par7 + 0.5D + 0.5D; - - switch (par2) { - case 0: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 1: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 2: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 3: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 4: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 5: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - case 6: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 7: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 8: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 9: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 10: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 11: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - default: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - } - } - - public void drawOnSide0(Tessellator tessellator, double par5, double var21, double var23, double var25, - double var27, double var13, double var15, double var17, double var19) { - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17); - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17); - } - - public void drawOnSide1(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide2(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide3(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide4(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide5(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - } - - public void RenderFencePikes(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 1f / 4f; - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 3f / 4f; - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - (0.625 - 0.375) / 2D; - double var23 = par3 + 0.5D + (0.625 - 0.375) / 2D; - double var25 = par7 + 0.5D - (0.625 - 0.375) / 2D; - double var27 = par7 + 0.5D + (0.625 - 0.375) / 2D; - - double maxY = 0.6; - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var15, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - - public void drawSpikeCross(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - /* Render Strip Along X */ - double var21 = par3 + 0.5D - 0.5; - double var23 = par3 + 0.5D + 0.5; - double var25 = par7 + 0.5D - 0.06; - double var27 = par7 + 0.5D + 0.06; - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - /* Render Strip Along Z */ - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - - // float var6 = 0.375F; - // float var7 = 0.625F; - maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - } - - public void drawSpikeStrip(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer, - Boolean alongX, int type) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13; - double var15; - double var17; - double var19; - - switch (type) { - case 1: - var13 = var10.getInterpolatedU(8D); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - case 2: - var13 = var10.getMinU(); - var15 = var10.getInterpolatedU(8D); // var10.getMaxU(); - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2f; // var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - default: - var13 = var10.getMinU(); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - } - - double var21; - double var23; - double var25; - double var27; - if (alongX) { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.0; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - - break; - case 2: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.0; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - default: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - } - - } else { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.0; - var27 = par7 + 0.5D + 0.5; - - break; - case 2: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.0; - - break; - default: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - break; - } - } - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - if (alongX) { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - } else { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/c10a4bf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/c10a4bf5c42100141fce95f06aba7e85 deleted file mode 100644 index ec402ce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/c10a4bf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/c15a839ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/c15a839ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a5aa7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/c15a839ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f02e0c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f02e0c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75f2d0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f02e0c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f0e80ce1fa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f0e80ce1fa2000141769cb1ed0c338cd deleted file mode 100644 index 181e46f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f0e80ce1fa2000141769cb1ed0c338cd +++ /dev/null @@ -1,527 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import projectzulu.common.API.BlockList; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f17952f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f17952f4c42100141fce95f06aba7e85 deleted file mode 100644 index 9e37e75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bb/f17952f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,220 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEnd implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - return getWallBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall); - } else { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/112a90f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/112a90f5c42100141fce95f06aba7e85 deleted file mode 100644 index 740a891..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/112a90f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityCentipede; -import com.ngb.projectzulu.common.mobs.models.ModelCentipede; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/11a083e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/11a083e6c42100141fce95f06aba7e85 deleted file mode 100644 index b7ff86b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/11a083e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,325 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/2030c69ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/2030c69ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a54893..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/2030c69ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import cpw.mods.fml.common.Loader; - -public class EntityFinch extends EntityGenericAnimal implements IAnimals { - int stayStillTimer = 0; - - public EntityFinch(World par1World) { - super(par1World); - // noClip = true; - this.setSize(0.5f, 0.5f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 5; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); - - // this.tasks.addTask(2, new EntityAIAttackOnCollide(this, this.moveSpeed, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "birdhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bird"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public void updateAIState() { - if (stayStillTimer > 0) { - entityState = EntityStates.posture; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - /* If We are above Solid Ground, have a small Chance at Landing */ - if (this.rand.nextInt(100) == 0 - && this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 400; - } - - /* If Posing, Check if We should Stay Flee */ - if (getEntityState() == EntityStates.posture) { - /* If we are not on a Normal Block, Fly Free */ - if (!this.worldObj.getBlock(MathHelper.floor_double(this.posX), (int) this.posY - 1, - MathHelper.floor_double(this.posZ)).isNormalCube()) { - stayStillTimer = 0; - } else { - /* Chance to Chance Direction We are Facing ?--Do We Care?--? */ - if (this.rand.nextInt(200) == 0) { - this.rotationYawHead = this.rand.nextInt(360); - } - - /* If Player is nearby, Entity Should Fly away, think Pigeons */ - if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null || this.rand.nextInt(400) == 0) { - stayStillTimer = 0; - } - } - /* - * Deincrement stayStillTimer, if it hits zero Entity Should Fly : Note that timer is likely being set to - * max again by the initial shouldSit check - */ - stayStillTimer = Math.max(stayStillTimer - 1, 0); - } - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/20ebec00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/20ebec00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4f1bbd7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/20ebec00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/30549cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/30549cf4c42100141fce95f06aba7e85 deleted file mode 100644 index bfa584d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/30549cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityHauntedArmor; - -public class HauntedArmorWithMeta extends BlockWithMeta { - - public HauntedArmorWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityHauntedArmor mob = new EntityHauntedArmor(world, position.posX + 0.5, position.posY, - position.posZ + 0.5, true); - mob.onSpawnWithEgg(null); - mob.setPersistenceRequired(true); - world.spawnEntityInWorld(mob); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/51a0a3e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/51a0a3e5c42100141fce95f06aba7e85 deleted file mode 100644 index 543f3f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/51a0a3e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummy extends ModelBiped { - - /** - * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms - * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how - * "far" arms and legs can swing at most. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/627b129fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/627b129fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3581d16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/627b129fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFox; -import projectzulu.common.mobs.models.ModelFox; -import projectzulu.common.mobs.renders.RenderTameable; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FoxDeclaration extends SpawnableDeclaration { - - public FoxDeclaration() { - super("Fox", 9, EntityFox.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (204 << 16) + (132 << 8) + 22; - eggColor2 = (224 << 16) + (224 << 8) + 224; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderTameable(new ModelFox(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "fox.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Pine Forest"); - defaultBiomesToSpawn.add("Rainforest"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/903364a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/903364a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6b3779b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/903364a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,119 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isRideable() function - */ -public abstract class EntityGenericRideable extends EntityGenericBreedable{ - - public EntityGenericRideable(World par1World) { - super(par1World); - } - /* Toggles Whether the Child Class can be Ridden and used methods in this Class - * i.e. If false, will not be able to be saddled/mounted */ - public boolean isRideable(){ - return false; - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handles Whether the Entity Is Saddled */ - this.dataWatcher.addObject(21, Byte.valueOf((byte)0)); - } - - /** - * Returns true if the Entity is saddled. - */ - public boolean getSaddled() { - return (this.dataWatcher.getWatchableObjectByte(21) & 1) != 0; - } - - /** - * Set or remove the saddle of the Entity. - */ - public void setSaddled(boolean par1) { - if (par1) { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)1)); - } - else { - this.dataWatcher.updateObject(21, Byte.valueOf((byte)0)); - } - } - - /** - * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden - * by a player and the player is holding a carrot-on-a-stick - */ - @Override - public boolean canBeSteered() { - ItemStack var1 = ((EntityPlayer) this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem().equals(Items.stick); - } - - /** - * Checks if Item should Cause the Horse to Continue Moving in the Direction it was already going - */ - public boolean shouldIgnorePlayerRot(){ - if(riddenByEntity != null && riddenByEntity instanceof EntityPlayer){ - ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); - return var1 != null && var1.getItem() != Items.stick; - } - return false; - } - - /** - * Sets the Player Rotation to Face the Direction of the Entity - */ - @Override - public boolean shouldRiderFaceForward(EntityPlayer player) { - return true; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - if (super.interact(par1EntityPlayer)) { - return true; - } - - if(isRideable()){ - /* If Saddled Get on/off Entity */ - if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { - par1EntityPlayer.mountEntity(this); - return true; - - /* If Not Saddled: Try to Saddle Entity */ - }else if(!getSaddled() && par1EntityPlayer.inventory.getCurrentItem() != null - && par1EntityPlayer.inventory.getCurrentItem().getItem() == Items.saddle ){ - setSaddled(true); - return true; - } - } - return false; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/90f75601c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/90f75601c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb41ada..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/90f75601c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,502 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/a1418bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/a1418bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 6ef024c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/a1418bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,12 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.util.ResourceLocation; - -public class RenderMimic extends RenderGenericLiving { - public static final ResourceLocation normalChest = new ResourceLocation("textures/entity/chest/normal.png"); - - public RenderMimic(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/b065bca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/b065bca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d892468..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/b065bca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,84 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/b124be9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/b124be9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ba3899..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/b124be9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c03aa9e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c03aa9e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2f380de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c03aa9e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.core; -/** - * Usage: - * Pair pair = Pair.createPair(1, "test"); - * pair.getElement0(); - * pair.getElement1(); - * @param - * @param - */ -public class Pair { - - private final K element0; - private final V element1; - - public static Pair createPair(K element0, V element1) { - return new Pair(element0, element1); - } - - public Pair(K element0, V element1) { - this.element0 = element0; - this.element1 = element1; - } - - public K getElement0() { - return element0; - } - - public V getElement1() { - return element1; - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c0beeb9e6023001416428e945fc8fb52 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c0beeb9e6023001416428e945fc8fb52 deleted file mode 100644 index 9e09158..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c0beeb9e6023001416428e945fc8fb52 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(),new YellowFinchDeclaration() - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c14e76e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c14e76e5c42100141fce95f06aba7e85 deleted file mode 100644 index 68b5fde..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/c14e76e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMammoth; -import projectzulu.common.mobs.models.ModelMammoth; -import projectzulu.common.mobs.renders.RenderMammoth; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/e0370cf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/e0370cf6c42100141fce95f06aba7e85 deleted file mode 100644 index 00970be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/e0370cf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,215 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityAerial extends EntityLiving { - - protected ChunkCoordinates targetPosition; - /** Tries to Assign targetPosition - * Checks if Valid first using isTargetPositionValid - * Returns False if invald - */ - public boolean setTargetPosition(ChunkCoordinates targetPosition){ - if(isTargetPositionValid(targetPosition)){ - this.targetPosition = targetPosition; - return true; - } - return false; - } - protected int maxFlightHeight = 20; - public int getMaxFlightHeight(){ return maxFlightHeight; } - public EntityAerial(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handle whether Entity is Flying or not*/ - if( defaultGrounded() ){ - this.dataWatcher.addObject(17, Byte.valueOf((byte)1)); - }else{ - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - } - - } - - public boolean defaultGrounded() { - return true; - } - - public boolean isEntityGrounded() { - return this.dataWatcher.getWatchableObjectByte(17) != 0; - } - protected void setEntityGrounded(Boolean par1) { - if(par1){ - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - }else { - this.dataWatcher.updateObject(17, Byte.valueOf((byte)0)); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("Is Grounded", this.dataWatcher.getWatchableObjectByte(17)); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - if(par1NBTTagCompound.hasKey("Is Grounded")){ - this.dataWatcher.updateObject(17, par1NBTTagCompound.getByte("Is Grounded")); - } - } - - @Override - protected void updateAITasks() { - if(!isEntityGrounded() && targetPosition != null){ - /* Get The Direction I want to travel in */ - double var1 = (double)this.targetPosition.posX + 0.5D - this.posX; - double var3 = (double)this.targetPosition.posY + 0.1D - this.posY; - double var5 = (double)this.targetPosition.posZ + 0.5D - this.posZ; - - /* Change Velocity */ - /* Normalize the Direction I want to travel in, then add and scale it to Motion */ - this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D*0.3D; - this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D*0.3D; - this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D*0.3D; - float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; - float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); - this.moveForward = 0.5F; - this.rotationYaw += var8; - } - super.updateAITasks(); - } - - protected boolean shouldBeFlying() { - return false; - } - - public boolean isTargetPositionValid(){ - return isTargetPositionValid(this.targetPosition); - } - - public boolean isTargetPositionValid(ChunkCoordinates targetPosition){ - /* Invalid if Water, is below height = 3 (superflat), and if its null */ - if (targetPosition != null && (!this.worldObj.isAirBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ) || targetPosition.posY < 3 - || this.worldObj.getBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ).getMaterial().equals(Material.water))){ -// targetPosition = null; - return false; - } - return true; - } - - /* Checks if Entity is at the target position, return true if TargetPosition is null*/ - public boolean atTargetPosition(){ - if(targetPosition != null){ - return getDistance(targetPosition.posX, targetPosition.posY, targetPosition.posZ) < 2; - } - return true; - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if(isEntityGrounded()){ - super.moveEntityWithHeading(par1, par2); - return; - } - - if (this.isInWater()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } - else if (this.handleLavaMovement()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - else - { - float var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double)var3; - this.motionY *= (double)var3; - this.motionZ *= (double)var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) - { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwing; - } - - - /** - * Method Designed for Flying Entities to adjust the Direction They are facing to the direction they are moving - */ - protected void adjustRotationToWaypoint() { - double var8 = targetPosition.posX - this.posX; - double var10 = targetPosition.posZ - this.posZ; - float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI);// - 90.0F; - float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); - - if (var15 > 30.0F){ - var15 = 30.0F; - } - - if (var15 < -30.0F){ - var15 = -30.0F; - } - this.renderYawOffset = this.rotationYaw += var15; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f1efcdf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f1efcdf8c42100141fce95f06aba7e85 deleted file mode 100644 index 720643d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bc/f1efcdf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EggableDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityMimic; -import com.ngb.projectzulu.common.mobs.models.ModelMimic; -import com.ngb.projectzulu.common.mobs.renders.RenderMimic; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MimicDeclaration extends EggableDeclaration { - - public MimicDeclaration() { - super("Mimic", 11, EntityMimic.class, null); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - shouldDespawn = false; - - eggColor1 = (171 << 16) + (121 << 8) + 45; - eggColor2 = (143 << 16) + (105 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 5); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/21c962a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/21c962a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 56df7ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/21c962a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemStructurePlacer; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/302a7ae6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/302a7ae6c42100141fce95f06aba7e85 deleted file mode 100644 index 5311cea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/302a7ae6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetGenericDeadEnd implements BlueprintSet { - - Blueprint blueprint; - int baseState; - int[] surroundingRawStates; - - public BPSetGenericDeadEnd(Blueprint blueprint, int baseState, int... surroundingRawStates) { - this.blueprint = blueprint; - if (surroundingRawStates != null && surroundingRawStates.length > 0) { - this.surroundingRawStates = surroundingRawStates; - } else { - surroundingRawStates = new int[] { baseState }; - } - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == baseState - && ArchitectBase.isDeadEnd(cells, buildCoords, surroundingRawStates) ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/40c90cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/40c90cf5c42100141fce95f06aba7e85 deleted file mode 100644 index 71cd7da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/40c90cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotBrewingStandSingleIngredient extends Slot { - /** The brewing stand this slot belongs to. */ - final ContainerBrewingStandSingle brewingStand; - - public SlotBrewingStandSingleIngredient(ContainerBrewingStandSingle par1ContainerBrewingStand, - IInventory par2IInventory, int par3, int par4, int par5) { - super(par2IInventory, par3, par4, par5); - this.brewingStand = par1ContainerBrewingStand; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - if (par1ItemStack == null) { - return false; - } - - return PotionIngredients.isPotionIngredient(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 64; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4244239fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4244239fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fb973e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/4244239fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityLizardSpit; -import projectzulu.common.mobs.renders.RenderLizardSpit; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/51017ca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/51017ca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d96fbb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/51017ca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/605a44a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/605a44a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5734cca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/605a44a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/6180a5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/6180a5f8c42100141fce95f06aba7e85 deleted file mode 100644 index a75ded1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/6180a5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,222 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; -import com.ngb.projectzulu.common.mobs.renders.RenderMimic; - -public class ModelMimic extends ModelBase { - ModelRenderer botchest; - ModelRenderer BOTTEETHROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer TOPCHESTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - - public ModelMimic() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BOTTEETHROT.TEETH7", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH5", 0, 0); - setTextureOffset("BOTTEETHROT.TEETH6", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR1", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHR3", 0, 0); - setTextureOffset("BOTTEETHROT.TEETHL1", 0, 0); - setTextureOffset("LEG1TOPROT.leg1bot", 0, 20); - setTextureOffset("LEG1BOTROT.leg1top", 0, 7); - setTextureOffset("LEG2TOPROT.leg2bot", 0, 20); - setTextureOffset("LEG2BOTROT.leg2top", 0, 7); - setTextureOffset("LEG4TOPROT.leg4bot", 0, 20); - setTextureOffset("LEG4BOTROT.leg4top", 0, 7); - setTextureOffset("LEG3TOPROT.leg3bot", 0, 20); - setTextureOffset("LEG3BOTROT.leg3top", 0, 7); - setTextureOffset("TOPCHESTROT.topchest", 0, 0); - setTextureOffset("TOPCHESTROT.chestnose", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH1", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH3", 0, 0); - setTextureOffset("TOPCHESTROT.TEETH2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHR4", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL2", 0, 0); - setTextureOffset("TOPCHESTROT.TEETHL4", 0, 0); - - botchest = new ModelRenderer(this, 0, 19); - botchest.addBox(-7.5F, -9.5F, -7.5F, 14, 10, 14); - botchest.setRotationPoint(0F, 14.53333F, 0F); - botchest.setTextureSize(128, 64); - botchest.mirror = true; - setRotation(botchest, 0F, 0F, 0F); - BOTTEETHROT = new ModelRenderer(this, "BOTTEETHROT"); - BOTTEETHROT.setRotationPoint(0F, 0.5F, 6.5F); - setRotation(BOTTEETHROT, 0F, 0F, 0F); - BOTTEETHROT.mirror = true; - BOTTEETHROT.addBox("TEETH7", -1F, 3F, -13F, 2, 2, 1); - BOTTEETHROT.addBox("TEETH5", -4.5F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETH6", 3F, 3F, -13F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHR1", 4.5F, 3F, -11F, 1, 2, 1); - BOTTEETHROT.addBox("TEETHL3", -6.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHR3", 4.5F, 4F, -7F, 1, 1, 1); - BOTTEETHROT.addBox("TEETHL1", -6.5F, 3F, -11F, 1, 2, 1); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(4F, 14.5F, -5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1bot", -1F, 0F, -1F, 2, 3, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -1F, 0F, -1F, 2, 5, 2); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(-5F, 14.5F, -5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2bot", -1F, 0F, -1F, 2, 3, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2BOTROT, 0F, 0.0174533F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2top", -1F, 0F, -1F, 2, 5, 2); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-5F, 14.5F, 4F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4bot", -1F, 0F, -1F, 2, 3, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4top", -1F, 0F, -1F, 2, 5, 2); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(4F, 14.5F, 4F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3bot", -1F, 0F, -1F, 2, 3, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3top", -1F, 0F, -1F, 2, 5, 2); - LEG3TOPROT.addChild(LEG3BOTROT); - TOPCHESTROT = new ModelRenderer(this, "TOPCHESTROT"); - TOPCHESTROT.setRotationPoint(0F, 5F, 6.5F); - setRotation(TOPCHESTROT, 0F, 0F, 0F); - TOPCHESTROT.mirror = true; - TOPCHESTROT.addBox("topchest", -7.5F, -5F, -14F, 14, 5, 14); - TOPCHESTROT.addBox("chestnose", -1F, -1.5F, -15.5F, 2, 3, 1); - TOPCHESTROT.addBox("TEETH4", 4.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH1", -6.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH3", 1.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETH2", -2.5F, 0F, -13F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR2", 4.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHR4", 4.5F, 0F, -5F, 1, 1, 1); - TOPCHESTROT.addBox("TEETHL2", -6.5F, 0F, -9F, 1, 2, 1); - TOPCHESTROT.addBox("TEETHL4", -6.5F, 0F, -5F, 1, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - LEG1TOPROT.render(f5); - LEG2TOPROT.render(f5); - LEG4TOPROT.render(f5); - LEG3TOPROT.render(f5); - Minecraft.getMinecraft().renderEngine.bindTexture(RenderMimic.normalChest); - botchest.render(f5); - BOTTEETHROT.render(f5); - TOPCHESTROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; - - /* State Based Animations */ - if (var5.getEntityState() != EntityStates.idle) { - float heightToRaise = 0.0f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - heightToRaise; - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG1BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3TOPROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - LEG3BOTROT.rotateAngleZ = (float) (50 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (-10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG2TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG2BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (+10 * Math.PI / 180) - + (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEG4TOPROT.rotateAngleZ = (float) (+50 * Math.PI / 180); - LEG4BOTROT.rotateAngleZ = (float) (-50 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = (float) (Math.abs(MathHelper.cos(par2 * 0.6662F)) * -60 * Math.PI / 180 * par3); - - } else { - float heightToRaise = -9f; - botchest.rotationPointY = 14.5333f - heightToRaise; - BOTTEETHROT.rotationPointY = 0.5f - heightToRaise; - TOPCHESTROT.rotationPointY = 5f - (heightToRaise - 1f); - LEG1TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG2TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG3TOPROT.rotationPointY = 14.5f - heightToRaise; - LEG4TOPROT.rotationPointY = 14.5f - heightToRaise; - - LEG1TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - LEG3TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG3TOPROT.rotateAngleZ = (float) (+90 * Math.PI / 180); - - LEG2TOPROT.rotateAngleX = (float) (+30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - LEG4TOPROT.rotateAngleX = (float) (-30 * Math.PI / 180); - LEG4TOPROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - TOPCHESTROT.rotateAngleX = 0f; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/61bf6ef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/61bf6ef5c42100141fce95f06aba7e85 deleted file mode 100644 index 720643d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/61bf6ef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EggableDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityMimic; -import com.ngb.projectzulu.common.mobs.models.ModelMimic; -import com.ngb.projectzulu.common.mobs.renders.RenderMimic; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MimicDeclaration extends EggableDeclaration { - - public MimicDeclaration() { - super("Mimic", 11, EntityMimic.class, null); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - shouldDespawn = false; - - eggColor1 = (171 << 16) + (121 << 8) + 45; - eggColor2 = (143 << 16) + (105 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 5); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMimic(new ModelMimic(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mimicchest.png")); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/70e39bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/70e39bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 7e6b4f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/70e39bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,439 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntitySandWorm; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/92f7f8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/92f7f8f8c42100141fce95f06aba7e85 deleted file mode 100644 index 75f7c84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/92f7f8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,25 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Comparator; - -import net.minecraft.entity.Entity; -public class EntityAINearestAttackableTargetSorter implements Comparator{ - private Entity theEntity; - - final EntityAINearestAttackableTarget parent; - - public EntityAINearestAttackableTargetSorter(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, Entity par2Entity){ - this.parent = par1EntityAINearestAttackableTarget; - this.theEntity = par2Entity; - } - - public int compareDistanceSq(Entity par1Entity, Entity par2Entity){ - double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); - double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - - public int compare(Object par1Obj, Object par2Obj){ - return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/a13925a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/a13925a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9cbf83c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/a13925a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class TileEntityBrewingStandRenderer extends TileEntitySpecialRenderer { - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - renderTileEntity((TileEntityBrewingBase) tileEntity, xRenderCoord, yRenderCoord, zRenderCoord, var8); - } - - private void renderTileEntity(TileEntityBrewingBase tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - RenderItem itemRenderer = new RenderItem(); - itemRenderer.setRenderManager(RenderManager.instance); - - ItemStack ingredientStack = tileEntity.brewingItemStacks[tileEntity.brewingItemStacks.length - 1]; - if (ingredientStack != null) { - if (ingredientStack.stackSize > 1) { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.28f); - } else { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.4f); - } - } - - float[] zOffsets = new float[] { 0, +0.29f, -0.29f }; - float[] rotation = new float[] { 90f, 0.0f, 0.0f }; - for (int i = 0; i < tileEntity.brewingItemStacks.length - 1; i++) { - ItemStack stackToRender = tileEntity.brewingItemStacks[i]; - if (stackToRender == null) { - continue; - } - renderItemStack(stackToRender, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord - 0.25D, - zRenderCoord + zOffsets[i], rotation[i], 0.6f); - } - } - - private void renderItemStack(ItemStack stackToRender, RenderItem renderer, World world, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float rotation, float scale) { - EntityItem entityItemToRender = new EntityItem(world, xRenderCoord, yRenderCoord, zRenderCoord, stackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = scale; - GL11.glPushMatrix(); - bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); - renderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/c11b63f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/c11b63f4c42100141fce95f06aba7e85 deleted file mode 100644 index 28a4148..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/c11b63f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,147 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/c14d82a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/c14d82a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f64996f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/c14d82a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d07eb0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d07eb0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 38dbb9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d07eb0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCentipede; -import projectzulu.common.mobs.models.ModelCentipede; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d1226fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d1226fe5c42100141fce95f06aba7e85 deleted file mode 100644 index 670fdc7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/d1226fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/e0be9ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/e0be9ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 248da5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bd/e0be9ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -/** - * Terrain Feature that is Restricted by Biome - */ -public abstract class BiomeFeature extends BaseFeature { - - /** List of Biome Package Names that this Feature can Spawn in */ - protected ArrayList biomesToSpawn = new ArrayList(); - - public BiomeFeature(String featureName, Size size) { - super(featureName, size); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - return biomesToSpawn.contains(getBiomePackageName(world.getBiomeGenForCoords(genBlockCoords.posX, - genBlockCoords.posZ))); - } - return false; - } - - protected abstract Collection getDefaultBiomeList(); - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - Collection defaultBiomesToSpawn = getDefaultBiomeList(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - if (config.getFeatureProperty(this, "GeneratingBiomes", - getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i]), - defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName)).getBoolean(false)) { - biomesToSpawn.add(getBiomePackageName(BiomeGenBase.getBiomeGenArray()[i])); - } - } - } - - private String getBiomePackageName(BiomeGenBase biome) { - return biome.getClass().getName() + "." + biome.biomeName; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/0083c8f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/0083c8f6c42100141fce95f06aba7e85 deleted file mode 100644 index 207994b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/0083c8f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.GuiID; - -public class BlockUniversalFlowerPot extends BlockContainer { - - public final int renderID; - - public BlockUniversalFlowerPot(int renderID) { - super(Material.wood); - this.setBlockBoundsForItemRender(); - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - setHardness(0.0F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityUniversalFlowerPot(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return false; - } - player.openGui(ProjectZulu_Core.modInstance, GuiID.FlowerPot.getID(), world, x, y, z); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/30f04b00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/30f04b00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index aef922f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/30f04b00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/5040b6a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/5040b6a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0c06600..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/5040b6a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraftforge.common.config.Configuration; - -public class EntityProperties { - public final float maxHealth; - public final float attackDamage; - public final float moveSpeed; - public final float followRange; - public final float knockbackResistance; - public final float flightChance; - - public EntityProperties(float health, float strength, float moveSpeed) { - this(health, strength, moveSpeed, 0); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance) { - this(health, strength, moveSpeed, flightChance, 0.0f, 32.0f); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance, float knockback, float followRange) { - this.maxHealth = health; - this.attackDamage = strength; - this.moveSpeed = moveSpeed; - this.flightChance = flightChance; - this.knockbackResistance = knockback; - this.followRange = followRange; - } - - public EntityProperties createFromConfig(Configuration config, String entityName) { - float maxHealth = (float) config.get("MOB CONTROLS." + entityName, "maxHealth", this.maxHealth).getDouble( - this.maxHealth); - float attackDamage = (float) config.get("MOB CONTROLS." + entityName, "attackDamage", this.attackDamage) - .getDouble(this.attackDamage); - float moveSpeed = (float) config.get("MOB CONTROLS." + entityName, "moveSpeed", this.moveSpeed).getDouble( - this.moveSpeed); - float flightChance = (float) config.get("MOB CONTROLS." + entityName, "flightChance", this.flightChance) - .getDouble(this.flightChance); - float knockbackResistance = (float) config.get("MOB CONTROLS." + entityName, "knockbackResistance", - this.knockbackResistance).getDouble(this.knockbackResistance); - float followRange = (float) config.get("MOB CONTROLS." + entityName, "followRange", this.followRange) - .getDouble(this.followRange); - return new EntityProperties(maxHealth, attackDamage, moveSpeed, flightChance, knockbackResistance, followRange); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/514041f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/514041f8c42100141fce95f06aba7e85 deleted file mode 100644 index 5888a1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/514041f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.StructurePlacerDeclaration; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.world.terrain.CathedralFeature; -import com.ngb.projectzulu.common.world.terrain.CemetaryFeature; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; -import com.ngb.projectzulu.common.world.terrain.OasisFeature; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_World extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.WorldModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new StructurePlacerDeclaration()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new PyramidFeature(), new LabyrinthFeature(), new CemetaryFeature(), - new OasisFeature(), new CathedralFeature()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/517809e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/517809e4c42100141fce95f06aba7e85 deleted file mode 100644 index b51432b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/517809e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/60fbd5f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/60fbd5f7c42100141fce95f06aba7e85 deleted file mode 100644 index f566ab1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/60fbd5f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,260 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/901c53a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/901c53a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2a28b51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/901c53a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/90ad44a8ecac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/90ad44a8ecac0014196dc3517d78505a new file mode 100644 index 0000000..52bc2a1 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/90ad44a8ecac0014196dc3517d78505a @@ -0,0 +1,334 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelCamel extends ModelBase +{ + float heightToRaise = 33f; + float renderScale = 1.0f; + //fields + //fields + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer HEADbump; + ModelRenderer HEAD; + ModelRenderer neckTop; + ModelRenderer neckBase; + ModelRenderer humpMain; + ModelRenderer humpMain2; + ModelRenderer saddleBase; + ModelRenderer saddleHorn1; + ModelRenderer saddleHorn2; + ModelRenderer Body; + ModelRenderer hip1; + ModelRenderer Leg1toProt; + ModelRenderer Leg1BotRot; + ModelRenderer hip2; + ModelRenderer Leg2toProt; + ModelRenderer Leg2BotRot; + ModelRenderer hip3; + ModelRenderer Leg3toProt; + ModelRenderer Leg3BotRot; + ModelRenderer hip4; + ModelRenderer Leg4toProt; + ModelRenderer Leg4BotRot; + ModelRenderer tail; + + public ModelCamel() + { + textureWidth = 128; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -3F, -4F, 5, 4, 7); + HEAD.setRotationPoint(0F, 3F - heightToRaise, -15F); + HEAD.setTextureSize(128, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.2268928F, 0F, 0F); + HEADbump = new ModelRenderer(this, 105, 42); + HEADbump.addBox(-2F, -2F, -3F, 3, 2, 6); + //HEADbump.setRotationPoint(1F, 1.5F, -15.5F); + HEADbump.setRotationPoint(1F, -1.5F, -0.5F); + HEADbump.setTextureSize(128, 64); + HEADbump.mirror = true; + setRotation(HEADbump, 0.296706F, 0F, 0F); + HEAD.addChild(HEADbump); + earLeft = new ModelRenderer(this, 60, 6); + earLeft.addBox(0F, -3F, -1F, 1, 4, 1); + //earLeft.setRotationPoint(1.5F, 1F, -13F); + earLeft.setRotationPoint(1.5F, -1.0F, 2.5F); + earLeft.setTextureSize(128, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, 0.5235988F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 60, 1); + earRight.addBox(-1F, -3F, -1F, 1, 4, 1); + //earRight.setRotationPoint(-0.5F, 1F, -13F); + earRight.setRotationPoint(-0.5F, -1.0F, 2.5F); + earRight.setTextureSize(128, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, -0.5235988F); + HEAD.addChild(earRight); + + neckTop = new ModelRenderer(this, 29, 1); + neckTop.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + neckTop.setRotationPoint(0.5F, 1.8F - heightToRaise , -14F); + neckTop.setTextureSize(128, 64); + neckTop.mirror = true; + setRotation(neckTop, 0.6457718F, 0F, 0F); + neckBase = new ModelRenderer(this, 43, 1); + neckBase.addBox(-1.5F, 0F, -1.5F, 3, 6, 4); + neckBase.setRotationPoint(0.5F, 6F - heightToRaise, -11.5F); + neckBase.setTextureSize(128, 64); + neckBase.mirror = true; + setRotation(neckBase, 1.117011F, 0F, 0F); + humpMain = new ModelRenderer(this, 1, 41); + humpMain.addBox(-3.5F, -2F, -2F, 8, 4, 9); + humpMain.setRotationPoint(0F, 3F - heightToRaise, -0.5F); + humpMain.setTextureSize(128, 64); + humpMain.mirror = true; + setRotation(humpMain, 0F, 0F, 0F); + humpMain2 = new ModelRenderer(this, 37, 42); + humpMain2.addBox(-3F, -2F, -2F, 7, 4, 7); + humpMain2.setRotationPoint(0F, 0.75F - heightToRaise, 0.5F); + humpMain2.setTextureSize(128, 64); + humpMain2.mirror = true; + setRotation(humpMain2, 0F, 0F, 0F); + saddleBase = new ModelRenderer(this, 68, 52); + saddleBase.addBox(-3.5F, -2F, -2F, 6, 1, 5); + saddleBase.setRotationPoint(1F, 4F - heightToRaise, -5F); + saddleBase.setTextureSize(128, 64); + saddleBase.mirror = true; + setRotation(saddleBase, 0F, 0F, 0F); + saddleHorn1 = new ModelRenderer(this, 67, 1); + saddleHorn1.addBox(-1F, -3F, -1F, 1, 5, 1); + saddleHorn1.setRotationPoint(1F, 1F - heightToRaise, -6F); + saddleHorn1.setTextureSize(128, 64); + saddleHorn1.mirror = true; + setRotation(saddleHorn1, 0.3346075F, 0F, 0F); + saddleHorn2 = new ModelRenderer(this, 73, 5); + saddleHorn2.addBox(-2F, -1F, -1F, 4, 1, 1); + saddleHorn2.setRotationPoint(0.5F, 0F - heightToRaise, -7F); + saddleHorn2.setTextureSize(128, 64); + saddleHorn2.mirror = true; + setRotation(saddleHorn2, 0F, 0F, 0F); + Body = new ModelRenderer(this, 1, 14); + Body.addBox(-3.5F, -2F, -10F, 9, 9, 16); + Body.setRotationPoint(-0.5F, 5F - heightToRaise, 3F); + Body.setTextureSize(128, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + hip1 = new ModelRenderer(this, 68, 42); + hip1.addBox(-1F, -3F, -1F, 4, 4, 4); + hip1.setRotationPoint(-4F, 12F - heightToRaise, -5.5F); + hip1.setTextureSize(128, 64); + hip1.mirror = true; + setRotation(hip1, 0.0698132F, 0F, 0F); + Leg1toProt = new ModelRenderer(this, 65, 13); + Leg1toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg1toProt.setRotationPoint(-3F, 12F, -4.5F); + Leg1toProt.setRotationPoint(1F, 0F, 0.5F); + Leg1toProt.setTextureSize(128, 64); + Leg1toProt.mirror = true; + setRotation(Leg1toProt, 0.0698132F, 0F, 0F); + hip1.addChild(Leg1toProt); + Leg1BotRot = new ModelRenderer(this, 65, 25); + Leg1BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg1BotRot.setRotationPoint(-3F, 17F, -4F); + Leg1BotRot.setRotationPoint(0F, 6F, 0F); + Leg1BotRot.setTextureSize(128, 64); + Leg1BotRot.mirror = true; + setRotation(Leg1BotRot, -0.0698132F, 0F, 0F); + Leg1toProt.addChild(Leg1BotRot); + hip2 = new ModelRenderer(this, 68, 42); + hip2.addBox(-1F, -1F, -1F, 4, 4, 4); + hip2.setRotationPoint(3F, 10F - heightToRaise, -5.5F); + hip2.setTextureSize(128, 64); + hip2.mirror = true; + setRotation(hip2, 0.0698132F, 0F, 0F); + Leg2toProt = new ModelRenderer(this, 52, 13); + Leg2toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg2toProt.setRotationPoint(4F, 11F, -4.5F); + Leg2toProt.setRotationPoint(1F, 2F, 0.5F); + Leg2toProt.setTextureSize(128, 64); + Leg2toProt.mirror = true; + setRotation(Leg2toProt, 0.0698132F, 0F, 0F); + hip2.addChild(Leg2toProt); + Leg2BotRot = new ModelRenderer(this, 52, 25); + Leg2BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg2BotRot.setRotationPoint(4F, 17F, -4F); + Leg2BotRot.setRotationPoint(0F, 6F, 0F); + Leg2BotRot.setTextureSize(128, 64); + Leg2BotRot.mirror = true; + setRotation(Leg2BotRot, -0.0698132F, 0F, 0F); + Leg2toProt.addChild(Leg2BotRot); + hip3 = new ModelRenderer(this, 87, 42); + hip3.addBox(-1F, -1F, -1F, 4, 5, 4); + hip3.setRotationPoint(-4F, 9F - heightToRaise, 5F); + hip3.setTextureSize(128, 64); + hip3.mirror = true; + setRotation(hip3, 0.0698132F, 0F, 0F); + Leg3toProt = new ModelRenderer(this, 95, 13); + Leg3toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg3toProt.setRotationPoint(-3F, 12F, 6F); + Leg3toProt.setRotationPoint(1F, 2F, 1F); + Leg3toProt.setTextureSize(128, 64); + Leg3toProt.mirror = true; + setRotation(Leg3toProt, 0.0872665F, 0F, 0F); + hip3.addChild(Leg3toProt); + Leg3BotRot = new ModelRenderer(this, 95, 25); + Leg3BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg3BotRot.setRotationPoint(-3F, 17F, 6.5F); + Leg3BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg3BotRot.setTextureSize(128, 64); + Leg3BotRot.mirror = true; + setRotation(Leg3BotRot, -0.0698132F, 0F, 0F); + Leg3toProt.addChild(Leg3BotRot); + + hip4 = new ModelRenderer(this, 87, 42); + hip4.addBox(-1F, -1F, -1F, 4, 5, 4); + hip4.setRotationPoint(3F, 9F - heightToRaise, 5F); + hip4.setTextureSize(128, 64); + hip4.mirror = true; + setRotation(hip4, 0.0698132F, 0F, 0F); + Leg4toProt = new ModelRenderer(this, 81, 13); + Leg4toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg4toProt.setRotationPoint(4F, 12F, 6F); + Leg4toProt.setRotationPoint(1F, 2F, 1F); + Leg4toProt.setTextureSize(128, 64); + Leg4toProt.mirror = true; + setRotation(Leg4toProt, 0.0872665F, 0F, 0F); + hip4.addChild(Leg4toProt); + Leg4BotRot = new ModelRenderer(this, 81, 25); + Leg4BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg4BotRot.setRotationPoint(4F, 17F, 6.5F); + Leg4BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg4BotRot.setTextureSize(128, 64); + Leg4BotRot.mirror = true; + setRotation(Leg4BotRot, -0.0698132F, 0F, 0F); + Leg4toProt.addChild(Leg4BotRot); + tail = new ModelRenderer(this, 109, 13); + tail.addBox(-1F, -1F, 0F, 2, 7, 2); + tail.setRotationPoint(0F, 7F - heightToRaise, 7.6F); + tail.setTextureSize(128, 64); + tail.mirror = true; + setRotation(tail, 0.5585054F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + //Leg1toProt.render(f5); + //Leg1BotRot.render(f5); + hip2.render(renderScale * f5); + //Leg2toProt.render(f5); + //Leg2BotRot.render(f5); + hip3.render(renderScale * f5); + //Leg3toProt.render(f5); + //Leg3BotRot.render(f5); + hip4.render(renderScale * f5); + //Leg4toProt.render(f5); + //Leg4BotRot.render(f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + hip2.render(renderScale * f5); + hip3.render(renderScale * f5); + hip4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Tail Rotation */ + //NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 + //* MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + /* Tail Rotation */ + tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + /* Leg Animation */ + hip1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + hip2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + Leg1BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg2BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + hip3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + hip4.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + Leg3BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg4BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleX = Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = Math.min(Math.max(f3, -15), +35) * (float) (Math.PI / 180f); + } + + } diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a037ecf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a037ecf6c42100141fce95f06aba7e85 deleted file mode 100644 index 429eff2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/a037ecf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/b1688f9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/b1688f9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f6e8ace..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/b1688f9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c3aba1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c3aba1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a27ea4c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0c3aba1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPolarBear; -import projectzulu.common.mobs.models.ModelPolarBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0d85201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0d85201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77da7e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0d85201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,213 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelHorse extends ModelBase { - - float heightToRaise = 8; - - ModelRenderer body1; - ModelRenderer tail; - ModelRenderer body2; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG4TOPROT; - ModelRenderer NECKROT; - - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer HEADROT; - - private ModelRenderer EARROT; - - public ModelHorse() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG1TOPROT.leg1top", 0, 48); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 53); - setTextureOffset("LEG2TOPROT.leg2top", 14, 48); - setTextureOffset("LEG2BOTROT.leg2bot", 14, 53); - setTextureOffset("LEG3TOPROT.leg3top", 28, 48); - setTextureOffset("LEG3BOTROT.leg3bot", 28, 53); - setTextureOffset("LEG4TOPROT.leg4top", 42, 48); - setTextureOffset("LEG4BOTROT.leg4bot", 42, 53); - setTextureOffset("NECKROT.neck", 48, 0); - setTextureOffset("NECKROT.maneneck", 46, 21); - setTextureOffset("EARROT.earrig", 53, 18); - setTextureOffset("EARROT.earlef", 58, 18); - setTextureOffset("HEADROT.Head", 33, 0); - setTextureOffset("HEADROT.manehead", 46, 17); - - body1 = new ModelRenderer(this, 0, 0); - body1.addBox(-3.5F, -2F, -10F, 7, 10, 15); - body1.setRotationPoint(0F, 6F - heightToRaise, 3F); - body1.setTextureSize(64, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - tail = new ModelRenderer(this, 0, 25); - tail.addBox(-1F, -1F, 0F, 2, 10, 2); - tail.setRotationPoint(0F, 6F - heightToRaise, 8F); - tail.setTextureSize(64, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 25); - body2.addBox(-4.5F, -1.1F, -9F, 9, 8, 13); - body2.setRotationPoint(0F, 6F - heightToRaise, 3F); - body2.setTextureSize(64, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-2F, 14F - heightToRaise, -4.5F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(2F, 14F - heightToRaise, -4.5F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG2TOPROT.addChild(LEG2BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-2F, 14F - heightToRaise, 5.5F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -1.5F, 0F, -1.5F, 3, 4, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -1.5F, 0F, -1.5F, 3, 6, 3); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(2F, 14F - heightToRaise, 5.5F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -1F, 0F, -1F, 3, 4, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -1F, 0F, -1F, 3, 6, 3); - LEG4TOPROT.addChild(LEG4BOTROT); - NECKROT = new ModelRenderer(this, "NECKROT"); - NECKROT.setRotationPoint(0F, 3F - heightToRaise, -6F); - setRotation(NECKROT, 0.7853982F, 0F, 0F); - NECKROT.mirror = true; - NECKROT.addBox("neck", -1.5F, -5.5F, -2.5F, 3, 9, 5); - NECKROT.addBox("maneneck", -1F, -5.5F, 2.5F, 2, 7, 1); - EARROT = new ModelRenderer(this, "EARROT"); - EARROT.setRotationPoint(0F, -5.5F, 2.5F); - setRotation(EARROT, -0.7853982F, 0F, 0F); - EARROT.mirror = true; - EARROT.addBox("earrig", 1F, -1F, -0.5F, 1, 2, 1); - EARROT.addBox("earlef", -2F, -1F, -0.5F, 1, 2, 1); - NECKROT.addChild(EARROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -0F); - setRotation(HEADROT, -1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2F, -1F, -2F, 4, 8, 3); - HEADROT.addBox("manehead", -1F, -1.5F, -3F, 2, 3, 1); - NECKROT.addChild(HEADROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 1.5f * f5; - super.render(entity, f, f1, f2, f3, f4, scale); - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - NECKROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 12.0F * scale, +10.0F * scale); - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - GL11.glPopMatrix(); - } else { - body1.render(scale); - tail.render(scale); - body2.render(scale); - LEG1TOPROT.render(scale); - LEG2TOPROT.render(scale); - LEG3TOPROT.render(scale); - LEG4TOPROT.render(scale); - NECKROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Tail Rotation */ - NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - /* Tail Rotation */ - tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - /* Leg Animation */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0f667e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0f667e5c42100141fce95f06aba7e85 deleted file mode 100644 index 864d693..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/be/e0f667e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGiraffe; -import projectzulu.common.mobs.models.ModelGiraffe; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/0086f5e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/0086f5e4c42100141fce95f06aba7e85 deleted file mode 100644 index 63a4c85..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/0086f5e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,165 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00bf4df4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00bf4df4c42100141fce95f06aba7e85 deleted file mode 100644 index dad386a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/00bf4df4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryEdge implements Blueprint { - - List wallBlocks = new ArrayList(3); - List flowerBlocks = new ArrayList(3); - - public BlueprintCemetaryEdge() { - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 1, 2)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - wallBlocks.add(new BlockWithMeta(Blocks.cobblestone_wall, 0, 3)); - flowerBlocks.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowerBlocks.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowerBlocks.add(new BlockWithMeta(Blocks.air, 0, 8)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - /* North Facing Fence */ - if (cellIndexDirection == CellIndexDirection.NorthWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posZ == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* South Facing Fence */ - if (cellIndexDirection == CellIndexDirection.SouthWall - || cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posZ == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* West Facing Fence */ - if (cellIndexDirection == CellIndexDirection.WestWall - || cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if (piecePos.posX == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* East Facing Fence */ - if (cellIndexDirection == CellIndexDirection.EastWall - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if (piecePos.posX == cellSize - 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowerBlocks); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "CemetaryEdge"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/20a153f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/20a153f6c42100141fce95f06aba7e85 deleted file mode 100644 index b5a7524..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/20a153f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,577 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/309d5ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/309d5ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4262051..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/309d5ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/31ee12e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/31ee12e4c42100141fce95f06aba7e85 deleted file mode 100644 index 11793e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/31ee12e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBoarHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBoarHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 4F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/501310f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/501310f7c42100141fce95f06aba7e85 deleted file mode 100644 index b47235b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/501310f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockQuickSand; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/50521901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/50521901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3b5ea1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/50521901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityFollower; -import projectzulu.common.mobs.models.ModelFollower; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/61d33bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/61d33bf6c42100141fce95f06aba7e85 deleted file mode 100644 index 26d85a7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/61d33bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/d0fcb39dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/d0fcb39dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b09e4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/d0fcb39dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EntityCreeperBlossomPrimed extends Entity { - /** How long the fuse is */ - public int fuse; - - public EntityCreeperBlossomPrimed(World par1World) { - super(par1World); - this.fuse = 40; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; - } - - public EntityCreeperBlossomPrimed(World par1World, double par2, double par4, double par6) { - this(par1World); - this.setPosition(par2, par4, par6); - float var8 = (float) (Math.random() * Math.PI * 2.0D); - this.motionX = (double) (-((float) Math.sin((double) var8)) * 0.02F); - this.motionY = 0.20000000298023224D; - this.motionZ = (double) (-((float) Math.cos((double) var8)) * 0.02F); - this.fuse = 40; - this.prevPosX = par2; - this.prevPosY = par4; - this.prevPosZ = par6; - } - - @Override - protected void entityInit() { - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() { - return !this.isDead; - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.9800000190734863D; - this.motionY *= 0.9800000190734863D; - this.motionZ *= 0.9800000190734863D; - - if (this.onGround) { - this.motionX *= 0.699999988079071D; - this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - - if (this.fuse-- <= 0) { - this.setDead(); - - if (!this.worldObj.isRemote) { - this.explode(); - } - } else { - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - } - } - - private void explode() { - float var1 = 1.5F; - this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, var1, this.worldObj - .getGameRules().getGameRuleBooleanValue("mobGriefing")); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setByte("Fuse", (byte) this.fuse); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - this.fuse = par1NBTTagCompound.getByte("Fuse"); - } - - @SideOnly(Side.CLIENT) - @Override - public float getShadowSize() { - return 0.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/f2476cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/f2476cf8c42100141fce95f06aba7e85 deleted file mode 100644 index 6031b91..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/bf/f2476cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/000126e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/000126e4c42100141fce95f06aba7e85 deleted file mode 100644 index 66987f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/000126e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemAloeVera extends ItemBlock { - - public ItemAloeVera(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "base_1"; - break; - } - case 1: { - name = "base_2"; - break; - } - case 2: { - name = "base_3"; - break; - } - case 3: { - name = "base_4"; - break; - } - case 4: { - name = "flower_1"; - break; - } - case 5: { - name = "flower_2"; - break; - } - case 6: { - name = "flower_3"; - break; - } - case 7: { - name = "flower_4"; - break; - } - case 8: { - name = "flower_5"; - break; - } - default: - name = "base_1"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00095801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00095801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 202fbfd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00095801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,326 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/004996f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/004996f9c42100141fce95f06aba7e85 deleted file mode 100644 index 913c130..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/004996f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -public enum ButtonIDs { - NEWENTRY(-1), SAVENCLOSE(-2), DELENTRY(-6), CANCEL(-3), FORWARD(-4), BACKWARDS(-5); - - int index; - - ButtonIDs(int index) { - this.index = index; - } - - public static ButtonIDs getButtonByIndex(int index) { - for (ButtonIDs buttonID : ButtonIDs.values()) { - if (buttonID.index == index) { - return buttonID; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00bf2ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00bf2ff9c42100141fce95f06aba7e85 deleted file mode 100644 index bab5d35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00bf2ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Class Holds Entity Age Methods - * such as setting and saving age - */ -public class EntityGenericAgeable extends EntityGenericCreature{ - - public EntityGenericAgeable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Growing Age */ - this.dataWatcher.addObject(12, new Integer(0)); - } - /** - * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's - * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the - * Entity is considered a child. - */ - public int getGrowingAge() { return this.dataWatcher.getWatchableObjectInt(12); } - public void setGrowingAge(int par1) { this.dataWatcher.updateObject(12, Integer.valueOf(par1)); } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onUpdate() { - super.onUpdate(); - int var1 = this.getGrowingAge(); - - if (var1 < 0){ - ++var1; - this.setGrowingAge(var1); - } - else if (var1 > 0){ - --var1; - this.setGrowingAge(var1); - } - } - - @Override - public boolean isChild() { - return getGrowingAge() < 0; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00d3fcf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00d3fcf9c42100141fce95f06aba7e85 deleted file mode 100644 index df0c39d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/00d3fcf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemScale; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/017e8fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/017e8fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4cca9a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/017e8fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,332 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/2027e300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/2027e300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 464c195..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/2027e300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/60996701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/60996701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 12d5690..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c/60996701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.BossHealthDisplayTicker; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; - -public class RenderMummyPharaoh extends RenderGenericLiving { - protected ModelMummyPharaoh modelBipedMain; - - public RenderMummyPharaoh(ModelBase modelBase, float par1, ResourceLocation textureLocation) { - super(modelBase, par1, textureLocation); - this.modelBipedMain = (ModelMummyPharaoh) modelBase; - } - - public void renderMummyPharaoh(EntityMummyPharaoh entityMummyPharaoh, double par2, double par4, double par6, - float par8, float par9) { - super.doRender(entityMummyPharaoh, par2, par4, par6, par8, par9); - BossHealthDisplayTicker.registerEntityMummyPharaoh(entityMummyPharaoh); - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - super.renderEquippedItems(par1EntityLiving, par2); - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - this.modelBipedMain.bipedRightArm.postRender(0.0625F); - GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - - GL11.glPopMatrix(); - } - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/21ba2c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/21ba2c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41eae85..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/21ba2c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRabbit; -import projectzulu.common.mobs.models.ModelRabbit; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RabbitDeclaration extends SpawnableDeclaration { - - public RabbitDeclaration() { - super("Rabbit", 21, EntityRabbit.class, EnumCreatureType.creature); - setSpawnProperties(15, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (239 << 16) + (179 << 8) + 83; - eggColor2 = (237 << 16) + (208 << 8) + 166; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.RabbitsFoot.meta(), 8); - customMobData.entityProperties = new EntityProperties(10f, 1.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/3193b8f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/3193b8f8c42100141fce95f06aba7e85 deleted file mode 100644 index 3660cda..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/3193b8f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelCrocodile extends ModelBase { - ModelRenderer MOUTHBOTROT; - ModelRenderer MOUTHTOPROT; - ModelRenderer BODY1ROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - private ModelRenderer BODY2ROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer BODY3ROT; - private ModelRenderer BODY4ROT; - private ModelRenderer BODY5ROT; - private ModelRenderer BODY6ROT; - private ModelRenderer TAIL1ROT; - private ModelRenderer TAIL2ROT; - private ModelRenderer TAIL3ROT; - private ModelRenderer TAILROT4; - private ModelRenderer TAILROT5; - private ModelRenderer TAILROT6; - private ModelRenderer TAILROT7; - private ModelRenderer TAILROT8; - private ModelRenderer TAILROT9; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - - public ModelCrocodile() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("BODY1ROT.Body1", 62, 0); - setTextureOffset("BODY1ROT.bodydeclef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig1", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig1", 0, 0); - setTextureOffset("BODY1ROT.Shape1", 0, 0); - setTextureOffset("BODY1ROT.bodydeclef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig2", 0, 0); - setTextureOffset("BODY2ROT.Body2", 62, 0); - setTextureOffset("BODY2ROT.bodydeclef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydeclef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig4", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig4", 0, 0); - setTextureOffset("LEG2TOPROT.leg2top", 20, 12); - setTextureOffset("LEG2TOPROT.leg2deco", 16, 8); - setTextureOffset("LEG2BOTROT.leg2bot", 16, 20); - setTextureOffset("LEG1TOPROT.leg1top", 0, 12); - setTextureOffset("LEG1TOPROT.leg1deco", 0, 8); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 20); - setTextureOffset("BODY3ROT.Body3", 62, 0); - setTextureOffset("BODY3ROT.bodydeclef5", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef5", 0, 0); - setTextureOffset("BODY3ROT.bodydeclef6", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef6", 0, 0); - setTextureOffset("BODY4ROT.Body4", 62, 0); - setTextureOffset("BODY4ROT.bodydecinrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinrig8", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef8", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef8", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig8", 0, 0); - setTextureOffset("BODY5ROT.Body5", 62, 0); - setTextureOffset("BODY5ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig10", 0, 0); - setTextureOffset("BODY6ROT.Body6", 62, 0); - setTextureOffset("BODY6ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig10", 0, 0); - setTextureOffset("TAIL1ROT.tail1", 62, 12); - setTextureOffset("TAIL1ROT.bodydecinlef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecinrig11", 0, 0); - setTextureOffset("TAIL1ROT.bodydeclef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecrig11", 0, 0); - setTextureOffset("TAIL2ROT.tail2", 62, 22); - setTextureOffset("TAIL2ROT.bodydeclef12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinlef12", 0, 0); - setTextureOffset("TAIL3ROT.tail3", 62, 31); - setTextureOffset("TAIL3ROT.bodydecrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinlef13", 0, 0); - setTextureOffset("TAIL3ROT.bodydeclef13", 0, 0); - setTextureOffset("TAILROT4.tail4", 62, 40); - setTextureOffset("TAILROT4.bodydecrig14", 0, 0); - setTextureOffset("TAILROT4.bodydecinlef14", 0, 0); - setTextureOffset("TAILROT4.bodydeclef14", 0, 0); - setTextureOffset("TAILROT5.tail5", 62, 48); - setTextureOffset("TAILROT5.bodydeclef15", 0, 0); - setTextureOffset("TAILROT5.bodydecrig16", 0, 0); - setTextureOffset("TAILROT5.bodydecrig15", 0, 0); - setTextureOffset("TAILROT5.bodydeclef16", 0, 0); - setTextureOffset("TAILROT6.tail6", 84, 49); - setTextureOffset("TAILROT6.bodydeclef17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig18", 0, 0); - setTextureOffset("TAILROT6.bodydeclef18", 0, 0); - setTextureOffset("TAILROT7.tail7", 90, 44); - setTextureOffset("TAILROT7.bodydecrig19", 0, 0); - setTextureOffset("TAILROT7.bodydeclef19", 0, 0); - setTextureOffset("TAILROT8.tail8", 94, 40); - setTextureOffset("TAILROT8.bodydecrig20", 0, 0); - setTextureOffset("TAILROT8.bodydeclef20", 0, 0); - setTextureOffset("TAILROT9.tail9", 98, 37); - setTextureOffset("LEG4TOPROT.leg4top", 20, 12); - setTextureOffset("LEG4TOPROT.leg4deco", 16, 8); - setTextureOffset("LEG4BOTROT.leg4bot", 16, 20); - setTextureOffset("LEG3TOPROT.leg3top", 0, 12); - setTextureOffset("LEG3TOPROT.leg3deco", 0, 8); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 20); - - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 17F, -7F); - setRotation(BODY1ROT, 0F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("Body1", -7F, -4F, 0F, 14, 8, 4); - BODY1ROT.addBox("bodydeclef1", -5.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef1", -2F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig1", 1F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig1", 4.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("Shape1", 0F, 0F, 0F, 1, 1, 1); - BODY1ROT.addBox("bodydeclef2", -5.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef2", -2F, -5F, 2.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig2", 4.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig2", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("Body2", -7F, -4F, 0F, 14, 8, 4); - BODY2ROT.addBox("bodydeclef3", -5.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef3", -2F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig3", 4.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig3", 1F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydeclef4", -5.5F, -5F, 3F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef4", -2F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig4", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig4", 4.5F, -5F, 3F, 1, 1, 1); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(7F, 1F, 2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", 0F, -2F, -2F, 6, 4, 4); - LEG2TOPROT.addBox("leg2deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2F, 0F, -2F, 4, 4, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY2ROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-8F, 1F, 2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -5F, -2F, -2F, 6, 4, 4); - LEG1TOPROT.addBox("leg1deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -2F, 0F, -2F, 4, 4, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY2ROT.addChild(LEG1TOPROT); - BODY3ROT = new ModelRenderer(this, "BODY3ROT"); - BODY3ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY3ROT, 0F, 0F, 0F); - BODY3ROT.mirror = true; - BODY3ROT.addBox("Body3", -7F, -4F, 0F, 14, 8, 4); - BODY3ROT.addBox("bodydeclef5", -5.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig5", 4.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig5", 1F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef5", -2F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydeclef6", -5.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig6", 4.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig6", 1F, -5F, 2.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef6", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT = new ModelRenderer(this, "BODY4ROT"); - BODY4ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY4ROT, 0F, 0F, 0F); - BODY4ROT.mirror = true; - BODY4ROT.addBox("Body4", -7F, -4F, 0F, 14, 8, 4); - BODY4ROT.addBox("bodydecinrig7", 1F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef7", -2F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig7", 4.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef7", -5.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydecinrig8", 1F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef8", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef8", -5.5F, -5F, 3F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig8", 4.5F, -5F, 3F, 1, 1, 1); - BODY5ROT = new ModelRenderer(this, "BODY5ROT"); - BODY5ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY5ROT, 0F, 0F, 0F); - BODY5ROT.mirror = true; - BODY5ROT.addBox("Body5", -7F, -4F, 0F, 14, 8, 4); - BODY5ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - BODY6ROT = new ModelRenderer(this, "BODY6ROT"); - BODY6ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY6ROT, 0F, 0F, 0F); - BODY6ROT.mirror = true; - BODY6ROT.addBox("Body6", -7F, -4F, 0F, 14, 8, 4); - BODY6ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - TAIL1ROT = new ModelRenderer(this, "TAIL1ROT"); - TAIL1ROT.setRotationPoint(0F, 0F, 4F); - setRotation(TAIL1ROT, 0F, 0F, 0F); - TAIL1ROT.mirror = true; - TAIL1ROT.addBox("tail1", -6F, -3.5F, 0F, 12, 7, 3); - TAIL1ROT.addBox("bodydecinlef11", -2F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydecinrig11", 1F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydeclef11", -5F, -4.5F, 1F, 1, 1, 1); - TAIL1ROT.addBox("bodydecrig11", 4F, -4.5F, 1F, 1, 1, 1); - TAIL2ROT = new ModelRenderer(this, "TAIL2ROT"); - TAIL2ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL2ROT, 0F, 0F, 0F); - TAIL2ROT.mirror = true; - TAIL2ROT.addBox("tail2", -5.5F, -2.5F, 0F, 11, 6, 3); - TAIL2ROT.addBox("bodydeclef12", -4.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecrig12", 3.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinrig12", 1F, -3.5F, 0.5F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinlef12", -2F, -3.5F, 0.5F, 1, 1, 1); - TAIL3ROT = new ModelRenderer(this, "TAIL3ROT"); - TAIL3ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL3ROT, 0F, 0F, 0F); - TAIL3ROT.mirror = true; - TAIL3ROT.addBox("tail3", -4.5F, -1.5F, 0F, 9, 5, 4); - TAIL3ROT.addBox("bodydecrig13", 2.5F, -2.5F, 1.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinrig13", 0.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinlef13", -1.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydeclef13", -4F, -2.5F, 1.5F, 1, 1, 1); - TAILROT4 = new ModelRenderer(this, "TAILROT4"); - TAILROT4.setRotationPoint(0F, 1.5F, 4F); - setRotation(TAILROT4, 0F, 0F, 0F); - TAILROT4.mirror = true; - TAILROT4.addBox("tail4", -4F, -2F, 0F, 8, 4, 4); - TAILROT4.addBox("bodydecrig14", 2F, -3F, 1.5F, 1, 1, 1); - TAILROT4.addBox("bodydecinlef14", -0.5F, -3F, 0.5F, 1, 1, 1); - TAILROT4.addBox("bodydeclef14", -3F, -3F, 1.5F, 1, 1, 1); - TAILROT5 = new ModelRenderer(this, "TAILROT5"); - TAILROT5.setRotationPoint(0F, 0.5F, 4F); - setRotation(TAILROT5, 0F, 0F, 0F); - TAILROT5.mirror = true; - TAILROT5.addBox("tail5", -3F, -1.5F, 0F, 6, 3, 5); - TAILROT5.addBox("bodydeclef15", -2F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig16", 1F, -2.5F, 3.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig15", 1F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydeclef16", -2F, -2.5F, 3.5F, 1, 1, 1); - TAILROT6 = new ModelRenderer(this, "TAILROT6"); - TAILROT6.setRotationPoint(0F, 0.5F, 5F); - setRotation(TAILROT6, 0F, 0F, 0F); - TAILROT6.mirror = true; - TAILROT6.addBox("tail6", -2.5F, -1F, 0F, 5, 2, 5); - TAILROT6.addBox("bodydeclef17", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig17", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig18", 0.5F, -2F, 3F, 1, 1, 1); - TAILROT6.addBox("bodydeclef18", -1.5F, -2F, 3F, 1, 1, 1); - TAILROT7 = new ModelRenderer(this, "TAILROT7"); - TAILROT7.setRotationPoint(0F, 0F, 5F); - setRotation(TAILROT7, 0F, 0F, 0F); - TAILROT7.mirror = true; - TAILROT7.addBox("tail7", -2F, -1F, 0F, 4, 2, 3); - TAILROT7.addBox("bodydecrig19", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT7.addBox("bodydeclef19", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT8 = new ModelRenderer(this, "TAILROT8"); - TAILROT8.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT8, 0F, 0F, 0F); - TAILROT8.mirror = true; - TAILROT8.addBox("tail8", -1.5F, -1F, 0F, 3, 2, 2); - TAILROT8.addBox("bodydecrig20", 0.5F, -2F, 0.5F, 1, 1, 1); - TAILROT8.addBox("bodydeclef20", -1.5F, -2F, 0.5F, 1, 1, 1); - TAILROT9 = new ModelRenderer(this, "TAILROT9"); - TAILROT9.setRotationPoint(0F, 0F, 2F); - setRotation(TAILROT9, 0F, 0F, 0F); - TAILROT9.mirror = true; - TAILROT9.addBox("tail9", -1F, -1F, 0F, 2, 2, 1); - TAILROT8.addChild(TAILROT9); - TAILROT7.addChild(TAILROT8); - TAILROT6.addChild(TAILROT7); - TAILROT5.addChild(TAILROT6); - TAILROT4.addChild(TAILROT5); - TAIL3ROT.addChild(TAILROT4); - TAIL2ROT.addChild(TAIL3ROT); - TAIL1ROT.addChild(TAIL2ROT); - BODY6ROT.addChild(TAIL1ROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(7F, 1F, 0F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", 0F, -2F, -2F, 6, 4, 4); - LEG4TOPROT.addBox("leg4deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -2F, 0F, -2F, 4, 4, 4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODY6ROT.addChild(LEG4TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-8F, 1F, 0F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -5F, -2F, -2F, 6, 4, 4); - LEG3TOPROT.addBox("leg3deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -2F, 0F, -2F, 4, 4, 4); - LEG3TOPROT.addChild(LEG3BOTROT); - BODY6ROT.addChild(LEG3TOPROT); - BODY5ROT.addChild(BODY6ROT); - BODY4ROT.addChild(BODY5ROT); - BODY3ROT.addChild(BODY4ROT); - BODY2ROT.addChild(BODY3ROT); - BODY1ROT.addChild(BODY2ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 6.0F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.7F / var8, 1.7F / var8, 1.7F / var8); - GL11.glTranslatef(0.0f, field_78145_g * f5, field_78151_h * f5); - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODY1ROT.render(f5); - GL11.glPopMatrix(); - } else { - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - BODY1ROT.render(f5); - - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG2TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG1TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODY1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 0 / 4 * (float) Math.PI) * 0.1F * par3; - BODY2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; - BODY3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 2 / 4 * (float) Math.PI) * 0.1F * par3; - BODY4ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 3 / 4 * (float) Math.PI) * 0.1F * par3; - BODY5ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 4 / 4 * (float) Math.PI) * 0.1F * par3; - BODY6ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 5 / 4 * (float) Math.PI) * 0.1F * par3; - - TAIL1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 6 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 7 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 8 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT4.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 9 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT5.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 10 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT6.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 11 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT7.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 12 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT8.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 13 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT9.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 14 / 4 * (float) Math.PI) * 0.1F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - MOUTHTOPROT.rotateAngleX = -Math.abs(MathHelper.cos(f * 0.6662F) * f1) + Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - MOUTHTOPROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - - MOUTHBOTROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - MOUTHBOTROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/40242f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/40242f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b722a42..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/40242f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityLizard; -import projectzulu.common.mobs.models.ModelLizard; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/50a0a3e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/50a0a3e5c42100141fce95f06aba7e85 deleted file mode 100644 index 1dc8c3e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/50a0a3e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,502 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/60d574a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/60d574a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 285c0e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/60d574a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/60de9a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/60de9a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e306471..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/60de9a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70f768f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70f768f9c42100141fce95f06aba7e85 deleted file mode 100644 index 1ed1b2e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/70f768f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/80b9d4fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/80b9d4fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index faaed09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/80b9d4fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityFrog; -import projectzulu.common.mobs.models.ModelFrog; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FrogDeclaration extends SpawnableDeclaration { - - public FrogDeclaration() { - super("Frog", 13, EntityFrog.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (95 << 16) + (186 << 8) + 50; - eggColor2 = (105 << 16) + (203 << 8) + 67; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.FrogLegs.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.3f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFrog(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "frog.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/823c64f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/823c64f9c42100141fce95f06aba7e85 deleted file mode 100644 index 4f8db16..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/823c64f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a13582e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a13582e5c42100141fce95f06aba7e85 deleted file mode 100644 index 468931c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/a13582e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import projectzulu.common.mobs.models.ModelTreeEnt; -import projectzulu.common.mobs.renders.RenderSnow; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/b0deb3f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/b0deb3f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2130a59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/b0deb3f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,114 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/b13652f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/b13652f5c42100141fce95f06aba7e85 deleted file mode 100644 index e9e5b40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/b13652f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,556 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityEagle; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/d14ce8a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/d14ce8a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 72744b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/d14ce8a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData().toString() - //.func_150283_g(nodeList.get(clickedIndex).getData().getId()) - , nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/e07bca902024001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/e07bca902024001415179d45b0e27e9a deleted file mode 100644 index 2626abb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/e07bca902024001415179d45b0e27e9a +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/e1e29ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/e1e29ae4c42100141fce95f06aba7e85 deleted file mode 100644 index c379644..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c0/e1e29ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/2080a3f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/2080a3f4c42100141fce95f06aba7e85 deleted file mode 100644 index 0f2ea1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/2080a3f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package com.ngb.projectzulu.common.world; - -import java.util.Random; - -public enum CellIndexDirection { - Middle, Inner, NorthMiddle, SouthMiddle, WestMiddle, EastMiddle, NorthWestCorner, NorthEastCorner, SouthWestCorner, SouthEastCorner, NorthWall, SouthWall, WestWall, EastWall; - - public boolean isCorner() { - return this == NorthWestCorner || this == NorthEastCorner || this == SouthWestCorner || this == SouthEastCorner; - } - - public static CellIndexDirection randomCardinalDirection(Random random) { - switch (random.nextInt(4)) { - case 0: - return NorthMiddle; - case 1: - return SouthMiddle; - case 2: - return WestMiddle; - case 3: - return EastMiddle; - default: - return NorthMiddle; - } - } - - public CellIndexDirection calcDirection(int cellIndex, int cellSize) { - - /* Check if Middle */ - if (cellSize % 2 == 1) { - if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1) / 2) { - return Middle; - } else if (cellIndex == (cellSize - 1) / 2) { - return WestMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2) { - return NorthMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) + (cellSize - 1) / 2) { - return EastMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1)) { - return SouthMiddle; - } - } - - /* Check if Corner */ - if (cellIndex == 0) { - return NorthWestCorner; - } else if (cellIndex == cellSize - 1) { - return SouthWestCorner; - } else if (cellIndex == cellSize * cellSize - 1) { - return SouthEastCorner; - } else if (cellIndex == cellSize * cellSize - cellSize) { - return NorthEastCorner; - } - - /* Check if Outer Edge */ - if ((cellIndex % cellSize == (0))) { - return NorthWall; - } else if ((cellIndex % cellSize == (cellSize - 1))) { - return SouthWall; - } else if (cellIndex >= cellSize * (cellSize - 1) && cellIndex < cellSize * cellSize) { - return EastWall; - } else if (cellIndex >= 0 && cellIndex < cellSize) { - return WestWall; - } - - /* If Nothing Else Mark as Inner */ - return Inner; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/30030eb7f62000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/30030eb7f62000141769cb1ed0c338cd deleted file mode 100644 index c97739d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/30030eb7f62000141769cb1ed0c338cd +++ /dev/null @@ -1,34 +0,0 @@ -package com.example.tutmod; - -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - - -@Mod(modid = TutorialMod1.MODID, version = TutorialMod1.VERSION) - -public class TutorialMod1 { - - public static final String MODID = "TutorialMod1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void preInit(FMLPreInitializationEvent event) - { - - } - - @EventHandler - public void init(FMLInitializationEvent event) - { - - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) - { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/50017ca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/50017ca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e2a86a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/50017ca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,158 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import net.minecraft.util.DamageSource; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; - -public abstract class EntityMaster extends EntityGenericAnimal { - - List followerList = new ArrayList(); - int numberOfFollowers = 9; - - boolean spawnFollowers = true; - - /* Represents the increments between each slave-Piece, used to determine number of locations needed to track */ - int distanceIncrements = 10; - float distancePerIncrement; - - boolean isPositionListSetup = false; - LinkedList positionList = new LinkedList(); - - public EntityMaster(World par1World) { - super(par1World); - - distancePerIncrement = width / distanceIncrements; - while (followerList.size() < numberOfFollowers) { - followerList.add(null); - } - } - - @Override - public boolean canBePushed() { - return false; - } - - /* Handling of Child Entities Position Must be Handled on Server and Client Side */ - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - if (!isPositionListSetup) { - double xzOffset = 0; - while (positionList.size() < numberOfFollowers * distanceIncrements + 1) { - positionList.add(Vec3.createVectorHelper(posX + xzOffset, posY, posZ)); - xzOffset += distancePerIncrement; - } - isPositionListSetup = true; - } - - /* Calculate Position Array, used to set the target position for Followers */ - double minDistanceToIterateList = distancePerIncrement; - while (calcDistance(posX, posZ, positionList.getFirst().xCoord, positionList.getFirst().zCoord) > minDistanceToIterateList) { - - double xDist = posX - positionList.getFirst().xCoord; - double zDist = posZ - positionList.getFirst().zCoord; - - double scaleFactor = (minDistanceToIterateList / calcDistance(posX, posZ, positionList.getFirst().xCoord, - positionList.getFirst().zCoord)); - double actualXCoord = positionList.getFirst().xCoord + xDist * scaleFactor; - double actualZCoord = positionList.getFirst().zCoord + zDist * scaleFactor; - - positionList.addFirst(Vec3.createVectorHelper(actualXCoord, posY, actualZCoord)); - positionList.removeLast(); - } - - /* - * Store the Values Gotten from positionList.get from previous iteration Used to Calculate TargetRotation - */ - double prevX = posX; - double prevZ = posZ; - for (int i = 0; i < followerList.size(); i++) { - - if (followerList.get(i) != null) { - EntityFollower entityFollower = followerList.get(i); - - /* Get Position From Position List */ - double setXAround = positionList.get((i + 1) * distanceIncrements).xCoord; - double setZAround = positionList.get((i + 1) * distanceIncrements).zCoord; - double setYAround = positionList.get((i + 1) * distanceIncrements).yCoord; - entityFollower.setTargetPosition(Vec3.createVectorHelper(setXAround, posY, setZAround)); - - entityFollower - .setTargetRotation((float) (Math.atan2(setXAround - prevX, prevZ - setZAround) * (180.0 / Math.PI))); - prevX = setXAround; - prevZ = setZAround; - - /* Check if Prev Point is Dead, is so, I should probably be killed to */ - if (i > 0 && followerList.get(i - 1) != null) { - if (followerList.get(i - 1).isDead) { - entityFollower.shouldBeDying = true; - } - } - } - } - } - - /* Creation of Child Entities should only be Done on Server */ - @Override - public void updateAITick() { - - /* Count Number of Followers, used to determine if more followers should be spawned */ - int currentNumOfFollowers = 0; - for (int i = 0; i < followerList.size(); i++) { - /* Spawn new Followers if Neccesary */ - if (followerList.get(i) == null || (followerList.get(i).isDead && spawnFollowers)) { - followerList.set(i, new EntityFollower(worldObj, posX, posY, posZ, this, i)); - worldObj.spawnEntityInWorld(followerList.get(i)); - } - EntityFollower entityFollower = followerList.get(i); - - /* Count Number of Followers, used to determine if more followers should be spawned */ - if (!entityFollower.isDead) { - currentNumOfFollowers += 1; - } - } - - /* Check if We should Spawn More Followers */ - spawnFollowers = currentNumOfFollowers < numberOfFollowers ? true : false; - super.updateAITick(); - } - - /** - * Code to Assign body to Head, called by Body client Side to establish link - */ - public boolean linkFollowerWithMaster(EntityFollower entityFollower, int followerIndex) { - if (followerList.get(followerIndex) != null && !followerList.get(followerIndex).isDead) { - return false; - } - followerList.set(followerIndex, entityFollower); - return true; - } - - /* Shares Damage with Followers */ - public boolean attackEntityFromChild(EntityFollower var1, DamageSource var2, float var3) { - if (super.attackEntityFrom(var2, var3)) { - for (int i = 0; i < followerList.size(); i++) { - EntityFollower entityFollower = followerList.get(i); - if (entityFollower != null) { - entityFollower.hurtChildFromMaster(var2, var3); - } - } - return true; - } - return false; - } - - @Override - protected boolean canDespawn() { - return true; - } - - private double calcDistance(double x1, double z1, double x2, double z2) { - return Math.sqrt((x2 - x1) * (x2 - x1) + (z2 - z1) * (z2 - z1)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/5009e69dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/5009e69dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 01fb9a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/5009e69dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutItem; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/801198cffa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/801198cffa2000141769cb1ed0c338cd deleted file mode 100644 index 956d14d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/801198cffa2000141769cb1ed0c338cd +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.API; - -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -public enum ItemList { - instance; - /* Items */ - public static Optional ankh = Optional.absent(); - public static Optional scaleItem = Optional.absent(); - public static Optional furPelt = Optional.absent(); - - public static Optional aloeVeraSeeds = Optional.absent(); - public static Optional waterDroplets = Optional.absent(); - - public static Optional coconutItem = Optional.absent(); - public static Optional coconutSeed = Optional.absent(); - public static Optional coconutShell = Optional.absent(); - public static Optional coconutMilkFragment = Optional.absent(); - - public static Optional genericCraftingItems = Optional.absent(); - public static Optional scrapMeat = Optional.absent(); - public static Optional structurePlacer = Optional.absent(); - public static Optional potionIngredients = Optional.absent(); - public static Optional customPotions = Optional.absent(); - public static Optional vanillaPotions = Optional.absent(); - - /* Armor */ - public static Optional scaleArmorHead = Optional.absent(); - public static Optional scaleArmorChest = Optional.absent(); - public static Optional scaleArmorLeg = Optional.absent(); - public static Optional scaleArmorBoots = Optional.absent(); - - public static Optional goldScaleArmorHead = Optional.absent(); - public static Optional goldScaleArmorChest = Optional.absent(); - public static Optional goldScaleArmorLeg = Optional.absent(); - public static Optional goldScaleArmorBoots = Optional.absent(); - - public static Optional ironScaleArmorHead = Optional.absent(); - public static Optional ironScaleArmorChest = Optional.absent(); - public static Optional ironScaleArmorLeg = Optional.absent(); - public static Optional ironScaleArmorBoots = Optional.absent(); - - public static Optional diamondScaleArmorHead = Optional.absent(); - public static Optional diamondScaleArmorChest = Optional.absent(); - public static Optional diamondScaleArmorLeg = Optional.absent(); - public static Optional diamondScaleArmorBoots = Optional.absent(); - - public static Optional whiteClothHead = Optional.absent(); - public static Optional whiteClothChest = Optional.absent(); - public static Optional whiteClothLeg = Optional.absent(); - public static Optional whiteClothBoots = Optional.absent(); - - public static Optional redClothHead = Optional.absent(); - public static Optional redClothChest = Optional.absent(); - public static Optional redClothLeg = Optional.absent(); - public static Optional redClothBoots = Optional.absent(); - - public static Optional greenClothHead = Optional.absent(); - public static Optional greenClothChest = Optional.absent(); - public static Optional greenClothLeg = Optional.absent(); - public static Optional greenClothBoots = Optional.absent(); - - public static Optional blueClothHead = Optional.absent(); - public static Optional blueClothChest = Optional.absent(); - public static Optional blueClothLeg = Optional.absent(); - public static Optional blueClothBoots = Optional.absent(); - - public static Optional cactusArmorHead = Optional.absent(); - public static Optional cactusArmorChest = Optional.absent(); - public static Optional cactusArmorLeg = Optional.absent(); - public static Optional cactusArmorBoots = Optional.absent(); - - public static Optional furArmorHead = Optional.absent(); - public static Optional furArmorChest = Optional.absent(); - public static Optional furArmorLeg = Optional.absent(); - public static Optional furArmorBoots = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/802300f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/802300f9c42100141fce95f06aba7e85 deleted file mode 100644 index 44ebeaf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/802300f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/908dcdfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/908dcdfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 61a621f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/908dcdfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBeaver; -import projectzulu.common.mobs.models.ModelBeaver; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BeaverDeclaration extends SpawnableDeclaration { - - public BeaverDeclaration() { - super("Beaver", 15, EntityBeaver.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (54 << 16) + (36 << 8) + 9; - eggColor2 = (67 << 16) + (45 << 8) + 11; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/929f47ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/929f47ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6616e7f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/929f47ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprint.cathedral.BPSetCathedral; - -public class ArchitectCathedral extends ArchitectBase { - - public ArchitectCathedral(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetCathedral()); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - set = stockpile.getRandomApplicable(cells, buildCoords); - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/a0fcb500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/a0fcb500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index da850b0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/a0fcb500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,309 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; - -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketTameParticle; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidTamingItem() function - */ -public abstract class EntityGenericTameable extends EntityGenericRideable{ - boolean shouldFollow = false; - boolean shouldAttack = false; - - public EntityGenericTameable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Handles the Taming State 0 == Wild, - * Bit 3 handles if Tamed (&4), - * Bit 1 handles if Sitting (&1), - */ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - - /* Handles the Owners name */ - this.dataWatcher.addObject(23, ""); - - /* Handles the Entity's name */ - this.dataWatcher.addObject(24, ""); - -// /* Handles the Entity's Health */ -// this.dataWatcher.addObject(25, Short.valueOf((short) getMaxHealth())); - - } - - public String getUsername() { - return this.dataWatcher.getWatchableObjectString(24); - } - - public void setUsername(String username) { - this.dataWatcher.updateObject(24, username); - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(22) & 4) != 0; - } - - public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 4))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -5))); - } - } - - @Override - protected boolean canDespawn() { - return isTamed() ? false : super.canDespawn(); - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(22) & 1) != 0; - } - - public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(22); - if (par1) { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 | 1))); - } - else { - this.dataWatcher.updateObject(22, Byte.valueOf((byte)(var2 & -2))); - } - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(23); - } - - public void setOwner(String par1Str) { - this.dataWatcher.updateObject(23, par1Str); - } - - public EntityLivingBase getOwner() { - return this.worldObj.getPlayerEntityByName(this.getOwnerName()); - } - -// public void updateDWHealth(int health) { -// this.dataWatcher.updateObject(25, (short)health); -// } -// -// public int getDWHealth() { -// return this.dataWatcher.getWatchableObjectShort(25); -// } - /** - * Play the taming effect, will either be hearts or smoke depending on status - */ - public void playTameEffect(boolean par1){ - String var2 = "heart"; - - if (!par1){ - var2 = "smoke"; - } - - for (int var3 = 0; var3 < 7; ++var3){ - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var2, - this.posX + this.rand.nextFloat() * this.width * 2.0F - this.width, - this.posY + 0.5D + this.rand.nextFloat() * this.height, - this.posZ + this.rand.nextFloat() * this.width * 2.0F - this.width, var4, var6, var8); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - if (this.getOwnerName() == null){ - par1NBTTagCompound.setString("Owner", ""); - } - else{ - par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - - if (this.getUsername() == null){ - par1NBTTagCompound.setString("Username", ""); - } - else{ - par1NBTTagCompound.setString("Username", this.getUsername()); - } - par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - par1NBTTagCompound.setBoolean("Should Follow", shouldFollow ); - par1NBTTagCompound.setBoolean("Should Attack", shouldAttack ); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - String owner = par1NBTTagCompound.getString("Owner"); - if (owner.length() > 0){ - this.setOwner(owner); - this.setTamed(true); - } - - String username = par1NBTTagCompound.getString("Username"); - if (username.length() > 0){ - this.setUsername(username); - } - this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - shouldFollow = par1NBTTagCompound.getBoolean("Should Follow"); - shouldAttack = par1NBTTagCompound.getBoolean("Should Attack"); - } - - /** - * Validates if Itemstack can be used to Tame Entity - * Caution: ItemStack may be Null - */ - public boolean isValidTamingItem(ItemStack itemStack){ - return false; - } - - /** - * Validates if Itemstack can be used to Heal Entity - * Usually Considered valid if return > 0 - * Caution: ItemStack may be Null - * @return Heal amount - */ - public int getHealingValueIfValid(ItemStack itemStack){ - return 0; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onUpdate() { - super.onUpdate(); -// if(!worldObj.isRemote){ -// updateDWHealth(health); -// } -// health = getDWHealth(); - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if(isTamed()){ - /* TODO: Un Tame? */ - if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName())){ - if(var2 != null){ - if(var2.getItem() == Items.paper || var2.getItem() == Items.name_tag){ - par1EntityPlayer.openGui(ProjectZulu_Core.modInstance, 2, par1EntityPlayer.worldObj, getEntityId(), 0, 0); - return true; - }else if( getHealingValueIfValid(var2) > 0 && getHealth() < getMaxHealth() ){ - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - this.heal(getHealingValueIfValid(var2) ); - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - return true; - } - } - - /* Toggle Animal Action Sitting --> Follow -- > Attack(Not Implemented) -- > None --> Sitting etc..*/ - if (!isValidBreedingItem(var2)) { - if (this.worldObj.isRemote) { - return true; - } - if (getEntityState() == EntityStates.sitting) { - setSitting(false); - shouldFollow = true; - } else if (getEntityState() == EntityStates.following) { - shouldFollow = false; - shouldAttack = true; - setAngerLevel(3); - } else if (getEntityState() == EntityStates.attacking || getEntityState() == EntityStates.looking) { - shouldAttack = false; - } else if (getEntityState() == EntityStates.idle) { - setSitting(true); - this.isJumping = false; - } - return true; - } - } - }else if(var2 != null && isValidTamingItem(var2)) { - if (!par1EntityPlayer.capabilities.isCreativeMode){ - --var2.stackSize; - } - - if (var2.stackSize <= 0){ - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - if(!worldObj.isRemote){ - boolean tameEffectSuccess = false; - if(rand.nextInt(3) == 0){ - this.setTamed(true); - this.setAttackTarget((EntityLiving)null); - setSitting(true); - this.setHealth(getMaxHealth()); - this.setOwner(par1EntityPlayer.getCommandSenderName()); - setUsername(getDefaultEntityName()); - tameEffectSuccess = true; - } - /* Send Tame Effect Packet */ - ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(bytes); - /* Write PacketID into Packet */ - try { - data.writeInt(5); - } catch (Exception e) { - e.printStackTrace(); - } - - /* Write Temperature Into Packet */ - try { - data.writeInt(getEntityId()); - data.writeBoolean(tameEffectSuccess); - } catch (Exception e) { - e.printStackTrace(); - } - PZPacket packet = new PacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 10)); - } - return true; - } - - if(super.interact(par1EntityPlayer)){ - return true; - } - - return false; - } - - - public String getDefaultEntityName() { - return getCommandSenderName(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/a1da2ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/a1da2ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11793e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/a1da2ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBoarHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBoarHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 4F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/b08f2101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/b08f2101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d3aaef1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/b08f2101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.models.ModelHauntedArmor; -import projectzulu.common.mobs.renders.RenderHauntedArmor; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/c096d300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/c096d300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e5ed9d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/c096d300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,167 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.IRangedAttackMob; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Vec3; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityLizard extends EntityGenericAnimal implements IRangedAttackMob, IMob { - - public int counter = 0; - public boolean prepareToSpit = false; - public int timeTillSpit = 0; - - public EntityLizard(World par1World) { - super(par1World); - setSize(0.9f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(2, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - // tasks.addTask(2, new EntityAIArrowAttack(this, moveSpeed, 3, 60)); - - // tasks.addTask(3, new EntityAIMoveThroughVillage(this, moveSpeed, true)); - // tasks.addTask(4, new EntityAIMoveTwardsRestriction(this, moveSpeed)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Checks to make sure the light is not too bright where the mob is spawning - */ - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int var1 = xCoord; - int var2 = yCoord; - int var3 = zCoord; - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - - if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - return var4 <= this.rand.nextInt(8); - } - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && counter % (10 * 20) == 0) { - heal(1); - } - float var3 = this.getBrightness(1.0F); - if (var3 < 0.5) { - angerLevel = 120; - } - super.onLivingUpdate(); - - if (timeTillSpit == 20) { - prepareToSpit = true; - } - - // Check to see if Entity should Use Ability - if (timeTillSpit == 0) { - - // Check if there is a player nearby - // EntityPlayer tempTarget = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - EntityLivingBase tempTarget = this.getAttackTarget(); - - if (tempTarget != null && getDistanceToEntity(tempTarget) < 15) { - - double var11 = tempTarget.posX - this.posX; - double var13 = tempTarget.boundingBox.minY + tempTarget.height / 2.0F - - (this.posY + this.height / 2.0F); - double var15 = tempTarget.posZ - this.posZ; - - if (!worldObj.isRemote) { - EntityLizardSpit var17 = new EntityLizardSpit(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = this.posX + var20.xCoord * var18; - var17.posY = this.posY + this.height / 2.0F; - var17.posZ = this.posZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - timeTillSpit = 80; - prepareToSpit = false; - - } - - } else if (timeTillSpit == 0) { - timeTillSpit = 80; - prepareToSpit = false; - } - - counter++; - // Reduce Cooldown on Spit Ability - timeTillSpit = (int) Math.max(timeTillSpit - 1, 0.0); - - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "lizardhurt"; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 10), 1); - } - super.dropRareDrop(par1); - } - - @Override - public void attackEntityWithRangedAttack(EntityLivingBase entitylivingbase, float f) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/c0e4e5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/c0e4e5f8c42100141fce95f06aba7e85 deleted file mode 100644 index 740a891..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/c0e4e5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityCentipede; -import com.ngb.projectzulu.common.mobs.models.ModelCentipede; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d0927da2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d0927da2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 467ebf7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c1/d0927da2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/000898f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/000898f7c42100141fce95f06aba7e85 deleted file mode 100644 index 56d7b47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/000898f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockCoconut; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/00105ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/00105ce5c42100141fce95f06aba7e85 deleted file mode 100644 index 371792d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/00105ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,81 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBrownBear; -import projectzulu.common.mobs.models.ModelBrownBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/005697f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/005697f5c42100141fce95f06aba7e85 deleted file mode 100644 index dc1f800..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/005697f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,81 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBrownBear; -import com.ngb.projectzulu.common.mobs.models.ModelBrownBear; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/006ffbf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/006ffbf5c42100141fce95f06aba7e85 deleted file mode 100644 index cfc8111..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/006ffbf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,241 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Reminder: This is technically a 'Flying' Entity - */ -public class EntityFollower extends EntityLiving { - - EntityMaster masterEntity; - int followerIndex = -1; - - public int getFollowerIndex() { - return followerIndex; - } - - private Vec3 targetPosition = Vec3.createVectorHelper(0, 0, 0); - - public void setTargetPosition(Vec3 targetPosition) { - this.targetPosition = targetPosition; - } - - float targetRotation; - - public void setTargetRotation(float targetRotation) { - this.targetRotation = wrapAngleTo360(targetRotation); - } - - boolean shouldBeDying = false; - - /* Client Side Variable that Controls if it should Sync its Contents with Client Master */ - boolean isClientSetup = false; - - public EntityFollower(World par1World) { - super(par1World); - noClip = true; - setSize(0.65f, 0.5f); - } - - public EntityFollower(World par1World, double parx, double pary, double parz, EntityMaster masterEntity, - int followerIndex) { - this(par1World); - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.followerIndex = followerIndex; - } - - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns False so that Entity doesn't Suffocate while in a wall - */ - @Override - public boolean isEntityInsideOpaqueBlock() { - return false; - } - - @Override - public boolean canBePushed() { - return false; - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - - /* - * Note that the Client Side Entity will exists for several ticks before the masterEntity is Synced from server, - * So we only Check if should SetDead on Server - * - * Also, onReload, the Server will re-create its Children, this the old Children must dye. - */ - if (masterEntity == null && ticksExisted > 0) { - this.kill(); - } - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* If Master Head is dead, Entity should be dead */ - if (masterEntity != null && (masterEntity.isDead || masterEntity.deathTime > 0 || shouldBeDying)) { - onDeathUpdate(); - } - - /* - * Send Packet Server -> Client with EntityData to Connect Child+Master : Packet calls linkMasterWithFollower - * from Child - */ - if (ticksExisted % 40 == 0 && !worldObj.isRemote && masterEntity != null) { - PZPacket packet = new PacketFollowerMasterData().setPacketData(getEntityId(), masterEntity.getEntityId(), followerIndex); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 60)); - } - - moveToTargetPosition(0.5f); - adjustRotationToTarget(10.0f); - } - - /* Helper Method Responsible for Moving Follower to its Target Position */ - public void moveToTargetPosition(float velocity) { - moveEntity(targetPosition.xCoord - posX, targetPosition.yCoord - posY, targetPosition.zCoord - posZ); - } - - /* Helper Method Responsible for rotating Follower to its Target Rotation */ - public void adjustRotationToTarget(float angularVelocity) { - setRotation(targetRotation, rotationPitch); - rotationYawHead = rotationYaw; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (masterEntity != null) { - if (masterEntity.attackEntityFromChild(this, par1DamageSource, par2)) { - return true; - } - } - return false; - } - - public boolean hurtChildFromMaster(DamageSource par1DamageSource, float par2) { - return super.attackEntityFrom(par1DamageSource, par2); - } - - /* Gets Master Entity from World and sets it in the masterEntity container */ - public void linkMasterWithFollower(int masterEntityID, int followerIndex) { - - Entity master = worldObj.getEntityByID(masterEntityID); - if (master != null && master instanceof EntityMaster && isClientSetup == false) { - EntityMaster masterEntity = (EntityMaster) master; - this.followerIndex = followerIndex; - this.masterEntity = masterEntity; - targetPosition = Vec3.createVectorHelper(masterEntity.posX, masterEntity.posY, masterEntity.posZ); - masterEntity.linkFollowerWithMaster(this, followerIndex); - isClientSetup = true; - } - } - - @Override - protected void fall(float par1) { - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if (this.isInWater()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } else if (this.handleLavaMovement()) { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var4 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var4 != null) { - var3 = var4.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) { - var3 = 0.54600006F; - Block var5 = this.worldObj.getBlock(MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - - if (var5 != null) { - var3 = var5.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double) var3; - this.motionY *= (double) var3; - this.motionZ *= (double) var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; - } - - private float wrapAngleTo360(float angle) { - while (angle > 360) { - angle -= 360; - } - while (angle < 0) { - angle += 360; - } - return angle; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/112f9c9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/112f9c9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 38cb32d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/112f9c9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,230 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockCocoa; -import net.minecraft.entity.EntityLiving; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Direction; -import net.minecraft.util.MathHelper; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCoconut extends BlockCocoa { - - public BlockCoconut() { - super(); - setHardness(0.2F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } else if (par1World.rand.nextInt(5) == 0) { - int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); - - if (var7 < 2) { - ++var7; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 3); - } - } - } - - /** - * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. - */ - @Override - public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); - par2 += Direction.offsetX[var5]; - par4 += Direction.offsetZ[var5]; - Block var6 = par1World.getBlock(par2, par3, par4); - Block var7 = par1World.getBlock(par2, par3 + 1, par4); - return (BlockList.palmTreeLog.isPresent() && var6 == BlockList.palmTreeLog.get() && var7 != BlockList.palmTreeLog - .get()); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 28; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Returns the bounding box of the wired rectangular prism to render. - */ - public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = var8 / 2.0F; - - switch (var6) { - case 0: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, (15.0F - var8) / 16.0F, - (8.0F + var10) / 16.0F, 0.75F, 0.9375F); - break; - case 1: - this.setBlockBounds(0.0625F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + var8) / 16.0F, 0.75F, - (8.0F + var10) / 16.0F); - break; - case 2: - this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, - (1.0F + var8) / 16.0F); - break; - case 3: - this.setBlockBounds((15.0F - var8) / 16.0F, (12.0F - var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, - (8.0F + var10) / 16.0F); - } - } - - /** - * Called when the block is placed in the world. - */ - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) { - int var6 = ((MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) + 0) % 4; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - // /** - // * called before onBlockPlacedBy by ItemBlock and ItemReed - // */ - // @Override - // public void updateBlockMetadata(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - // float par8) - // { - // if (par5 == 1 || par5 == 0) - // { - // par5 = 2; - // } - // - // int var9 = Direction.footInvisibleFaceRemap[Direction.vineGrowth[par5]]; - // par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 3); - // } - - /** - * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are - * their own) Args: x, y, z, neighbor blockID - */ - @Override - public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) { - if (!this.canBlockStay(par1World, par2, par3, par4)) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public static int func_72219_c(int par0) { - return (par0 & 12) >> 2; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - if (!par1World.isRemote) { - ArrayList items = getDrops(par1World, par2, par3, par4, par5, par7); - - for (ItemStack item : items) { - if (par1World.rand.nextFloat() <= par6) { - this.dropBlockAsItem(par1World, par2, par3, par4, item); - } - } - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata >= 8) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } else { - if (ItemList.coconutSeed.isPresent()) { - ret.add(new ItemStack(ItemList.coconutSeed.get())); - } - return ret; - } - } - - @Override - @SideOnly(Side.CLIENT) - /** - * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) - */ - public ItemStack getPickBlock(MovingObjectPosition target, World par1World, int par2, int par3, int par4) { - return ItemList.coconutSeed.isPresent() ? new ItemStack(ItemList.coconutSeed.get()) : null; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Get the block's damage value (for use with pick block). - */ - public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/2023ccfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/2023ccfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 61659bd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/2023ccfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/203559f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/203559f8c42100141fce95f06aba7e85 deleted file mode 100644 index 1c35aac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/203559f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/21ecf0f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/21ecf0f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0770343..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/21ecf0f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,419 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/306e3101c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/306e3101c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9ad5b1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/306e3101c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMammoth; -import projectzulu.common.mobs.models.ModelMammoth; -import projectzulu.common.mobs.renders.RenderMammoth; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MammothDeclaration extends SpawnableDeclaration { - - public MammothDeclaration() { - super("Mammoth", 8, EntityMammoth.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (20 << 16) + (12 << 8) + 0; - eggColor2 = (69 << 16) + (42 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMammoth(new ModelMammoth(), 0.5f); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Tundra"); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/504041f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/504041f8c42100141fce95f06aba7e85 deleted file mode 100644 index f7205b8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/504041f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class Properties { - public static boolean replaceFlowerPot = true; - public static boolean despawnInPeaceful = true; - public static float namePlateScale = 0.016666668F * 1.6f * 0.5f; - public static float namePlateOpacity = 0.85F; - - public static void loadFromConfig(File modConfigDirectoryFile) { - Configuration config = new Configuration(new File(modConfigDirectoryFile, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - replaceFlowerPot = config.get("General Controls", "Replace Default Flower Pot", replaceFlowerPot).getBoolean( - replaceFlowerPot); - despawnInPeaceful = config.get("MOB CONTROLS", "despawnInPeaceful", despawnInPeaceful).getBoolean( - despawnInPeaceful); - - namePlateScale = (float) config.get("MOB CONTROLS", "namePlateScale", namePlateScale).getDouble(namePlateScale); - namePlateOpacity = (float) config.get("MOB CONTROLS", "namePlateOpacity", namePlateOpacity).getDouble( - namePlateScale); - config.save(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50478900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50478900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0a6482b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/50478900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,321 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/507809e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/507809e4c42100141fce95f06aba7e85 deleted file mode 100644 index 7b09e4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/507809e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EntityCreeperBlossomPrimed extends Entity { - /** How long the fuse is */ - public int fuse; - - public EntityCreeperBlossomPrimed(World par1World) { - super(par1World); - this.fuse = 40; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; - } - - public EntityCreeperBlossomPrimed(World par1World, double par2, double par4, double par6) { - this(par1World); - this.setPosition(par2, par4, par6); - float var8 = (float) (Math.random() * Math.PI * 2.0D); - this.motionX = (double) (-((float) Math.sin((double) var8)) * 0.02F); - this.motionY = 0.20000000298023224D; - this.motionZ = (double) (-((float) Math.cos((double) var8)) * 0.02F); - this.fuse = 40; - this.prevPosX = par2; - this.prevPosY = par4; - this.prevPosZ = par6; - } - - @Override - protected void entityInit() { - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() { - return !this.isDead; - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.9800000190734863D; - this.motionY *= 0.9800000190734863D; - this.motionZ *= 0.9800000190734863D; - - if (this.onGround) { - this.motionX *= 0.699999988079071D; - this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - - if (this.fuse-- <= 0) { - this.setDead(); - - if (!this.worldObj.isRemote) { - this.explode(); - } - } else { - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - } - } - - private void explode() { - float var1 = 1.5F; - this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, var1, this.worldObj - .getGameRules().getGameRuleBooleanValue("mobGriefing")); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setByte("Fuse", (byte) this.fuse); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - this.fuse = par1NBTTagCompound.getByte("Fuse"); - } - - @SideOnly(Side.CLIENT) - @Override - public float getShadowSize() { - return 0.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/5140b6a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/5140b6a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e90310d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/5140b6a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,120 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/811ef8f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/811ef8f6c42100141fce95f06aba7e85 deleted file mode 100644 index c15c8b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/811ef8f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemCoconutItem extends Item { - - public ItemCoconutItem(boolean full3D, String name) { - super(); - maxStackSize = 1; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/813f91e7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/813f91e7c42100141fce95f06aba7e85 deleted file mode 100644 index 72744b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/813f91e7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData().toString() - //.func_150283_g(nodeList.get(clickedIndex).getData().getId()) - , nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/82870cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/82870cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a7b92c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/82870cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,60 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/9009ebe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/9009ebe5c42100141fce95f06aba7e85 deleted file mode 100644 index d736953..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/9009ebe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/904a8ff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/904a8ff6c42100141fce95f06aba7e85 deleted file mode 100644 index c37bc1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/904a8ff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -public class PacketStreamSound extends PacketByteStream { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c021f8df642300141cbf9363b5b13b15 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c021f8df642300141cbf9363b5b13b15 deleted file mode 100644 index a44d36a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/c021f8df642300141cbf9363b5b13b15 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration(), new YellowFinchDeclaration(),); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d0b16ce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d0b16ce5c42100141fce95f06aba7e85 deleted file mode 100644 index 5b36d87..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d0b16ce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBeige; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d1f210f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d1f210f6c42100141fce95f06aba7e85 deleted file mode 100644 index 58d32cb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/d1f210f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,570 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - //int var4 = this.worldObj.getEntitiesWithinAABB( - // var13.getClass(), - // AxisAlignedBB - // .getAABBPool() - // .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - // zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - // yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - // .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - // spawnRangeHorizontal * 2)).size(); - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getBoundingBox(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/e1e1a6a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/e1e1a6a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4038f7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/e1e1a6a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCrocodile; -import projectzulu.common.mobs.models.ModelCrocodile; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0b6e0fc622300141086b96048d117bc b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0b6e0fc622300141086b96048d117bc deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f0b6e0fc622300141086b96048d117bc +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f1595ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f1595ee5c42100141fce95f06aba7e85 deleted file mode 100644 index 836549e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c2/f1595ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlueFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlueFinchDeclaration extends SpawnableDeclaration { - - public BlueFinchDeclaration() { - super("Blue Finch", 24, EntityBlueFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (38 << 16) + (103 << 8) + 255; - eggColor2 = (224 << 16) + (233 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_blue.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/009f59e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/009f59e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4a9f4fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/009f59e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityArmadillo; -import projectzulu.common.mobs.models.ModelArmadillo; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ArmadilloDeclaration extends SpawnableDeclaration { - - public ArmadilloDeclaration() { - super("Armadillo", 0, EntityArmadillo.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 2, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (116 << 16) + (64 << 8) + 33; - eggColor2 = (60 << 16) + (51 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(12f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelArmadillo(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "armadillo.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/211256f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/211256f6c42100141fce95f06aba7e85 deleted file mode 100644 index 08dd4d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/211256f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import com.ngb.projectzulu.common.dungeon.BlockLimitedMobSpawner; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/221db501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/221db501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 59b8523..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/221db501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,240 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/50c83de7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/50c83de7c42100141fce95f06aba7e85 deleted file mode 100644 index b50e429..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/50c83de7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.projectzulu.common; - -import projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/5236179fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/5236179fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2c00dc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/5236179fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.models.ModelHauntedArmor; -import projectzulu.common.mobs.renders.RenderHauntedArmor; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HauntedArmorDeclaration extends EggableDeclaration { - - public HauntedArmorDeclaration() { - super("Haunted Armor", 39, EntityHauntedArmor.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (194 << 16) + (194 << 8) + 194; - eggColor2 = (251 << 16) + (246 << 8) + 36; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 4.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderHauntedArmor(new ModelHauntedArmor(), 0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/60f1ab9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/60f1ab9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0c3ad1f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/60f1ab9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashMap; - -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * For Optional Settings methods return style is to return true when evaluation should continue unobstructed, false to - * obstruct, null to use default check. - * - * i.e: If entity is Despawning, and is checking isValidLight: true means continue despawning, false means stop, null - * means no opinion use default check - * - */ -public abstract class OptionalSettings { - - boolean isEnabled = false; - boolean isInverted = false; - public final String parseableString; - protected boolean stringParsed = false; - protected EnumSet validKeys; - - /** - * Operand of the Parent Tag this OptionalSettings represents. Note not all OptionalSettings utilize this. - */ - protected Operand operand = Operand.OR; - - public enum Operand { - AND, OR; - } - - /** Value Stored for a Parsed chainable Keys */ - protected ArrayList parsedChainable = new ArrayList(); - - /** - * Operand value for a Particular Parsed Key - * - * i.e. Is This Property supposed to be & or | with the previous parsed key - */ - protected ArrayList operandvalue = new ArrayList(); - - protected void addParsedChainable(TypeValuePair typeValue, Operand operand) { - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - } - } - - /* Internal Cache to Store Parsed Values */ - protected HashMap valueCache = new HashMap(); - - public OptionalSettings(String parseableString) { - this.parseableString = parseableString; - validKeys = EnumSet.noneOf(Key.class); - } - - public OptionalSettings(String parseableString, EnumSet validKeys) { - this.parseableString = parseableString; - this.validKeys = validKeys; - } - - protected abstract void parseString(); - - public abstract boolean isOptionalEnabled(); - - public abstract boolean isInverted(); - - public Operand getOperand() { - return operand; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/610fa3f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/610fa3f8c42100141fce95f06aba7e85 deleted file mode 100644 index 0903441..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/610fa3f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummyPharaoh extends ModelBiped { - - /** - * Sets the models various rotation angles. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/614ee19dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/614ee19dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 117cbe3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/614ee19dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/80323aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/80323aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 80f72f2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/80323aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,93 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelVultureHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer HEADROT; - - - public ModelVultureHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("NECKROT1.neck1", 8, 10); - setTextureOffset("NECKROT2.neck2", 8, 10); - setTextureOffset("NECKROT3.neck3", 8, 10); - setTextureOffset("HEADROT.mouthbot", 0, 25); - setTextureOffset("HEADROT.mouthtal", 6, 25); - setTextureOffset("HEADROT.mouthtop", 0, 21); - setTextureOffset("HEADROT.head", 0, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F, 24.5F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, 0F, 1F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -0.5F, -2F, -0.5F, 1, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("mouthbot", -0.5F, 0.5F, -4F, 1, 1, 2); - HEADROT.addBox("mouthtal", -1F, 0.5F, -5F, 2, 2, 1); - HEADROT.addBox("mouthtop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - NECKROT3.addChild(HEADROT); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - BODYROT.addChild(NECKROT1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); - break; - - default: - NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/a085baffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/a085baffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2442ef..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/a085baffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutItem; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b054c29dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b054c29dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11793e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b054c29dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBoarHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBoarHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 4F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b09f4801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b09f4801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0236ac1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b09f4801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b0fe5ffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b0fe5ffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index bb6b436..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b0fe5ffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b17e20a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b17e20a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0619536..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/b17e20a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class SlotBrewingStandSingleIngredient extends Slot { - /** The brewing stand this slot belongs to. */ - final ContainerBrewingStandSingle brewingStand; - - public SlotBrewingStandSingleIngredient(ContainerBrewingStandSingle par1ContainerBrewingStand, - IInventory par2IInventory, int par3, int par4, int par5) { - super(par2IInventory, par3, par4, par5); - this.brewingStand = par1ContainerBrewingStand; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - if (par1ItemStack == null) { - return false; - } - - return PotionIngredients.isPotionIngredient(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 64; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f129759ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f129759ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9dff344..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c3/f129759ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/109315ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/109315ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c743c31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/109315ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public interface Module { - public abstract String getIdentifier(); - - public abstract void registration(ItemBlockManager manager); - - public abstract void registration(CustomEntityManager manager); - - public abstract void registration(FeatureGenerator manager); - - public abstract void preInit(FMLPreInitializationEvent event, File configDirectory); - - public abstract void init(FMLInitializationEvent event, File configDirectory); - - public abstract void postInit(FMLPostInitializationEvent event, File configDirectory); - - public abstract void serverStarting(FMLServerStartingEvent event, File configDirectory); - - public abstract void serverStart(FMLServerStartedEvent event, File configDirectory); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/2090ab7c0c2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/2090ab7c0c2100141769cb1ed0c338cd deleted file mode 100644 index 83045b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/2090ab7c0c2100141769cb1ed0c338cd +++ /dev/null @@ -1,361 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - - //vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/30d7e7ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/30d7e7ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e482bb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/30d7e7ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/310952f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/310952f8c42100141fce95f06aba7e85 deleted file mode 100644 index 46e4935..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/310952f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40c44400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40c44400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a1cb94d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/40c44400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,144 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/504ae0f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/504ae0f9c42100141fce95f06aba7e85 deleted file mode 100644 index a79120a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/504ae0f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b1e3bf9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b1e3bf9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 37275a0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/b1e3bf9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBirdHead extends ModelBase{ - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - private ModelRenderer BODY; - private ModelRenderer WINGLEFROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer TAILROT; - - public ModelBirdHead(){ - textureWidth = 32; - textureHeight = 32; - setTextureOffset("BODY.Body", 0, 0); - setTextureOffset("WINGLEFROT.winglef", 22, 0); - setTextureOffset("WINGRIGROT.wingrig", 13, 0); - setTextureOffset("TAILROT.tail", 14, 8); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - - BODY = new ModelRenderer(this, "BODY"); - BODY.setRotationPoint(0F, 21F, 0F); - setRotation(BODY, 0F, 0F, 0F); - BODY.mirror = true; - BODY.addBox("Body", -1F, -1F, -2F, 2, 2, 4); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-1F, -0.7F, 0F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGLEFROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(1F, -0.7F, 0F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGRIGROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -0.2F, 1F); - setRotation(TAILROT, 0.3346145F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.4666667F, 0F, 0F, 1, 0, 3); - BODY.addChild(TAILROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1.2F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - BODY.addChild(HEADROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 1.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 0); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODY.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 1.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 0); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODY.addChild(LEGRIGTOPROT); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - // super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - // float field_78145_g = 8.0F; - // float field_78151_h = 4.0F; - // - // if (this.isChild){ - // float var8 = 2.0F; - // GL11.glPushMatrix(); - // GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - // GL11.glPopMatrix(); - // GL11.glPushMatrix(); - // GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - // GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - // Body.render(f5); - // Body.render(f5); - // wingrig.render(f5); - // winglef.render(f5); - // tail.render(f5); - // LEGRIGTOPROT.render(f5); - // LEGLEFTOPROT.render(f5); - // GL11.glPopMatrix(); - // }else{ -// Body.render(f5); -// wingrig.render(f5); -// winglef.render(f5); -// tail.render(f5); -// LEGRIGTOPROT.render(f5); -// LEGLEFTOPROT.render(f5); -// HEADROT.render(f5); - BODY.render(f5); - // } - // - } - - public void renderHead(float f5){ - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODY.rotateAngleY = f3 / (180F / (float)Math.PI); - -// Body.rotateAngleY = f3 / (180F / (float)Math.PI); -// wingrig.rotateAngleY = f3 / (180F / (float)Math.PI); -// winglef.rotateAngleY = f3 / (180F / (float)Math.PI); -// tail.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGRIGTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGLEFTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c0f6d7e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c0f6d7e5c42100141fce95f06aba7e85 deleted file mode 100644 index b7f31f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c0f6d7e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,52 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHeal2 extends PotionZulu { - - public PotionHeal2(int par1, boolean par2) { - super(par1, par2, 16262179); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - par1EntityLiving.heal(amplifier * 3); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c2ee13f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c2ee13f8c42100141fce95f06aba7e85 deleted file mode 100644 index c876caa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/c2ee13f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericUncarved implements BlueprintSet { - - Blueprint blueprint; - - public BPSetGenericUncarved(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d04245f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d04245f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5888ffe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/d04245f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/e17fe1fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/e17fe1fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f12e58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/e17fe1fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/f2a996ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/f2a996ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 79cf867..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c4/f2a996ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/001ea5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/001ea5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 03bb0cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/001ea5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseGrey extends EntityHorseBase { - - public EntityHorseGrey(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/00ad2aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/00ad2aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ebac1d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/00ad2aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/00eafaffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/00eafaffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1b0428..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/00eafaffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiContainerUniversalFlowerPot extends GuiContainer { - public final static ResourceLocation FLOWERPOT_GUI = new ResourceLocation(DefaultProps.coreKey, - "gui/FlowerPotGUI.png"); - - public GuiContainerUniversalFlowerPot(InventoryPlayer inventoryPlayer, TileEntityUniversalFlowerPot tileEntity) { - super(new ContainerUniversalFlowerPot(inventoryPlayer, tileEntity)); - } - - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - fontRendererObj.drawString("Flower Pot", 8, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.bindTexture(FLOWERPOT_GUI); - int x = (width - xSize) / 2; - int y = (height - ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/20ba2c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/20ba2c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2795ab9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/20ba2c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; -import projectzulu.common.mobs.renders.RenderMummyPharaoh; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/317a589ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/317a589ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f380de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/317a589ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.core; -/** - * Usage: - * Pair pair = Pair.createPair(1, "test"); - * pair.getElement0(); - * pair.getElement1(); - * @param - * @param - */ -public class Pair { - - private final K element0; - private final V element1; - - public static Pair createPair(K element0, V element1) { - return new Pair(element0, element1); - } - - public Pair(K element0, V element1) { - this.element0 = element0; - this.element1 = element1; - } - - public K getElement0() { - return element0; - } - - public V getElement1() { - return element1; - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40c8ea00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40c8ea00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 655c27d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40c8ea00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40fbbaa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40fbbaa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8552024..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/40fbbaa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/50d44aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/50d44aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fdcde8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/50d44aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/61373dfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/61373dfac42100141fce95f06aba7e85 deleted file mode 100644 index fe41ac5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/61373dfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,39 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a1b724f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a1b724f8c42100141fce95f06aba7e85 deleted file mode 100644 index 8925e3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/a1b724f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCarved; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericEdge; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericLimited; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/c023aff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/c023aff5c42100141fce95f06aba7e85 deleted file mode 100644 index d871141..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/c023aff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityGenericCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityGenericCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, - //this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - Vec3.createVectorHelper((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/d04eb3fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/d04eb3fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 75ca5c1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/d04eb3fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/f042d99ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/f042d99ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bc46923..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c5/f042d99ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/10f29dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/10f29dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f36c4bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/10f29dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/201256f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/201256f6c42100141fce95f06aba7e85 deleted file mode 100644 index 8168abf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/201256f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,5 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -public enum ListType { - NONE, Creature, Sound; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/3075c19ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/3075c19ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b7e48a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/3075c19ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/30c82201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/30c82201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c1947ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/30c82201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.models.ModelHornBill; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HornbillDeclaration extends SpawnableDeclaration { - - public HornbillDeclaration() { - super("Horn Bill", 36, EntityHornBill.class, EnumCreatureType.ambient); - setSpawnProperties(10, 25, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (26 << 16) + (19 << 8) + 15; - eggColor2 = (199 << 16) + (33 << 8) + 14; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/60443ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/60443ef6c42100141fce95f06aba7e85 deleted file mode 100644 index a87969e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/60443ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/60c4d4ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/60c4d4ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 45bcf4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/60c4d4ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemScale; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/70a29df6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/70a29df6c42100141fce95f06aba7e85 deleted file mode 100644 index 543f6e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/70a29df6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.potion.brewingstands.PotionIngredients.IngredientProperty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemGenerics extends Item implements IngredientProperty { - - public enum Properties { - /* Generic Items */ - PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - - /* Potion Effect Ingredients */ - BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( - "Antennae", 23, true), ShinyBauble("Shiny Bauble", 24, true), Talon("Talon", 25, true), Bark("Bark", - 27, true), SmallHeart("Small Heart", 28, true), LargeHeart("Large Heart", 29, true), Gill("Gill", 30, - true), Ectoplasm("Ectoplasm", 31), FrogLegs("Frog Legs", 32, true), RabbitsFoot("Rabbits Feet", 33, - true), PricklyPowder("Prickly Powder", 34, true), PowderSlush("Powder Slush", 35, true), GlowingGoo( - "Glowing Goo", 36, true), SmallUnhealthyHeart("Small Unhealthy Heart", 37, true), LargeUnhealthyHeart( - "Large Unhealthy Heart", 38, true); - - public final String displayName; - public final boolean isIngredient; - public final int meta; - - public int meta() { - return meta; - } - - @SideOnly(Side.CLIENT) - private IIcon icon; - - Properties(String name, int meta, boolean isIngredient) { - this.displayName = name; - this.meta = meta; - this.isIngredient = isIngredient; - } - - Properties(String name, int iconIndex) { - this(name, iconIndex, false); - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Properties getPropertyByMeta(int meta) { - for (Properties property : Properties.values()) { - if (property.meta == meta) { - return property; - } - } - return null; - } - } - - public ItemGenerics() { - super(); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Properties.getPropertyByMeta(par1).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - for (Properties type : Properties.values()) { - type.setIcon(par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + type.toString().toLowerCase())); - } - } - - @Override - public boolean isIngredient(ItemStack ingredient) { - Properties.getPropertyByMeta(ingredient.getItemDamage()); - return true; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - for (final Properties property : Properties.values()) { - if (property.meta == itemStack.getItemDamage()) { - return "item.".concat(property.displayName.toLowerCase().replaceAll("\\s", "")); - } - } - return ""; - } - - @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (final Properties property : Properties.values()) { - par3List.add(new ItemStack(item, 1, property.meta)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/810f33f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/810f33f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2bdd096..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/810f33f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityMobSpawner; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class MobSpawnerWithMeta extends BlockWithMeta { - - String mobName; - - public MobSpawnerWithMeta(String mobName) { - super(Blocks.mob_spawner); - this.mobName = mobName; - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - /* Create Mob Spawner */ - world.setBlock(position.posX, position.posY, position.posZ, block); - TileEntityMobSpawner tileEntityMobSpawner = (TileEntityMobSpawner) world.getTileEntity(position.posX, - position.posY, position.posZ); - - if (tileEntityMobSpawner != null) { - tileEntityMobSpawner.func_145881_a().setEntityName(mobName); - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/81a6f4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/81a6f4e5c42100141fce95f06aba7e85 deleted file mode 100644 index 0abb40e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/81a6f4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/9059c5f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/9059c5f7c42100141fce95f06aba7e85 deleted file mode 100644 index 89fcf33..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/9059c5f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/916189e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/916189e5c42100141fce95f06aba7e85 deleted file mode 100644 index d65e15b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/916189e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,132 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBoar extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEGROT1; - private ModelRenderer LEGROT2; - private ModelRenderer LEGROT3; - private ModelRenderer LEGROT4; - - public ModelBoar() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - setTextureOffset("BODYROT.body", 12, 8); - setTextureOffset("LEGROT1.leg1", 0, 13); - setTextureOffset("LEGROT2.leg2", 0, 13); - setTextureOffset("LEGROT3.leg3", 0, 13); - setTextureOffset("LEGROT4.leg4", 0, 13); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 14F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 14.5F, -4F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -4.5F, 0F, 10, 8, 16); - LEGROT1 = new ModelRenderer(this, "LEGROT1"); - LEGROT1.setRotationPoint(-3F, 3.5F, 14F); - setRotation(LEGROT1, 0F, 0F, 0F); - LEGROT1.mirror = true; - LEGROT1.addBox("leg1", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT1); - LEGROT2 = new ModelRenderer(this, "LEGROT2"); - LEGROT2.setRotationPoint(3F, 3.5F, 14F); - setRotation(LEGROT2, 0F, 0F, 0F); - LEGROT2.mirror = true; - LEGROT2.addBox("leg2", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT2); - LEGROT3 = new ModelRenderer(this, "LEGROT3"); - LEGROT3.setRotationPoint(-3F, 3.5F, 2F); - setRotation(LEGROT3, 0F, 0F, 0F); - LEGROT3.mirror = true; - LEGROT3.addBox("leg3", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT3); - LEGROT4 = new ModelRenderer(this, "LEGROT4"); - LEGROT4.setRotationPoint(3F, 3.5F, 2F); - setRotation(LEGROT4, 0F, 0F, 0F); - LEGROT4.mirror = true; - LEGROT4.addBox("leg4", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT4); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_x = 0.0f; - float field_78145_g = 2.2F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGROT1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/91d4f5f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/91d4f5f6c42100141fce95f06aba7e85 deleted file mode 100644 index 6b1bac4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/91d4f5f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/a050c59fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/a050c59fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6c2dd42..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/a050c59fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericDeadEnd; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintDeadEndChest; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthCobweb; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthHiddenWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthRandomWall; -import projectzulu.common.world2.blueprint.BlueprintLabyrinthStair; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectLabyrinth extends ArchitectBase { - - BlueprintSet stair = new BPSetGenericCarved(new BlueprintLabyrinthStair()); - BlueprintSet room = new BPSetGenericUncarved(new BlueprintLabyrinthCobweb()); - BlueprintSet wall = new BPSetGenericCarved(new BlueprintLabyrinthRandomWall()); - - public ArchitectLabyrinth(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericDeadEnd(new BlueprintDeadEndChest(), 0, 1)); - stockpile.addBlueprintSet(room); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintLabyrinthHiddenWall())); - stockpile.addBlueprintSet(wall); - stockpile.addBlueprintSet(stair); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - /* Entrance is Manually place entrance at X == length / 2 and is cells long along z axis */ - if (buildCoords.x == cells.length / 2 && buildCoords.y <= 3) { - set = room; - } else if (isEdge(cells, buildCoords)) { - set = wall; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - stair.assignCellsWithBlueprints(cells, buildCoords, random); - } - - private boolean isEdge(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/b095c09fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/b095c09fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a973faf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/b095c09fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c03c889ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c03c889ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7adaaf1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c03c889ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c094b1f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c094b1f5c42100141fce95f06aba7e85 deleted file mode 100644 index ba5b523..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c094b1f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - /** The PathNavigate of our entity. */ - EntityLivingBase entityPathNavigate; - int fleeChance = 0; - /** Task Owner in the form of out Generic Creature, used to access Specialized information, such as Anger or EntityState */ - EntityGenericCreature genericTaskOwner; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityLiving, boolean shouldCallAllies, boolean shouldCheckSight) { - super(par1EntityLiving, 16.0F, shouldCheckSight); - this.shouldCallAllies = shouldCallAllies; - this.setMutexBits(1); - this.genericTaskOwner = par1EntityLiving; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.isSuitableTarget(this.taskOwner.getAITarget(), false); - - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return shouldExecute(); -// return this.taskOwner.getAITarget() != null && this.taskOwner.getAITarget() != this.entityPathNavigate; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.entityPathNavigate = this.taskOwner.getAITarget(); - - if (this.shouldCallAllies){ - //List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), - // AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), - AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - - Iterator var2 = var1.iterator(); - - while (var2.hasNext()){ - EntityLiving var3 = (EntityLiving)var2.next(); - - if (this.taskOwner != var3 && var3.getAttackTarget() == null){ - var3.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - super.startExecuting(); - } - - @Override - public void updateTask() { - startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c1b71200c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c1b71200c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2482ca1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/c1b71200c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.core.itemblockdeclaration.ItemBlockDeclaration; -import cpw.mods.fml.common.FMLCommonHandler; - -public enum ItemBlockManager { - INSTANCE; - private ArrayList itemBlocks = new ArrayList(); - - public void addItemBlock(ItemBlockDeclaration... itemBlock) { - for (ItemBlockDeclaration declaration : itemBlock) { - itemBlocks.add(declaration); - } - } - - public void createBlocks(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - createFromConfig(config, true); - createFromConfig(config, false); - config.save(); - } - - private void createFromConfig(Configuration config, boolean readOnly) { - int currentRenderPass = 0; - boolean hasNextPass; - do { - hasNextPass = false; - for (ItemBlockDeclaration itemBlock : itemBlocks) { - if (currentRenderPass == itemBlock.getRegisterPass()) { - itemBlock.createWithConfig(config, readOnly); - } else if (currentRenderPass < itemBlock.getRegisterPass()) { - hasNextPass = true; - } - } - currentRenderPass++; - } while (hasNextPass); - } - - public void registerBlocks() { - for (ItemBlockDeclaration itemBlock : itemBlocks) { - itemBlock.register(FMLCommonHandler.instance().getEffectiveSide()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e08cd7f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e08cd7f8c42100141fce95f06aba7e85 deleted file mode 100644 index fa65857..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c6/e08cd7f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseBrown; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/01fe6d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/01fe6d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7717a0a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/01fe6d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,345 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/20ecf0f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/20ecf0f9c42100141fce95f06aba7e85 deleted file mode 100644 index 18ed9e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/20ecf0f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCampFire extends ItemBlock { - - public ItemCampFire(Block block) { - super(block); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Block.getBlockFromItem(this).getIcon(2, par1); - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return "tile." - + BlockCampfire.Type.getTypeByMeta(itemstack.getItemDamage()).displayName().toLowerCase() - .replaceAll("\\s", ""); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/2123ccfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/2123ccfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index bac9d84..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/2123ccfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/213559f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/213559f8c42100141fce95f06aba7e85 deleted file mode 100644 index c7def6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/213559f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/222b2f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/222b2f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 175f5ce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/222b2f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.models.ModelSandWorm; -import projectzulu.common.mobs.renders.RenderGenericIdle; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class SandwormDeclaration extends SpawnableDeclaration { - - public SandwormDeclaration() { - super("SandWorm", 1, EntitySandWorm.class, EnumCreatureType.monster); - setSpawnProperties(1, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (24 << 16) + (0 << 8) + 8; - eggColor2 = (49 << 16) + (16 << 8) + 8; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - CustomEntityList.SANDWORM.modData = Optional.of(customMobData); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericIdle(new ModelSandWorm(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "sandworm.png"), new ResourceLocation(DefaultProps.mobKey, "sandworm_hidden.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/305ce8f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/305ce8f5c42100141fce95f06aba7e85 deleted file mode 100644 index 4e49e6f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/305ce8f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityHornBill extends EntityGenericAnimal { - - public EntityHornBill(World par1World) { - super(par1World); - setSize(0.8f, 1.2f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, (float) moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "hornbillhurt"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/30f1ad01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/30f1ad01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8bae7af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/30f1ad01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/41d6d8e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/41d6d8e4c42100141fce95f06aba7e85 deleted file mode 100644 index b78e77b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/41d6d8e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawn extends KeyParserBase { - - public KeyParserDespawn(Key key) { - super(key, true, KeyType.PARENT); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/425d879fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/425d879fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8bfec01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/425d879fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.potion; - -/** - * Helper Classes to Parse Generic Potion properties form damage. - * - * Note the only damage values Guaranteed to work for any given SubItemPotion is subID and Splash. Any other bits are up - * to individual subItem to parse and may not conform to standard. - */ -public class PotionParser { - - public static int readID(int value) { - byte lowByte = (byte) (value & getLeastBitMask(4)); - return lowByte & 0xFF; - } - - public static int setID(int iD, int value) { - if (iD < 0 || iD > 15) { - iD = iD < 0 ? 0 : 15; - } - return setBitRange(value, iD, 0, 4); - } - - public static int readLevel(int value) { - byte lowByte = (byte) ((value >> 4) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setLevel(int level, int value) { - if (level < 0 || level > 3) { - level = level < 0 ? 0 : 3; - } - return setBitRange(value, level, 4, 2); - } - - public static int readPower(int value) { - byte lowByte = (byte) ((value >> 6) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setPower(int power, int value) { - if (power < 0 || power > 3) { - power = power < 0 ? 0 : 3; - } - return setBitRange(value, power, 6, 2); - } - - public static int readDuration(int value) { - byte lowByte = (byte) ((value >> 8) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setDuration(int duration, int value) { - if (duration < 0 || duration > 3) { - duration = duration < 0 ? 0 : 3; - } - return setBitRange(value, duration, 8, 2); - } - - public static int readContainer(int value) { - byte lowByte = (byte) ((value >> 10) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setContainer(int container, int value) { - if (container < 0 || container > 3) { - container = container < 0 ? 0 : 3; - } - return setBitRange(value, container, 10, 2); - } - - public static boolean isSplash(int value) { - return isBitSet(value, 14); - } - - public static int setSplash(int value) { - return setBit(value, 14); - } - - /** - * Sets Range of Bits in origValue to bits in ValueToSet starting from staringBitToSet for bitsToSet number of bits - * - * @param origValue - * @param valueToSet - * @param startingBitToSet - * @param bitsToSet - * @return - */ - private static int setBitRange(int origValue, int valueToSet, int startingBitToSet, int bitsToSet) { - for (int i = 0; i < bitsToSet; i++) { - if (isBitSet(origValue, startingBitToSet + i) == !isBitSet(valueToSet, i)) { - origValue = flipBit(origValue, startingBitToSet + i); - } - } - return origValue; - } - - private static boolean isBitSet(int value, int index) { - return (value & (1L << index)) != 0; - } - - private static int setBit(int value, int index) { - return value | (1 << index); - } - - private static int unSetBit(int value, int index) { - return value & ~(1 << index); - } - - private static int flipBit(int value, int index) { - return value ^ (1 << index); - } - - /** - * Returns a Mask to be & with a value to get the specified number of least significant bits - * - * @param value - * @param numBits Number of Least Significant bits desired - * @return - */ - private static int getLeastBitMask(int numBits) { - return ((1 << numBits) - 1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/512486fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/512486fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8d35844..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/512486fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,232 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70c4cdf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70c4cdf4c42100141fce95f06aba7e85 deleted file mode 100644 index 32e05cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/70c4cdf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSlowdown extends SubItemPotionGeneric { - - public SubItemPotionMoveSlowdown(Item itemID, int subID) { - super(itemID, subID, "potion.moveSlowdown"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/8141fbf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/8141fbf8c42100141fce95f06aba7e85 deleted file mode 100644 index 98a6f7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/8141fbf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsTarget extends EntityAIBase { - private EntityCreature theEntity; - private EntityLivingBase targetEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float field_75425_f; - private float field_75426_g; - - public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, float par2, float par3) { - this.theEntity = par1EntityCreature; - this.field_75425_f = par2; - this.field_75426_g = par3; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); - - if (this.targetEntity == null) { - return false; - } - else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.field_75426_g * this.field_75426_g)) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) this.targetEntity.posX, (double) this.targetEntity.posY, (double) this.targetEntity.posZ)); - - if (var1 == null) { - return false; - } - else { - this.movePosX = var1.xCoord; - this.movePosY = var1.yCoord; - this.movePosZ = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.field_75426_g * this.field_75426_g); - } - - /** - * Resets the task - */ - public void resetTask() { - this.targetEntity = null; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.field_75425_f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/901d5ef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/901d5ef5c42100141fce95f06aba7e85 deleted file mode 100644 index 2845089..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/901d5ef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,277 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityArmadillo; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelArmadillo extends ModelBase { - public ModelRenderer WHOLE; - public ModelRenderer HEADPIECE; - public ModelRenderer REARRTR1; - public ModelRenderer REARRTR2; - public ModelRenderer REARRTR3; - - public ModelRenderer leg1; - public ModelRenderer leg2; - public ModelRenderer leg3; - public ModelRenderer leg4; - public ModelRenderer body2; - public ModelRenderer tail; - public ModelRenderer body1; - public ModelRenderer body3; - public ModelRenderer body4; - - public ModelRenderer chin; - public ModelRenderer head; - public ModelRenderer nose; - - public ModelArmadillo() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("WHOLE.dltfold0", 0, 0); - - WHOLE = new ModelRenderer(this, "WHOLE"); - WHOLE.setRotationPoint(0F, 18F, 0F); - // WHOLE.setRotationPoint(0F, 0F, 0F); - WHOLE.mirror = true; - setRotation(WHOLE, 0F, 0F, 0F); - - REARRTR1 = new ModelRenderer(this, "REARRTR1"); - WHOLE.addChild(REARRTR1); - REARRTR1.setRotationPoint(0F, -3F, -2F); - setRotation(REARRTR1, 0F, 0F, 0F); - REARRTR1.mirror = true; - body2 = new ModelRenderer(this, 32, 0); - body2.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR1.addChild(body2); - body2.setRotationPoint(0F, 3F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - REARRTR2 = new ModelRenderer(this, "REARRTR2"); - REARRTR1.addChild(REARRTR2); - REARRTR2.setRotationPoint(0F, -1F, 4F); - setRotation(REARRTR2, 0F, 0F, 0F); - REARRTR2.mirror = true; - body3 = new ModelRenderer(this, 32, 0); - body3.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR2.addChild(body3); - body3.setRotationPoint(0F, 4F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - REARRTR3 = new ModelRenderer(this, "REARRTR3"); - REARRTR2.addChild(REARRTR3); - REARRTR3.setRotationPoint(0F, 0F, 4F); - setRotation(REARRTR3, 0F, 0F, 0F); - REARRTR3.mirror = true; - tail = new ModelRenderer(this, 8, 14); - tail.addBox(-0.5F, -0.5F, 0F, 1, 1, 6); - REARRTR3.addChild(tail); - tail.setRotationPoint(0F, 6F, 4F); - tail.setTextureSize(64, 32); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - body4 = new ModelRenderer(this, 32, 0); - body4.addBox(-4.5F, -4F, -2F, 9, 8, 4); - REARRTR3.addChild(body4); - body4.setRotationPoint(0F, 4F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(REARRTR3); - // dltfold2.addChildModelRenderer(REARRTR2); - // dltfold0.addChildModelRenderer(REARRTR1); - HEADPIECE = new ModelRenderer(this, "HEADPIECE"); - WHOLE.addChild(HEADPIECE); - HEADPIECE.setRotationPoint(0F, 1F, -6F); - setRotation(HEADPIECE, 0F, 0F, 0F); - HEADPIECE.mirror = true; - nose = new ModelRenderer(this, 12, 9); - nose.addBox(-0.5F, -0.5F, -2F, 1, 1, 2); - HEADPIECE.addChild(nose); - nose.setRotationPoint(0F, 2F, -5F); - nose.setTextureSize(64, 32); - nose.mirror = true; - setRotation(nose, 0F, 0F, 0F); - head = new ModelRenderer(this, 0, 0); - head.addBox(-2.5F, -2.5F, -1.5F, 5, 5, 3); - HEADPIECE.addChild(head); - head.setRotationPoint(0F, 0F, -1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - chin = new ModelRenderer(this, 0, 8); - chin.addBox(-1.5F, -1.5F, -2.5F, 3, 3, 3); - HEADPIECE.addChild(chin); - chin.setRotationPoint(0F, 1F, -3F); - chin.setTextureSize(64, 32); - chin.mirror = true; - setRotation(chin, 0F, 0F, 0F); - // dltfold0.addChildModelRenderer(HEADPIECE); - body1 = new ModelRenderer(this, 32, 0); - body1.addBox(-4.5F, -4F, -2F, 9, 8, 4); - WHOLE.addChild(body1); - body1.setRotationPoint(0F, 0F, -4F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 15); - leg4.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg4); - leg4.setRotationPoint(3F, 4F, 5F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 0, 15); - leg3.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg3); - leg3.setRotationPoint(-3F, 4F, 5F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 0, 15); - leg2.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg2); - leg2.setRotationPoint(3F, 4F, -4F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 15); - leg1.addBox(-1F, 0F, -1F, 2, 2, 2); - WHOLE.addChild(leg1); - leg1.setRotationPoint(-3F, 4F, -4F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // Something Should GO here - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - WHOLE.render(f5); - GL11.glPopMatrix(); - } else { - WHOLE.render(f5); - } - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - EntityArmadillo var5 = (EntityArmadillo) par7Entity; - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateX(+0.05f * 2.0f, 0f, (float) (145 * Math.PI / 180f)); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - // HEADPIECE.rotateAngleX = - // var5.eHEADPIECE.rotateX(-0.05f*animSpeed,0f,(float)(145*Math.PI/180f)); - this.HEADPIECE.rotateAngleX = var5.eHEADPIECE.rotateAngleX = Math.min(Math.max(par5, -180), +180) - * (float) (Math.PI / 180f); - this.HEADPIECE.rotateAngleY = var5.eHEADPIECE.rotateAngleY = Math.min(Math.max(par4, -30), +30) - * (float) (Math.PI / 180f); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityArmadillo var5 = (EntityArmadillo) par1EntityLiving; - - if (var5.eWHOLE.isSetup == false) { - var5.eWHOLE.setup(WHOLE); - } - if (var5.eHEADPIECE.isSetup == false) { - var5.eHEADPIECE.setup(HEADPIECE); - } - if (var5.eREARRTR1.isSetup == false) { - var5.eREARRTR1.setup(REARRTR1); - } - if (var5.eREARRTR2.isSetup == false) { - var5.eREARRTR2.setup(REARRTR2); - } - if (var5.eREARRTR3.isSetup == false) { - var5.eREARRTR3.setup(REARRTR3); - } - if (var5.etail.isSetup == false) { - var5.etail.setup(tail); - } - if (var5.eleg3.isSetup == false) { - var5.eleg3.setup(leg3); - } - if (var5.eleg4.isSetup == false) { - var5.eleg4.setup(leg4); - } - - if (var5.getEntityState() == EntityStates.inCover || var5.isCharging() == true) { - float animSpeed = 2.0f; - if (var5.isCharging() == true) { - animSpeed = 5.0f; - /* Make Complete Body Circle */ - if (var5.eWHOLE.rotateAngleX == (float) ((390 + 360) * Math.PI / 180f)) { - var5.eWHOLE.rotateAngleX -= 360 * Math.PI / 180; - } - WHOLE.rotateAngleX = var5.eWHOLE - .rotateX(+0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - } else { - animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(+0.09f * animSpeed, 0f, (float) (390 * Math.PI / 180f)); - } - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(-0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(+0.1f, (float) (0 * Math.PI / 180f), (float) (90 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(-0.5f * animSpeed, 2.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(-0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(-0.5f * animSpeed, -4f, 4f); - } else if (var5.getEntityState() != EntityStates.inCover && var5.isCharging() == false) { - float animSpeed = 2.0f; - /* Make Complete Body Circle */ - WHOLE.rotateAngleX = var5.eWHOLE.rotateX(-0.09f * animSpeed, 0f, (float) ((390 + 360) * Math.PI / 180f)); - /* Rotate Face Inward */ - /* Rear Segments (square) fold to form circle */ - REARRTR1.rotateAngleX = var5.eREARRTR1.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR2.rotateAngleX = var5.eREARRTR2.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - REARRTR3.rotateAngleX = var5.eREARRTR3.rotateX(+0.01f * animSpeed, (float) (-44 * Math.PI / 180f), 0f); - tail.rotateAngleX = var5.etail.rotateX(-0.1f * animSpeed, (float) (-15 * Math.PI / 180f), - (float) (30 * Math.PI / 180f)); - tail.rotationPointZ = var5.etail.translateZ(+0.5f * animSpeed, 0.0f, 4.0f); - leg3.rotationPointZ = var5.eleg3.translateZ(+0.5f * animSpeed, -4f, 4f); - leg4.rotationPointZ = var5.eleg4.translateZ(+0.5f * animSpeed, -4f, 4f); - - leg1.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg2.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - leg3.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3); - leg4.rotateAngleX = (float) (MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/90e98201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/90e98201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d824e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/90e98201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/90f0dc1f3b20001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/90f0dc1f3b20001413909a661a93f408 deleted file mode 100644 index 344ccf9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/90f0dc1f3b20001413909a661a93f408 +++ /dev/null @@ -1,46 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone - }); - - GameRegistry.addRecipe(new ItemStack(Items.dye, 2, 15), new Object[]{ - "AB ", - "AAC", - "A ", - 'A', Blocks.cobblestone, 'B', Blocks.dirt, 'C', new ItemStack(Items.dye, 1, 1) - }); - - GameRegistry.addRecipe(new ItemStack(Items.diamond, 2), new Object[] { - "DDD", "DDD", "DDD", 'D', Blocks.dirt }); - - GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 2, 1), new Object[] - { - new ItemStack(Items.dye, 1, 1), Items.apple - }); - - GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 11), 0.1F); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/a07df6a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/a07df6a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a01ee05..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/a07df6a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,5 +0,0 @@ -package projectzulu.common.dungeon; - -public enum ListType { - NONE, Creature, Sound; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b1d6bea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b1d6bea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a8ab7da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/b1d6bea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/e193aefec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/e193aefec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 521ca54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/e193aefec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/e1eb4cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/e1eb4cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4a9428c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/e1eb4cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.item.ItemStack; -import net.minecraftforge.event.brewing.PotionBrewedEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEvents { - - @SubscribeEvent - public void potionBrewed(PotionBrewedEvent event) { - int i = -1; - for (ItemStack potionStack : event.brewingStacks) { - i++; - if (potionStack == null) { - continue; - } - ProjectZuluLog.info("Potions Stack %s is %s", i, potionStack.getItem()); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f02e6600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f02e6600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 40c7f32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f02e6600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f1f970a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f1f970a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ad2f1ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c7/f1f970a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemFoodProjectZulu extends ItemFood { - /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; - - /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; - - /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; - - /** - * If this field is true, the food can be consumed even if the player don't need to eat. - */ - private boolean alwaysEdible; - - /** - * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect - */ - private int potionId; - - /** set by setPotionEffect */ - private int potionDuration; - - /** set by setPotionEffect */ - private int potionAmplifier; - - /** probably of the set potion effect occurring */ - private float potionEffectProbability; - - public ItemFoodProjectZulu(int par2, float par3, boolean par4, String name) { - super(par2, par3, par4); - itemUseDuration = 32; - healAmount = par2; - isWolfsFavoriteMeat = par4; - saturationModifier = par3; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - @Override - public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - --par1ItemStack.stackSize; - par3EntityPlayer.getFoodStats().func_151686_a(this, par1ItemStack); - par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); - this.func_77849_c(par1ItemStack, par2World, par3EntityPlayer); - return par1ItemStack; - } - - protected void func_77849_c(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { - par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, - this.potionAmplifier)); - } - } - - /** - * How long it takes to use or consume an item - */ - @Override - public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - - /** - * returns the action that specifies what animation to play when the items is being used - */ - @Override - public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - - /** - * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer - */ - @Override - public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - if (par3EntityPlayer.canEat(this.alwaysEdible)) { - par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - - return par1ItemStack; - } - - @Override - public int func_150905_g(ItemStack stack) { - return this.healAmount; - } - - /** - * gets the saturationModifier of the ItemFood - */ - @Override - public float func_150906_h(ItemStack stack) { - return this.saturationModifier; - } - - /** - * Whether wolves like this food (true for raw and cooked porkchop). - */ - @Override - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - - /** - * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, - * float probability of effect happening - */ - @Override - public ItemFoodProjectZulu setPotionEffect(int par1, int par2, int par3, float par4) { - this.potionId = par1; - this.potionDuration = par2; - this.potionAmplifier = par3; - this.potionEffectProbability = par4; - return this; - } - - /** - * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. - */ - @Override - public ItemFoodProjectZulu setAlwaysEdible() { - this.alwaysEdible = true; - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0058d0a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0058d0a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bd7cf6a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0058d0a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0135c9f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0135c9f8c42100141fce95f06aba7e85 deleted file mode 100644 index ab7c216..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/0135c9f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityPelican; -import com.ngb.projectzulu.common.mobs.models.ModelPelican; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/1061649ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/1061649ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c5486e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/1061649ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/202950e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/202950e5c42100141fce95f06aba7e85 deleted file mode 100644 index c90342c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/202950e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/41a410e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/41a410e4c42100141fce95f06aba7e85 deleted file mode 100644 index 5cfabb3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/41a410e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBeaverHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBeaverHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 0F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 2F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 2F, -5F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/42babc9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/42babc9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 33368cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/42babc9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/509604e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/509604e4c42100141fce95f06aba7e85 deleted file mode 100644 index 8de057b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/509604e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,12 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; -import net.minecraft.init.Blocks; - -public class BlockZuluStairs extends BlockStairs { - public BlockZuluStairs(Block par2Block, int par3) { - super(par2Block, par3); - setLightOpacity(0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/51289d01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/51289d01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 897309e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/51289d01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerPyramid; - -public class PyramidFeature extends BiomeFeature { - public static final String PYRAMID = "Pyramid"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public PyramidFeature() { - super(PYRAMID, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 15; - chestMaxLoot = -1; - if (CustomEntityList.MUMMY.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MUMMY.modData.get().mobName), 4)); - } - if (entityEntries.isEmpty()) { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerPyramid(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/8097bee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/8097bee4c42100141fce95f06aba7e85 deleted file mode 100644 index d3f1cbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/8097bee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketStreamSound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandStreamSound extends CommandBase { - - @Override - public String getCommandName() { - return "streamsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.streamsound.usage"; - } - - /** - * Command stringArgs == 2: /streamsound [targetPlayer] [fileName] Command stringArgs == 2: - * /streamsound @p sounds.fileName Command stringArgs == 3: /streamsound @p sounds.fileName Command - * stringArgs == 5: /streamsound @p sounds.fileName Command stringArgs == 6: - * /streamsound @p sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.streamsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketStreamSound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81305be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81305be6c42100141fce95f06aba7e85 deleted file mode 100644 index a806422..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81305be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81a3c7f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81a3c7f7c42100141fce95f06aba7e85 deleted file mode 100644 index d981b13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81a3c7f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,12 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; -import net.minecraft.init.Blocks; - -public class BlockZuluStairs extends BlockStairs { - public BlockZuluStairs(Block par2Block, int par3) { - super(par2Block, par3); - setLightOpacity(0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81ad53ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81ad53ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 94b6064..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/81ad53ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/b0de289ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/b0de289ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0f74ce8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/b0de289ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class NightBloomFeature extends BiomeFeature { - private int density = 2; - - public NightBloomFeature() { - super("Night Bloom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.nightBloom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 2; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/d19a72f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/d19a72f6c42100141fce95f06aba7e85 deleted file mode 100644 index 995119d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/d19a72f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,124 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandSpawnEntity extends CommandBase{ - @Override - public String getCommandName(){ - return "spawnentity"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel(){ - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender){ - return "commands.spawnentity.usage"; - } - - /** - * Command stringArgs : /spawnentity [targetPlayer] [entityName] - * Command stringArgs == 2: /spawnentity @p entityName - * Command stringArgs == 5: /spawnentity @p entityName - * Command stringArgs == 7: /spawnentity @p entityName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs){ - if(stringArgs.length < 2){ - throw new WrongUsageException("commands.spawnentity.usage", new Object[0]); - }else{ - double spawnTargetX = 0; - double spawnTargetY = 0; - double spawnTargetZ = 0; - float rotYaw = 0; - float rotPitch = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if(targetPlayer == null){ - throw new PlayerNotFoundException(); - } - - Entity spawnableEntity = EntityList.createEntityByName(stringArgs[1], targetPlayer.worldObj); - if(spawnableEntity == null){ - System.out.println("Entity is Null"); - throw new WrongUsageException("commands.spawnentity.noentity", new Object[0]); - } - - if(stringArgs.length == 2){ - spawnTargetX = (int)targetPlayer.posX; - spawnTargetY = (int)targetPlayer.posY; - spawnTargetZ = (int)targetPlayer.posZ; - }else if(stringArgs.length == 5 || stringArgs.length == 7){ - int indexOfPos = stringArgs.length - 3; - spawnTargetX = (int)parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - spawnTargetY = (int)parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, 0); - spawnTargetZ = (int)parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - if(stringArgs.length == 7){ - rotYaw = parseIntBounded(commandSender, stringArgs[2], 0, 360); - rotPitch = parseIntBounded(commandSender, stringArgs[3], 0, 360); - } - -// ProjectZuluLog.info("Placing Block at %s, %s, %s with Yaw %s and pitch %s", spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch ); - spawnableEntity.setLocationAndAngles(spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch); - targetPlayer.worldObj.spawnEntityInWorld(spawnableEntity); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr){ - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble){ - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, int lowerLimit, int upperLimit){ - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1){ - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords){ - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords){ - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0){ - if (targetPos < (double)lowerLimit){ - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(targetPos), Integer.valueOf(lowerLimit)}); - } - - if (targetPos > (double)upperLimit){ - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(targetPos), Integer.valueOf(upperLimit)}); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/f1cc3f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/f1cc3f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f4f6002..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c8/f1cc3f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/103ba8f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/103ba8f4c42100141fce95f06aba7e85 deleted file mode 100644 index 2cbf3b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/103ba8f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a temperature Item - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempItem { - - /** - * Factor that adds to the current Player Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public Float getPlayerTempContributionFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp when the Item is in hand - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public Float getLocationTemperatureFromCurItem(EntityPlayer player, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate when the Item is in hand - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHEatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferWithCurItem(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/111365a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/111365a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9756b5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/111365a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockTumbleweed; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class TumbleweedDeclaration extends BlockDeclaration { - - public TumbleweedDeclaration() { - super("Tumbleweed"); - } - - @Override - protected boolean createBlock() { - BlockList.tumbleweed = Optional.of((new BlockTumbleweed()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tumbleweed.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/41bd74e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/41bd74e4c42100141fce95f06aba7e85 deleted file mode 100644 index 48c8070..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/41bd74e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,617 +0,0 @@ -package projectzulu.common.blocks.spike; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderSpike implements ISimpleBlockRenderingHandler { - - /* Leaving This here For Reference */ - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94216_b %s", var10.func_94216_b()); // 192 - // ProjectZuluLog.info("func_94209_e %s", var10.getMinU()); // 0.46875 - // ProjectZuluLog.info("func_94212_f %s", var10.getMaxU()); // 0.5 - // ProjectZuluLog.info("func_94214_a %s", var10.getInterpolatedU(8D)); // 0: 0.46875, 8: 0.484375 - // ProjectZuluLog.info("func_94206_g %s", var10.getMinV()); // 0.375 - // ProjectZuluLog.info("func_94210_h %s", var10.getMaxV()); // 0.40625 - // ProjectZuluLog.info("func_94207_b %s", var10.func_94207_b(8D)); // 0: 0.375, 8: 0.390625 - // ProjectZuluLog.info("func_94215_i %s", var10.func_94215_i()); // NAME - // ProjectZuluLog.info("func_94213_j %s", var10.func_94213_j()); // 512 - // ProjectZuluLog.info("func_94208_k %s", var10.func_94208_k()); // 512 - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - return Render(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - } - - private boolean Render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - // // if (par1Block == Block.tallGrass) - // // { - // // long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; - // // var17 = var17 * var17 * 42317861L + var17 * 11L; - // // var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; - // // var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; - // // } - if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars - || blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - // renderAsSpike(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - RenderFencePikes(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - - } else if (blockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - boolean isNegZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(blockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - /* Check For Along Z */ - if (isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 0); - } else if (!isNegZ && isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 1); - } else if (isNegZ && !isPosZ) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, false, 2); - } - - /* Check For Along X */ - if (isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 0); - } else if (!isNegX && isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 1); - } else if (isNegX && !isPosX) { - drawSpikeStrip(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, - renderer, true, 2); - } - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - drawSpikeCross(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - - } else { - // renderer.drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, - // var15, 1.0f); - drawCrossedSquares(par1Block, blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, renderer); - } - return true; - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block par1) { - return par1.isOpaqueCube() || par1 == Blocks.iron_bars || par1 == Blocks.glass; - } - - public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, - RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - 0.5D; - double var23 = par3 + 0.5D + 0.5D; - double var25 = par7 + 0.5D - 0.5D; - double var27 = par7 + 0.5D + 0.5D; - - switch (par2) { - case 0: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 1: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 2: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 3: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 4: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 5: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - case 6: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 7: - drawOnSide1(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 8: - drawOnSide2(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 9: - drawOnSide3(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 10: - drawOnSide4(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - case 11: - drawOnSide5(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - - default: - drawOnSide0(var9, par5, var21, var23, var25, var27, var13, var15, var17, var19); - break; - } - } - - public void drawOnSide0(Tessellator tessellator, double par5, double var21, double var23, double var25, - double var27, double var13, double var15, double var17, double var19) { - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var17); - - /* Bottom Facing Texture */ - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var17); - - tessellator.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - tessellator.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - tessellator.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - tessellator.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var17); - } - - public void drawOnSide1(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide2(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - } - - public void drawOnSide3(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide4(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var17); - - /* Second Texture */ - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var17); - } - - public void drawOnSide5(Tessellator var9, double par5, double var21, double var23, double var25, double var27, - double var13, double var15, double var17, double var19) { - - /* First Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); - - /* Second Texture */ - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 1.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 1.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var17); - } - - public void RenderFencePikes(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 1f / 4f; - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 3f / 4f; - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - double var21 = par3 + 0.5D - (0.625 - 0.375) / 2D; - double var23 = par3 + 0.5D + (0.625 - 0.375) / 2D; - double var25 = par7 + 0.5D - (0.625 - 0.375) / 2D; - double var27 = par7 + 0.5D + (0.625 - 0.375) / 2D; - - double maxY = 0.6; - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var15, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - - public void drawSpikeCross(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer) { - Tessellator var9 = Tessellator.instance; - // Icon var10 = par1Block.getIcon(0, par2); - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13 = var10.getMinU(); - double var15 = var10.getMaxU(); - double var17 = var10.getMinV(); - double var19 = var10.getMaxV(); - - /* Render Strip Along X */ - double var21 = par3 + 0.5D - 0.5; - double var23 = par3 + 0.5D + 0.5; - double var25 = par7 + 0.5D - 0.06; - double var27 = par7 + 0.5D + 0.06; - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - /* Render Strip Along Z */ - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - - // float var6 = 0.375F; - // float var7 = 0.625F; - maxY = 0.6; - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - } - - public void drawSpikeStrip(Block par1Block, int par2, double par3, double par5, double par7, RenderBlocks renderer, - Boolean alongX, int type) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(par1Block, 0, par2); - - if (renderer.overrideBlockTexture != null) { - var10 = renderer.overrideBlockTexture; - } - - double var13; - double var15; - double var17; - double var19; - - switch (type) { - case 1: - var13 = var10.getInterpolatedU(8D); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - case 2: - var13 = var10.getMinU(); - var15 = var10.getInterpolatedU(8D); // var10.getMaxU(); - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2f; // var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - break; - - default: - var13 = var10.getMinU(); - var15 = var10.getMaxU(); - var17 = var10.getMinV(); - var19 = var10.getMaxV(); - } - - double var21; - double var23; - double var25; - double var27; - if (alongX) { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.0; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - - break; - case 2: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.0; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - default: - var21 = par3 + 0.5D - 0.5; - var23 = par3 + 0.5D + 0.5; - var25 = par7 + 0.5D - 0.06; - var27 = par7 + 0.5D + 0.06; - break; - } - - } else { - switch (type) { - case 1: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.0; - var27 = par7 + 0.5D + 0.5; - - break; - case 2: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.0; - - break; - default: - var21 = par3 + 0.5D - 0.06; - var23 = par3 + 0.5D + 0.06; - var25 = par7 + 0.5D - 0.5; - var27 = par7 + 0.5D + 0.5; - break; - } - } - - // float var6 = 0.375F; - // float var7 = 0.625F; - double maxY = 0.6; - - if (alongX) { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var13, var17); - - } else { - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + maxY, var25, var13, var17); - - /* Bottom Facing Texture */ - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - - var9.addVertexWithUV(var23, par5 + maxY, var25, var13, var17); - var9.addVertexWithUV(var23, par5 + 0.0D, var25, var13, var19); - var9.addVertexWithUV(var21, par5 + 0.0D, var27, var15, var19); - var9.addVertexWithUV(var21, par5 + maxY, var27, var15, var17); - - } - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/41c4ea9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/41c4ea9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 204697b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/41c4ea9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCreeperBlossom; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CreeperBlossomDeclaration extends BlockDeclaration { - - public CreeperBlossomDeclaration() { - super("CreeperBlossom"); - } - - @Override - protected boolean createBlock() { - BlockList.creeperBlossom = Optional.of(new BlockCreeperBlossom().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.creeperBlossom.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/502d3401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/502d3401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f278918..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/502d3401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.models.ModelMinotaur; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/50bbe69fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/50bbe69fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c0b3479..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/50bbe69fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,137 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.Blueprint; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BPSetCathedral implements BlueprintSet { - boolean isAssigned = false; - - Blueprint dome = new BPCathedralDome(); - Blueprint hallway = new BPCathedralHallway(); - Blueprint hallwayEnd = new BPCathedralHallwayEnd(); - Blueprint hallwayEnt = new BPCathedralHallwayEntrance(); - Blueprint entrance = new BPCathedralEntrance(); - Blueprint west_tower = new BPCathedralWestTower(); - Blueprint east_tower = new BPCathedralEastTower(); - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return !isAssigned; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.EastWall); - - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthWall); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 5, entrance.getIdentifier(),// entrance - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 5, entrance.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 5, west_tower.getIdentifier(), // west_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 5, west_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 6].getHeight()); - - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 5, east_tower.getIdentifier(), // east_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 5, east_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 6].getHeight()); - isAssigned = true; - return true; - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection) { - applyBlueprintToCell(cellList, xCell, zCell, subBuildingID, cellDirection, 0); - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection, int heightIncrease) { - cellList[xCell][zCell].setBuildingProperties(getIdentifier().concat("-").concat(subBuildingID), cellDirection); - cellList[xCell][zCell].rawState = -1; - cellList[xCell][zCell].setHeight(cellList[xCell][zCell].getHeight() + heightIncrease); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String childBuildingID = buildingID.split("-")[1]; - if (childBuildingID != null) { - if (childBuildingID.equals(dome.getIdentifier())) { - return dome.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallway.getIdentifier())) { - return hallway.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnd.getIdentifier())) { - return hallwayEnd.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnt.getIdentifier())) { - return hallwayEnt.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(entrance.getIdentifier())) { - return entrance.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(west_tower.getIdentifier())) { - return west_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(east_tower.getIdentifier())) { - return east_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - } - return null; - } - - @Override - public String getIdentifier() { - return "Cathedral"; - } - - @Override - public int getWeight() { - return 20; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/515c78f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/515c78f5c42100141fce95f06aba7e85 deleted file mode 100644 index 80dc614..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/515c78f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/51caa7f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/51caa7f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6c6909a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/51caa7f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,253 +0,0 @@ -// Date: 21/08/2012 16:58:44 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityLizard; - -public class ModelLizard extends ModelBase { - ModelRenderer leg1; - ModelRenderer leg1u; - ModelRenderer leg2; - ModelRenderer leg2u; - - ModelRenderer TAILROT; - ModelRenderer Tail3; - ModelRenderer Tail2; - ModelRenderer Tail1; - - ModelRenderer FRONTROT; - ModelRenderer HEADBASE; - ModelRenderer Frill1; - ModelRenderer Frill2; - ModelRenderer Frill3; - ModelRenderer Frill4; - ModelRenderer head; - ModelRenderer leg3u; - ModelRenderer leg3; - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg4u; - - public ModelLizard() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TAILROT.dltfold1", 0, 0); - setTextureOffset("FRONTROT.dltfold3", 0, 0); - - leg1 = new ModelRenderer(this, 20, 22); - leg1.addBox(-3F, 0F, -1F, 2, 6, 2); - leg1.setRotationPoint(-4F, 18F, 6F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg1u = new ModelRenderer(this, 14, 22); - leg1u.addBox(-1F, 0F, -1F, 1, 2, 2); - leg1u.setRotationPoint(-4F, 18F, 6F); - leg1u.setTextureSize(64, 32); - leg1u.mirror = true; - setRotation(leg1u, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 20, 22); - leg2.addBox(1F, 0F, -1F, 2, 6, 2); - leg2.setRotationPoint(4F, 18F, 6F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg2u = new ModelRenderer(this, 14, 22); - leg2u.addBox(0F, 0F, -1F, 1, 2, 2); - leg2u.setRotationPoint(4F, 18F, 6F); - leg2u.setTextureSize(64, 32); - leg2u.mirror = true; - setRotation(leg2u, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 9F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - Tail3 = new ModelRenderer(this, 0, 17); - Tail3.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail3); - Tail3.setRotationPoint(0F, -1F, 10F); - Tail3.setTextureSize(64, 32); - Tail3.mirror = true; - setRotation(Tail3, 0F, 0F, 0F); - Tail2 = new ModelRenderer(this, 0, 17); - Tail2.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail2); - Tail2.setRotationPoint(0F, -1F, 5F); - Tail2.setTextureSize(64, 32); - Tail2.mirror = true; - setRotation(Tail2, 0F, 0F, 0F); - Tail1 = new ModelRenderer(this, 0, 17); - Tail1.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail1); - Tail1.setRotationPoint(0F, -1F, 0F); - Tail1.setTextureSize(64, 32); - Tail1.mirror = true; - setRotation(Tail1, 0F, 0F, 0F); - FRONTROT = new ModelRenderer(this, "FRONTROT"); - FRONTROT.setRotationPoint(0F, 19F, 6F); - setRotation(FRONTROT, 0F, 0F, 0F); - FRONTROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - FRONTROT.addChild(HEADBASE); - HEADBASE.setRotationPoint(0F, 0F, -13F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - Frill2 = new ModelRenderer(this, 29, 22); - Frill2.addBox(-3F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill2); - Frill2.setRotationPoint(-3F, 1F, -3F); - Frill2.setTextureSize(64, 32); - Frill2.mirror = true; - setRotation(Frill2, 0F, 0.0371786F, 0F); - Frill4 = new ModelRenderer(this, 37, 22); - Frill4.addBox(-4F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill4); - Frill4.setRotationPoint(-1F, -2F, -3F); - Frill4.setTextureSize(64, 32); - Frill4.mirror = true; - setRotation(Frill4, 0F, 0F, 0F); - Frill1 = new ModelRenderer(this, 29, 22); - Frill1.addBox(0F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill1); - Frill1.setRotationPoint(3F, 1F, -3F); - Frill1.setTextureSize(64, 32); - Frill1.mirror = true; - setRotation(Frill1, 0F, 0.0371786F, 0F); - - Frill3 = new ModelRenderer(this, 37, 22); - Frill3.addBox(0F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill3); - Frill3.setRotationPoint(1F, -2F, -3F); - Frill3.setTextureSize(64, 32); - Frill3.mirror = true; - setRotation(Frill3, 0F, 0F, 0F); - Frill3.mirror = false; - head = new ModelRenderer(this, 0, 0); - head.addBox(-4F, -4F, -9F, 6, 6, 8); - HEADBASE.addChild(head); - head.setRotationPoint(1F, 1F, 1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(HEADBASE); - leg3u = new ModelRenderer(this, 14, 22); - leg3u.addBox(-1F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg3u); - leg3u.setRotationPoint(-4F, -1F, -12F); - leg3u.setTextureSize(64, 32); - leg3u.mirror = true; - setRotation(leg3u, 0F, 0F, 0F); - body = new ModelRenderer(this, 10, 0); - body.addBox(-4F, -2F, -9F, 8, 4, 18); - FRONTROT.addChild(body); - body.setRotationPoint(0F, 0F, -6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4u = new ModelRenderer(this, 14, 22); - leg4u.addBox(0F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg4u); - leg4u.setRotationPoint(4F, -1F, -12F); - leg4u.setTextureSize(64, 32); - leg4u.mirror = true; - setRotation(leg4u, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 20, 22); - leg4.addBox(1F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg4); - leg4.setRotationPoint(4F, -1F, -12F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 20, 22); - leg3.addBox(-3F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg3); - leg3.setRotationPoint(-4F, -1F, -12F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - FRONTROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - FRONTROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityLizard var5 = (EntityLizard) par1EntityLiving; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - if (var5.prepareToSpit == true) { - Frill1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.0F * par3; - Frill2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 1.0F * par3; - - Frill3.rotateAngleZ = (float) (-45 * Math.PI / 180); - Frill3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - Frill3.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - - Frill4.rotateAngleZ = (float) (45 * Math.PI / 180); - Frill4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - Frill4.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - } else { - Frill1.rotateAngleZ = (float) (-90 * Math.PI / 180); // This is on Right - Frill2.rotateAngleZ = (float) (90 * Math.PI / 180); // This is on Left - - Frill3.rotateAngleY = (float) (-90 * Math.PI / 180); - Frill4.rotateAngleY = (float) (90 * Math.PI / 180); - } - leg1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - leg3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADBASE.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADBASE.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/60397d00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/60397d00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3fbe308..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/60397d00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,127 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.core.ProjectZuluLog; - - -public class ParsingHelper { - - /** - * Attempt to Parse an Integer. Performs no filters. - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static int parseInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Integer. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static int parseFilteredInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Long. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static Long parseFilteredLong(String value, Long fallBack, String fieldName) { - try { - return Long.parseLong(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an long. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an long. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Float. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static float parseFilteredFloat(String value, float fallBack, String fieldName) { - try { - return Float.parseFloat(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Double. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static double parseFilteredDouble(String value, double fallBack, String fieldName) { - try { - return Double.parseDouble(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Boolean - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static boolean parseBoolean(String value, boolean fallBack, String fieldName) { - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for a boolean. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for a boolean. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } else { - return Boolean.parseBoolean(value); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/70ac409ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/70ac409ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3d0d6dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/70ac409ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package projectzulu.common.core; - -public class DefaultProps { - - /* ModIDs, Dependencies, and Version */ - public static final String DesiredBefore = "after:ExtrabiomesXL@"; - public static final String VERSION_STRING = "1.1.7.3"; - public static final String CoreModId = "ProjectZulu|Core"; - public static final String BlocksModId = "ProjectZulu|Block"; - public static final String MobsModId = "ProjectZulu|Mob"; - public static final String WorldModId = "ProjectZulu|World"; - public static final String DungeonModId = "ProjectZulu|Dungeon"; - public static final String DEPENDENCY_CORE = "required-after:" + CoreModId + "@"; - - /* Packet Channels */ - public static final String defaultChannel = "Channel_Zulu"; - - /* Module Directory Keys */ - public static final String coreKey = "projectzulucore"; - public static final String mobKey = "projectzulumob"; - public static final String blockKey = "projectzulublock"; - public static final String worldKey = "projectzuluworld"; - public static final String dungeonKey = "projectzuludungeon"; - - /* Module Resource Directories */ - public static final String coreDiretory = "/mods/" + coreKey + "/"; - public static final String mobDiretory = "/mods/" + mobKey + "/"; - public static final String blockDiretory = "/mods/" + blockKey + "/"; - public static final String worldDiretory = "/mods/" + worldKey + "/"; - public static final String dungeonDiretory = "/mods/" + dungeonKey + "/"; - public static final String entitySoundDir = "mob/"; - public static final String entitySounds = entitySoundDir.replace("/", "."); - - /* Common Resource Sub-Directories */ - public static final String itemSubDir = "textures/blocks/"; - public static final String blockSubDir = "textures/blocks/"; -// public static final String blockSpriteSheet = blockDiretory + "blocks_projectzulu.png"; // TODO: Delete -// public static final String itemSpriteSheet = blockDiretory + "items_projectzulu.png"; // TODO: Delete - - /* Config Directories */ - public static final String configDirectory = "/Project Zulu/"; - public static final String customResourcesDirectory = "CustomResources/"; - public static final String streamingResourcesDirectory = "streaming/"; - public static final String soundResourcesDirectory = "sound/"; - public static final String defaultConfigFile = "ProjectZuluConfig.cfg"; - public static final String moduleConfigFile = "ProjectZuluModules.cfg"; - public static final String tempConfigFile = "tempSettingsConfig.cfg"; - public static final String mobBiomeSpawnConfigFile = "ProjectZuluMobBiomeConfig.cfg"; - public static final String structureBiomeConfigFile = "ProjectZuluTerrainFeature.cfg"; -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/81142800c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/81142800c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 091162d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/81142800c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,527 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("Tombstone summoned to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/9030c9f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/9030c9f4c42100141fce95f06aba7e85 deleted file mode 100644 index ed47f65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/9030c9f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionPoison extends SubItemPotionHalfPower { - - public SubItemPotionPoison(Item itemID, int subID) { - super(itemID, subID, "Poison"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.poison); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/90978a21c7ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/90978a21c7ab00141ee9bf3050c1025b new file mode 100644 index 0000000..6cf205f --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/90978a21c7ab00141ee9bf3050c1025b @@ -0,0 +1,295 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + private boolean stickSpawn = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(10); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(29) == 0) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/c00a4bf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/c00a4bf5c42100141fce95f06aba7e85 deleted file mode 100644 index 6eb9015..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/c00a4bf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,211 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGiraffe; - -public class ModelGiraffe extends ModelBase { - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer tail; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - private ModelRenderer HEADROT; - - public ModelGiraffe() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT1.neck1", 103, 36); - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - body = new ModelRenderer(this, 0, 24); - body.addBox(-7F, -16F, -23F, 14, 16, 24); - body.setRotationPoint(0F, 5F, 11F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 56, 12); - body2.addBox(-5F, -28F, 2F, 10, 21, 12); - body2.setRotationPoint(0F, 5F, 11F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 1.047198F, 0F, 0F); - body3 = new ModelRenderer(this, 92, 0); - body3.addBox(-4.5F, -26F, -23F, 11, 10, 6); - body3.setRotationPoint(-1F, 5F, 11F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 0); - leg1.addBox(-2F, 0F, -2F, 4, 19, 4); - leg1.setRotationPoint(-5F, 5F, -9F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 18, 0); - leg2.addBox(-2F, 0F, -2F, 4, 19, 4); - leg2.setRotationPoint(5F, 5F, -9F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 36, 0); - leg3.addBox(-2F, 0F, -2F, 4, 19, 4); - leg3.setRotationPoint(-5F, 5F, 9F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 24); - leg4.addBox(-2F, 0F, -2F, 4, 19, 4); - leg4.setRotationPoint(5F, 5F, 9F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - tail = new ModelRenderer(this, 54, 0); - tail.addBox(-1F, 0F, 0F, 2, 17, 2); - tail.setRotationPoint(0F, -8F, 12F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -21F, -9F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -3F, -3F, -3F, 6, 3, 6); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - body2.render(f5); - body3.render(f5); - leg1.render(f5); - leg2.render(f5); - leg3.render(f5); - leg4.render(f5); - tail.render(f5); - NECKROT1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -45), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityGiraffe var5 = (EntityGiraffe) par1EntityLiving; - /* State Animation Rotations */ - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg1.rotateAngleZ = (float) (0 * Math.PI / 180); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg2.rotateAngleZ = (float) (0 * Math.PI / 180); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - float minTime; - float maxTime; - if (var5.getAnimTime() > 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/c05a839ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/c05a839ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8ab6a9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/c05a839ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.EnumSet; -import java.util.HashMap; - -/** - * Represent the readable Tags for OptionalSettings - */ -public enum Key { - /* Category Tags */ - spawn("spawn", KeyParserSpawn.class), despawn("despawn", KeyParserDespawn.class), - - /* Properties */ - sky("sky", KeyParserSky.class), block("block", KeyParserBlock.class), blockFoot("blockFoot", - KeyParserBlockFoot.class), light("light", KeyParserLight.class), entityCap("cap", KeyParserEntityCap.class), spawnRange( - "spawnRange", KeyParserSpawnRange.class), maxSpawnRange("maxSpawnRange", KeyParserMaxSpawnRange.class), despawnAge( - "despawnAge", KeyParserDespawnAge.class), spawnRate("spawnRate", KeyParserSpawnRate.class), blockRange( - "blockRange", KeyParserBlockRange.class), material("material", null), minSpawnHeight("minSpawnHeight", - KeyParserMinHeight.class), maxSpawnHeight("maxSpawnHeight", KeyParserMaxHeight.class), normal("normal", - KeyParserNormalCube.class), liquid("liquid", KeyParserLiquid.class), opaque("opaque", - KeyParserOpaqueBlock.class), solidSide("solidSide", KeyParserSolidSide.class), difficulty("difficulty", - KeyParserDifficulty.class), torchLight("torchLight", KeyParserTorchLight.class), ground("ground", - KeyParserGround.class), top("top", KeyParserTop.class), fill("fill", KeyParserFill.class), modspawn( - "modSpawn", KeyParserModSpawn.class), origin("origin", KeyParserOrigin.class), players("players", - KeyParserPlayers.class), entities("entities", KeyParserEntities.class), random("random", - KeyParserRandom.class), writenbt("writenbt", KeyParserWriteNBT.class), - - /* Sub Tags */ - blockRangeX("blockRangeX", null), blockRangeY("blockRangeY", null), blockRangeZ("blockRangeZ", null), - - /**/ - UNKNOWN("", null); - - public final String key; - private static final HashMap lookupEnum = new HashMap(); - static { - for (Key key : EnumSet.allOf(Key.class)) - lookupEnum.put(key.key.toUpperCase(), key); - } - - public KeyParser keyParser; - - Key(String key, Class keyParserClass) { - this.key = key; - if (keyParserClass != null) { - try { - keyParser = keyParserClass.getConstructor(new Class[] { Key.class }).newInstance(new Object[] { this }); - } catch (Exception exception) { - exception.printStackTrace(); - return; - } - } - } - - /** - * Gets the Key associated with the String. Is not case Sensitive - * - * @param string - * @return - */ - public static Key getKeybyString(String string) { - Key value = lookupEnum.get(string.toUpperCase()); - if (value != null) { - return value; - } else { - return UNKNOWN; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/e2f667e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/e2f667e5c42100141fce95f06aba7e85 deleted file mode 100644 index 46de0af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/e2f667e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGreenFinch; -import projectzulu.common.mobs.models.ModelFinch; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GreenFinchDeclaration extends SpawnableDeclaration { - - public GreenFinchDeclaration() { - super("Green Finch", 23, EntityGreenFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (30 << 16) + (130 << 8) + 0; - eggColor2 = (164 << 16) + (234 << 8) + 143; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_green.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f1956bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f1956bf6c42100141fce95f06aba7e85 deleted file mode 100644 index 0ac1b68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f1956bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,322 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -//TODO: Implement Try Write / Read to Test if Saving Would Cause a Crash -public class GuiLimitedMobSpawner extends GuiScreen { - public TileEntityLimitedMobSpawner limitedMobSpawner; - Point backgroundSize = new Point(256, 244); - - int numberOfFields = 1; - int currentDataField = 0; - private List dataFields = new ArrayList(); - public static final ResourceLocation SPAWNER_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "mobspawnergui.png"); - - public DataFields getDataField(int index) { - return dataFields.get(index); - } - - /* Used by Scrolling Creature List to know which Field to Return a Selected String to */ - GUISelectionList scrollingList; - public ListType currentListType = ListType.NONE; - Node rootCreatureNode = new Node(null, "root"); - Node rootSoundNode = new Node(null, "root"); - - public GuiLimitedMobSpawner(TileEntityLimitedMobSpawner limitedMobSpawner) { - this.limitedMobSpawner = limitedMobSpawner; - if (limitedMobSpawner.getSpawnList() != null) { - numberOfFields = limitedMobSpawner.getSpawnList().size() + 1; - } else { - numberOfFields = 1; - } - } - - public Minecraft getMinecraft() { - return mc; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - super.initGui(); - buttonList.clear(); - Keyboard.enableRepeatEvents(true); - buttonList.add(new GuiButton(ButtonIDs.BACKWARDS.index, this.width / 2 - 25 / 2 - 38, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, "<<")); - buttonList.add(new GuiButton(ButtonIDs.FORWARD.index, this.width / 2 - 25 / 2 + 8, - (this.height + backgroundSize.getY()) / 2 - 47, 25, 20, ">>")); - - buttonList.add(new GuiButton(ButtonIDs.SAVENCLOSE.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "Save & Quit")); // Three Button System: Save & - // Close - Cancel - + Entry - buttonList.add(new GuiButton(ButtonIDs.CANCEL.index, this.width / 2 - 70 / 2 - 88, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Cancel")); - - buttonList.add(new GuiButton(ButtonIDs.NEWENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 47, 70, 20, "New Entry")); - buttonList.add(new GuiButton(ButtonIDs.DELENTRY.index, this.width / 2 - 70 / 2 + 75 - 17, - (this.height + backgroundSize.getY()) / 2 - 25, 70, 20, "Delete Entry")); - - limitedMobSpawner.setEditable(false); - - for (int i = 0; i < numberOfFields; i++) { - if (dataFields.isEmpty() || dataFields.size() <= i) { - if (i == 0) { - dataFields - .add(0, new SpawnerFields(this).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(0).loadFromTileEntity(limitedMobSpawner, i); - } else { - dataFields.add(i, new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } else { - dataFields.get(i).createFields(mc, this.width, this.height, backgroundSize); - } - } - - switch (currentListType) { - case Creature: - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - break; - } - } - - public void openList(ListType listType) { - currentListType = listType; - switch (currentListType) { - case Creature: - /* Create List if Empty */ - if (rootCreatureNode.numberOfChildren() == 0) { - Iterator stringToClassIterator = EntityList.stringToClassMapping.keySet().iterator(); - while (stringToClassIterator.hasNext()) { - String stringKey = (String) stringToClassIterator.next(); - if (EntityLiving.class.isAssignableFrom(((Class) EntityList.stringToClassMapping.get(stringKey)))) { - if (stringKey.equals("Mob")) { - continue; - } - rootCreatureNode.addChild("root." + stringKey); - } - } - rootCreatureNode.sortNodeTree(); - } - scrollingList = new GUISelectionList(this, rootCreatureNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - case Sound: - if (rootSoundNode.numberOfChildren() == 0) { - /* - * Grab "nameToSoundPoolEntriesMapping" : OBFSC: "m" : nameToSoundPoolEntriesMapping --> fields.csv --> - * joined.srg --> d - */ - SoundRegistry registry = ObfuscationHelper.getFieldFromReflection("field_147697_e", "sndRegistry", - mc.getSoundHandler(), SoundRegistry.class); - HashMap soundHash = ObfuscationHelper.getFieldFromReflection("field_148764_a", "field_148764_a", - registry, HashMap.class); - - if (soundHash != null) { - Iterator stringSoundIterator = soundHash.keySet().iterator(); - while (stringSoundIterator.hasNext()) { - ResourceLocation key = (ResourceLocation) stringSoundIterator.next(); - rootSoundNode.addChild("root." + key.getResourceDomain() + "." + key.getResourcePath()); - } - rootSoundNode.sortNodeTree(); - } - } - scrollingList = new GUISelectionList(this, rootSoundNode, currentListType, 85, new Point(this.width, - this.height), backgroundSize); - scrollingList.registerScrollButtons(this.buttonList, 7, 8); - break; - default: - throw new IllegalStateException("Trying to Open invalid List type " + listType.toString()); - } - } - - public void closeList() { - currentListType = ListType.NONE; - scrollingList = null; - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - // TODO: Sync To Server - limitedMobSpawner.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton button) { - /* If Not on Main Screen */ - if (button.enabled) { - switch (ButtonIDs.getButtonByIndex(button.id)) { - case CANCEL: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - closeGui(); - break; - case FORWARD: - if (currentDataField + 1 < dataFields.size()) { - currentDataField++; - } - break; - case BACKWARDS: - if (currentDataField > 0) { - currentDataField--; - } - break; - case SAVENCLOSE: - /* Close Menu With Saving */ - this.limitedMobSpawner.markDirty(); - saveGuiToTileEntity(); - closeGui(); - break; - case DELENTRY: - if (currentDataField != 0) { - dataFields.remove(currentDataField); - currentDataField--; - numberOfFields--; - } - break; - case NEWENTRY: - dataFields.add(new CreatureFields(mc).createFields(mc, this.width, this.height, backgroundSize)); - dataFields.get(dataFields.size() - 1).loadFromTileEntity(limitedMobSpawner, dataFields.size() - 1); - currentDataField = dataFields.size() - 1; - numberOfFields++; - break; - default: - throw new IllegalStateException("Button action does not exist."); - } - } - } - - public void closeGui() { - this.mc.displayGuiScreen((GuiScreen) null); - } - - public void loadGuiFromTileEntity() { - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).loadFromTileEntity(limitedMobSpawner, i); - } - } - - public void saveGuiToTileEntity() { - if (limitedMobSpawner.getSpawnList() == null) { - limitedMobSpawner.setSpawnList(new ArrayList()); - } - limitedMobSpawner.getSpawnList().clear(); - for (int i = 0; i < dataFields.size(); i++) { - dataFields.get(i).saveToTileEntity(limitedMobSpawner); - } - if (limitedMobSpawner.getSpawnList().isEmpty()) { - limitedMobSpawner.setSpawnList(null); - } - limitedMobSpawner.syncToServer(); - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - super.keyTyped(keyChar, keyID); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).keyboardInput(keyChar, keyID); - } - } - - @Override - protected void mouseClicked(int par1, int par2, int par3) { - super.mouseClicked(par1, par2, par3); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).mouseClicked(this, mc, par1, par2, par3); - } - - if (currentListType != ListType.NONE) { - scrollingList.mouseClicked(par1, par2, par3); - } - } - - /** - * Draws the screen and all the components in it. - */ - // creaturelistgui.png - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - if (dataFields.get(currentDataField).isEnabled()) { - dataFields.get(currentDataField).render(mc, par1, par2, par3, new Point(this.width, this.height), - backgroundSize); - } - - String titleString = "Edit Mob Spawner Settings " + Integer.toString(currentDataField) + "/" - + Integer.toString(dataFields.size() - 1); - fontRendererObj.drawString(titleString, (width - fontRendererObj.getStringWidth(titleString)) / 2, - (height - backgroundSize.getY()) / 2 + 8, 4210752); // White: 16777215 - super.drawScreen(par1, par2, par3); - - if (currentListType != ListType.NONE) { - scrollingList.drawBackground(); - scrollingList.drawScreen(new Point(this.width, this.height), backgroundSize, par1, par2, par3); - } - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.bindTexture(SPAWNER_GUI); - int xCoord = (width - backgroundSize.getX()) / 2; - int yCoord = (height - backgroundSize.getY()) / 2; - this.drawTexturedModalRect(xCoord, yCoord, 0, 0, backgroundSize.getX(), backgroundSize.getY()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f1bd6300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f1bd6300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c25e305..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/c9/f1bd6300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserModSpawn extends KeyParserBase { - - public KeyParserModSpawn(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSpawn = entity.getCanSpawnHere(); - return isInverted ? canSpawn : !canSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/0167aff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/0167aff4c42100141fce95f06aba7e85 deleted file mode 100644 index 5888a1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/0167aff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.blocks.itemblockdeclarations.StructurePlacerDeclaration; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.world.terrain.CathedralFeature; -import com.ngb.projectzulu.common.world.terrain.CemetaryFeature; -import com.ngb.projectzulu.common.world.terrain.LabyrinthFeature; -import com.ngb.projectzulu.common.world.terrain.OasisFeature; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_World extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.WorldModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new StructurePlacerDeclaration()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new PyramidFeature(), new LabyrinthFeature(), new CemetaryFeature(), - new OasisFeature(), new CathedralFeature()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/31984ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/31984ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 7c7b253..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/31984ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionRegeneration extends SubItemPotionHalfPower { - - public SubItemPotionRegeneration(Item itemID, int subID) { - super(itemID, subID, "Regeneration"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 15, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.regeneration); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/41e2e1f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/41e2e1f7c42100141fce95f06aba7e85 deleted file mode 100644 index 2c74d6e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/41e2e1f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/50e6def5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/50e6def5c42100141fce95f06aba7e85 deleted file mode 100644 index 4e3b1be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/50e6def5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/607b129fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/607b129fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dfda6f6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/607b129fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityElephant; -import projectzulu.common.mobs.models.ModelElephant; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/618d00e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/618d00e6c42100141fce95f06aba7e85 deleted file mode 100644 index ea3f172..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/618d00e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWeakness extends SubItemPotionHalfPower { - - public SubItemPotionWeakness(Item itemID, int subID) { - super(itemID, subID, "Weakness"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.weakness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90dcb9e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90dcb9e4c42100141fce95f06aba7e85 deleted file mode 100644 index 86de767..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/90dcb9e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon; - -public enum ButtonIDs { - NEWENTRY(-1), SAVENCLOSE(-2), DELENTRY(-6), CANCEL(-3), FORWARD(-4), BACKWARDS(-5); - - int index; - - ButtonIDs(int index) { - this.index = index; - } - - public static ButtonIDs getButtonByIndex(int index) { - for (ButtonIDs buttonID : ButtonIDs.values()) { - if (buttonID.index == index) { - return buttonID; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/9259c5f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/9259c5f7c42100141fce95f06aba7e85 deleted file mode 100644 index fb36379..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/9259c5f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/a22dbef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/a22dbef7c42100141fce95f06aba7e85 deleted file mode 100644 index c9f4922..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/a22dbef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemMobHeads extends ItemBlock { - - public ItemMobHeads(Block mobHeads) { - super(mobHeads); - this.setCreativeTab(CreativeTabs.tabDecorations); - setMaxDamage(0); - setHasSubtypes(true); - maxStackSize = 8; - } - - // @Override - // @SideOnly(Side.CLIENT) - // public IIcon getIconFromDamage(int par1) { - // return Block.blocksList[this.itemID].getIcon(2, par1); - // } - - /** - * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return - * True if something happen and false if it don't. This is for ITEMS, not BLOCKS - */ - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - if (par7 == 0) { - return false; - } else if (!par3World.getBlock(par4, par5, par6).getMaterial().isSolid()) { - return false; - } else { - if (par7 == 1) { - ++par5; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else if (!BlockList.mobHeads.get().canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else if (BlockList.mobHeads.isPresent()) { - par3World.setBlock(par4, par5, par6, BlockList.mobHeads.get(), par7, 3); - int var11 = 0; - - if (par7 == 1) { - var11 = MathHelper.floor_double((double) (par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - - TileEntity var12 = par3World.getTileEntity(par4, par5, par6); - - if (var12 != null && var12 instanceof TileEntityMobHeads) { - String var13 = ""; - - if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { - var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - - ((TileEntityMobHeads) var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntityMobHeads) var12).setRotation(var11); - /* Was Used to Summon wither For Block Skulls */ - // ((BlockSkull)Block.field_82512_cj).func_82529_a(par3World, par4, par5, par6, - // (TileEntitySkull)var12); - } - - --par1ItemStack.stackSize; - return true; - } else { - return false; - } - } - } - - /** - * Returns the metadata of the block which this Item (ItemBlock) can place - */ - public int getMetadata(int par1) { - return par1; - } - - /* - * for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. - * delete this part and all your blocks have the same name. - */ - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return itemstack.getItem().getUnlocalizedName() + "." - + BlockMobHeads.Head.getByMeta(itemstack.getItemDamage()).toString().toLowerCase(); - } - - @Override - public IIcon getIconFromDamage(int par1) { - return field_150939_a.getIcon(1, par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/c05a7ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/c05a7ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 0307d02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/c05a7ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,184 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import com.ngb.projectzulu.common.core.RenderHelper; -import com.ngb.projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/d06db69dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/d06db69dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b51432b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/d06db69dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f00b05f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f00b05f6c42100141fce95f06aba7e85 deleted file mode 100644 index 8a769e5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f00b05f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBoar extends EntityGenericAnimal implements IAnimals { - public EntityBoar(World par1World) { - super(par1World); - setSize(1.2f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public int getTotalArmorValue() { - return 1; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "boarliving"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f11a99ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f11a99ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2c8ae38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ca/f11a99ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/203f16f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/203f16f5c42100141fce95f06aba7e85 deleted file mode 100644 index 9991a12..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/203f16f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandSingle extends BlockBrewingStandBase { - - public BlockBrewingStandSingle(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new TileEntityBrewingSingle(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20cef99fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20cef99fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c6ecb6e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/20cef99fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/30812bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/30812bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index dd2714b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/30812bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/400f31f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/400f31f4c42100141fce95f06aba7e85 deleted file mode 100644 index 5394f2d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/400f31f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectPyramid; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/40ce14f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/40ce14f7c42100141fce95f06aba7e85 deleted file mode 100644 index 58754a4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/40ce14f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeSapling; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/507045f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/507045f6c42100141fce95f06aba7e85 deleted file mode 100644 index e0d278d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/507045f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,93 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserBase extends KeyParser { - - public final Key key; - public final boolean isInvertable; - public final KeyType isChainable; - - public KeyParserBase(Key key, boolean isInvertable, KeyType isChainable) { - this.key = key; - this.isInvertable = isInvertable; - this.isChainable = isChainable; - } - - @Override - public boolean isMatch(String string) { - if (string == null) { - return false; - } - - Character character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - character = isFirstSpecial(string); - if (isSpecialCharValid(character)) { - string = string.substring(1); - } - } - - return string.equalsIgnoreCase(key.key); - } - - protected final Character isFirstSpecial(String string) { - return isIndexSpecial(string, 0); - } - - protected final Character isIndexSpecial(String string, int index) { - if (string.length() <= index) { - return null; - } - if (string.startsWith("&") || string.startsWith("|") || string.startsWith("!")) { - return string.charAt(index); - } - return null; - } - - protected final boolean isSpecialCharValid(Character character) { - if (character == null) { - return false; - } - if (character.equals('&') || character.equals('|')) { - return getKeyType() == KeyType.CHAINABLE || getKeyType() == KeyType.PARENT; - } else if (character.equals('!')) { - return isInvertable; - } - return false; - } - - @Override - public boolean isInverted(String string) { - Character first = isIndexSpecial(string, 0); - Character second = isIndexSpecial(string, 1); - if ((first != null && first.equals('!')) || (second != null && second.equals('!'))) { - return true; - } - return false; - } - - public Operand parseOperand(String[] parseable) { - return parseOperand(parseable[0]); - } - - @Override - public Operand parseOperand(String parseable) { - Operand operand = Operand.OR; - if (parseable.charAt(0) == '&' || parseable.charAt(1) == '&') { - operand = Operand.AND; - } - return operand; - } - - @Override - public boolean isInvertable() { - return isInvertable; - } - - @Override - public KeyType getKeyType() { - return isChainable; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/50864ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/50864ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index abd0d74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/50864ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/508be2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/508be2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6106606..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/508be2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,529 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelCrocodile extends ModelBase { - ModelRenderer MOUTHBOTROT; - ModelRenderer MOUTHTOPROT; - ModelRenderer BODY1ROT; - private ModelRenderer EYEBALLLEFROT; - private ModelRenderer EYEBALLRIGROT; - private ModelRenderer BODY2ROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer BODY3ROT; - private ModelRenderer BODY4ROT; - private ModelRenderer BODY5ROT; - private ModelRenderer BODY6ROT; - private ModelRenderer TAIL1ROT; - private ModelRenderer TAIL2ROT; - private ModelRenderer TAIL3ROT; - private ModelRenderer TAILROT4; - private ModelRenderer TAILROT5; - private ModelRenderer TAILROT6; - private ModelRenderer TAILROT7; - private ModelRenderer TAILROT8; - private ModelRenderer TAILROT9; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - - public ModelCrocodile() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("MOUTHBOTROT.headbot1", 98, 0); - setTextureOffset("MOUTHBOTROT.headbot4", 109, 18); - setTextureOffset("MOUTHBOTROT.headbot2", 107, 10); - setTextureOffset("MOUTHBOTROT.headbot3", 115, 18); - setTextureOffset("MOUTHBOTROT.teethbot6", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot7", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot10", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot8", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot1", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot2", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot3", 24, 0); - setTextureOffset("MOUTHBOTROT.teethbot5", 24, 0); - setTextureOffset("MOUTHTOPROT.headtop1", 98, 23); - setTextureOffset("MOUTHTOPROT.headtop2", 107, 34); - setTextureOffset("MOUTHTOPROT.headtop3", 113, 42); - setTextureOffset("MOUTHTOPROT.headtopdecor9", 94, 23); - setTextureOffset("MOUTHTOPROT.headtop4", 105, 42); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop1", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop2", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop3", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop4", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop5", 24, 2); - setTextureOffset("MOUTHTOPROT.teethtop6", 24, 0); - setTextureOffset("EYEBALLLEFROT.headtopdecor1", 98, 19); - setTextureOffset("EYEBALLLEFROT.headtopdecor2", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor4", 98, 21); - setTextureOffset("EYEBALLLEFROT.headtopdecor3", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor5", 98, 19); - setTextureOffset("EYEBALLRIGROT.headtopdecor6", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor7", 98, 21); - setTextureOffset("EYEBALLRIGROT.headtopdecor8", 98, 21); - setTextureOffset("BODY1ROT.Body1", 62, 0); - setTextureOffset("BODY1ROT.bodydeclef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef1", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig1", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig1", 0, 0); - setTextureOffset("BODY1ROT.Shape1", 0, 0); - setTextureOffset("BODY1ROT.bodydeclef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinlef2", 0, 0); - setTextureOffset("BODY1ROT.bodydecrig2", 0, 0); - setTextureOffset("BODY1ROT.bodydecinrig2", 0, 0); - setTextureOffset("BODY2ROT.Body2", 62, 0); - setTextureOffset("BODY2ROT.bodydeclef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef3", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig3", 0, 0); - setTextureOffset("BODY2ROT.bodydeclef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinlef4", 0, 0); - setTextureOffset("BODY2ROT.bodydecinrig4", 0, 0); - setTextureOffset("BODY2ROT.bodydecrig4", 0, 0); - setTextureOffset("LEG2TOPROT.leg2top", 20, 12); - setTextureOffset("LEG2TOPROT.leg2deco", 16, 8); - setTextureOffset("LEG2BOTROT.leg2bot", 16, 20); - setTextureOffset("LEG1TOPROT.leg1top", 0, 12); - setTextureOffset("LEG1TOPROT.leg1deco", 0, 8); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 20); - setTextureOffset("BODY3ROT.Body3", 62, 0); - setTextureOffset("BODY3ROT.bodydeclef5", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig5", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef5", 0, 0); - setTextureOffset("BODY3ROT.bodydeclef6", 0, 0); - setTextureOffset("BODY3ROT.bodydecrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinrig6", 0, 0); - setTextureOffset("BODY3ROT.bodydecinlef6", 0, 0); - setTextureOffset("BODY4ROT.Body4", 62, 0); - setTextureOffset("BODY4ROT.bodydecinrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig7", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef7", 0, 0); - setTextureOffset("BODY4ROT.bodydecinrig8", 0, 0); - setTextureOffset("BODY4ROT.bodydecinlef8", 0, 0); - setTextureOffset("BODY4ROT.bodydeclef8", 0, 0); - setTextureOffset("BODY4ROT.bodydecrig8", 0, 0); - setTextureOffset("BODY5ROT.Body5", 62, 0); - setTextureOffset("BODY5ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY5ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY5ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY5ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY5ROT.bodydecrig10", 0, 0); - setTextureOffset("BODY6ROT.Body6", 62, 0); - setTextureOffset("BODY6ROT.bodydecinrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig9", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef9", 0, 0); - setTextureOffset("BODY6ROT.bodydecinrig10", 0, 0); - setTextureOffset("BODY6ROT.bodydecinlef10", 0, 0); - setTextureOffset("BODY6ROT.bodydeclef10", 0, 0); - setTextureOffset("BODY6ROT.bodydecrig10", 0, 0); - setTextureOffset("TAIL1ROT.tail1", 62, 12); - setTextureOffset("TAIL1ROT.bodydecinlef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecinrig11", 0, 0); - setTextureOffset("TAIL1ROT.bodydeclef11", 0, 0); - setTextureOffset("TAIL1ROT.bodydecrig11", 0, 0); - setTextureOffset("TAIL2ROT.tail2", 62, 22); - setTextureOffset("TAIL2ROT.bodydeclef12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinrig12", 0, 0); - setTextureOffset("TAIL2ROT.bodydecinlef12", 0, 0); - setTextureOffset("TAIL3ROT.tail3", 62, 31); - setTextureOffset("TAIL3ROT.bodydecrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinrig13", 0, 0); - setTextureOffset("TAIL3ROT.bodydecinlef13", 0, 0); - setTextureOffset("TAIL3ROT.bodydeclef13", 0, 0); - setTextureOffset("TAILROT4.tail4", 62, 40); - setTextureOffset("TAILROT4.bodydecrig14", 0, 0); - setTextureOffset("TAILROT4.bodydecinlef14", 0, 0); - setTextureOffset("TAILROT4.bodydeclef14", 0, 0); - setTextureOffset("TAILROT5.tail5", 62, 48); - setTextureOffset("TAILROT5.bodydeclef15", 0, 0); - setTextureOffset("TAILROT5.bodydecrig16", 0, 0); - setTextureOffset("TAILROT5.bodydecrig15", 0, 0); - setTextureOffset("TAILROT5.bodydeclef16", 0, 0); - setTextureOffset("TAILROT6.tail6", 84, 49); - setTextureOffset("TAILROT6.bodydeclef17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig17", 0, 0); - setTextureOffset("TAILROT6.bodydecrig18", 0, 0); - setTextureOffset("TAILROT6.bodydeclef18", 0, 0); - setTextureOffset("TAILROT7.tail7", 90, 44); - setTextureOffset("TAILROT7.bodydecrig19", 0, 0); - setTextureOffset("TAILROT7.bodydeclef19", 0, 0); - setTextureOffset("TAILROT8.tail8", 94, 40); - setTextureOffset("TAILROT8.bodydecrig20", 0, 0); - setTextureOffset("TAILROT8.bodydeclef20", 0, 0); - setTextureOffset("TAILROT9.tail9", 98, 37); - setTextureOffset("LEG4TOPROT.leg4top", 20, 12); - setTextureOffset("LEG4TOPROT.leg4deco", 16, 8); - setTextureOffset("LEG4BOTROT.leg4bot", 16, 20); - setTextureOffset("LEG3TOPROT.leg3top", 0, 12); - setTextureOffset("LEG3TOPROT.leg3deco", 0, 8); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 20); - - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("headbot1", -4F, 0F, -7F, 8, 3, 7); - MOUTHBOTROT.addBox("headbot4", -1F, 0F, -16F, 2, 1, 1); - MOUTHBOTROT.addBox("headbot2", -3F, 0F, -12F, 6, 3, 5); - MOUTHBOTROT.addBox("headbot3", -2F, 0F, -15F, 4, 2, 3); - MOUTHBOTROT.addBox("teethbot6", 3F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot7", 2F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot10", 1F, -1F, -14F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot8", 2F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot1", -4F, -1F, -5F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot2", -3F, -1F, -8F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot3", -3F, -1F, -10F, 1, 1, 1); - MOUTHBOTROT.addBox("teethbot5", -2F, -1F, -14F, 1, 1, 1); - MOUTHTOPROT = new ModelRenderer(this, "MOUTHTOPROT"); - MOUTHTOPROT.setRotationPoint(0F, 18F, -7F); - setRotation(MOUTHTOPROT, 0F, 0F, 0F); - MOUTHTOPROT.mirror = true; - MOUTHTOPROT.addBox("headtop1", -4.5F, -4F, -7F, 9, 4, 7); - MOUTHTOPROT.addBox("headtop2", -3.5F, -3F, -12F, 7, 3, 5); - MOUTHTOPROT.addBox("headtop3", -2.5F, -2F, -15F, 5, 2, 3); - MOUTHTOPROT.addBox("headtopdecor9", -1.5F, -5F, -3.5F, 3, 1, 2); - MOUTHTOPROT.addBox("headtop4", -1.5F, -1F, -16F, 3, 1, 1); - MOUTHTOPROT.addBox("teethtop2", -4.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", -2.5F, 0F, -14F, 1, 1, 1); - MOUTHTOPROT.addBox("teethtop3", -4.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", -3.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", -3.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", -4.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop1", 3.5F, 0F, -2F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop2", 3.5F, 0F, -4F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop3", 3.5F, 0F, -6F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop4", 2.5F, 0F, -9F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop5", 2.5F, 0F, -11F, 1, 2, 1); - MOUTHTOPROT.addBox("teethtop6", 1.5F, 0F, -14F, 1, 1, 1); - EYEBALLLEFROT = new ModelRenderer(this, "EYEBALLLEFROT"); - EYEBALLLEFROT.setRotationPoint(-2.5F, -4.5F, -2.5F); - setRotation(EYEBALLLEFROT, 0F, 0F, 0F); - EYEBALLLEFROT.mirror = true; - EYEBALLLEFROT.addBox("headtopdecor1", -1.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor2", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor4", -1F, -1.5F, -0.5F, 2, 1, 1); - EYEBALLLEFROT.addBox("headtopdecor3", -1F, -0.5F, -1.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLLEFROT); - EYEBALLRIGROT = new ModelRenderer(this, "EYEBALLRIGROT"); - EYEBALLRIGROT.setRotationPoint(2.5F, -4.5F, -2.5F); - setRotation(EYEBALLRIGROT, 0F, 0F, 0F); - EYEBALLRIGROT.mirror = true; - EYEBALLRIGROT.addBox("headtopdecor5", -0.5F, -0.5F, -0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor6", -1F, -0.5F, -1.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor7", -1F, -0.5F, 0.5F, 2, 1, 1); - EYEBALLRIGROT.addBox("headtopdecor8", -1F, -1.5F, -0.5F, 2, 1, 1); - MOUTHTOPROT.addChild(EYEBALLRIGROT); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 17F, -7F); - setRotation(BODY1ROT, 0F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("Body1", -7F, -4F, 0F, 14, 8, 4); - BODY1ROT.addBox("bodydeclef1", -5.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef1", -2F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig1", 1F, -5F, 0.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig1", 4.5F, -5F, 1F, 1, 1, 1); - BODY1ROT.addBox("Shape1", 0F, 0F, 0F, 1, 1, 1); - BODY1ROT.addBox("bodydeclef2", -5.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinlef2", -2F, -5F, 2.5F, 1, 1, 1); - BODY1ROT.addBox("bodydecrig2", 4.5F, -5F, 3F, 1, 1, 1); - BODY1ROT.addBox("bodydecinrig2", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("Body2", -7F, -4F, 0F, 14, 8, 4); - BODY2ROT.addBox("bodydeclef3", -5.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef3", -2F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig3", 4.5F, -5F, 1F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig3", 1F, -5F, 0.5F, 1, 1, 1); - BODY2ROT.addBox("bodydeclef4", -5.5F, -5F, 3F, 1, 1, 1); - BODY2ROT.addBox("bodydecinlef4", -2F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecinrig4", 1F, -5F, 2.5F, 1, 1, 1); - BODY2ROT.addBox("bodydecrig4", 4.5F, -5F, 3F, 1, 1, 1); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(7F, 1F, 2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", 0F, -2F, -2F, 6, 4, 4); - LEG2TOPROT.addBox("leg2deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2F, 0F, -2F, 4, 4, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY2ROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-8F, 1F, 2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -5F, -2F, -2F, 6, 4, 4); - LEG1TOPROT.addBox("leg1deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -2F, 0F, -2F, 4, 4, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY2ROT.addChild(LEG1TOPROT); - BODY3ROT = new ModelRenderer(this, "BODY3ROT"); - BODY3ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY3ROT, 0F, 0F, 0F); - BODY3ROT.mirror = true; - BODY3ROT.addBox("Body3", -7F, -4F, 0F, 14, 8, 4); - BODY3ROT.addBox("bodydeclef5", -5.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig5", 4.5F, -5F, 1F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig5", 1F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef5", -2F, -5F, 0.5F, 1, 1, 1); - BODY3ROT.addBox("bodydeclef6", -5.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecrig6", 4.5F, -5F, 3F, 1, 1, 1); - BODY3ROT.addBox("bodydecinrig6", 1F, -5F, 2.5F, 1, 1, 1); - BODY3ROT.addBox("bodydecinlef6", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT = new ModelRenderer(this, "BODY4ROT"); - BODY4ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY4ROT, 0F, 0F, 0F); - BODY4ROT.mirror = true; - BODY4ROT.addBox("Body4", -7F, -4F, 0F, 14, 8, 4); - BODY4ROT.addBox("bodydecinrig7", 1F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef7", -2F, -5F, 0.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig7", 4.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef7", -5.5F, -5F, 1F, 1, 1, 1); - BODY4ROT.addBox("bodydecinrig8", 1F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydecinlef8", -2F, -5F, 2.5F, 1, 1, 1); - BODY4ROT.addBox("bodydeclef8", -5.5F, -5F, 3F, 1, 1, 1); - BODY4ROT.addBox("bodydecrig8", 4.5F, -5F, 3F, 1, 1, 1); - BODY5ROT = new ModelRenderer(this, "BODY5ROT"); - BODY5ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY5ROT, 0F, 0F, 0F); - BODY5ROT.mirror = true; - BODY5ROT.addBox("Body5", -7F, -4F, 0F, 14, 8, 4); - BODY5ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY5ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY5ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY5ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - BODY6ROT = new ModelRenderer(this, "BODY6ROT"); - BODY6ROT.setRotationPoint(0F, 0F, 4F); - setRotation(BODY6ROT, 0F, 0F, 0F); - BODY6ROT.mirror = true; - BODY6ROT.addBox("Body6", -7F, -4F, 0F, 14, 8, 4); - BODY6ROT.addBox("bodydecinrig9", 1F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef9", -2F, -5F, 0.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig9", 4.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef9", -5.5F, -5F, 1F, 1, 1, 1); - BODY6ROT.addBox("bodydecinrig10", 1F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydecinlef10", -2F, -5F, 2.5F, 1, 1, 1); - BODY6ROT.addBox("bodydeclef10", -5.5F, -5F, 3F, 1, 1, 1); - BODY6ROT.addBox("bodydecrig10", 4.5F, -5F, 3F, 1, 1, 1); - TAIL1ROT = new ModelRenderer(this, "TAIL1ROT"); - TAIL1ROT.setRotationPoint(0F, 0F, 4F); - setRotation(TAIL1ROT, 0F, 0F, 0F); - TAIL1ROT.mirror = true; - TAIL1ROT.addBox("tail1", -6F, -3.5F, 0F, 12, 7, 3); - TAIL1ROT.addBox("bodydecinlef11", -2F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydecinrig11", 1F, -4.5F, 0.5F, 1, 1, 1); - TAIL1ROT.addBox("bodydeclef11", -5F, -4.5F, 1F, 1, 1, 1); - TAIL1ROT.addBox("bodydecrig11", 4F, -4.5F, 1F, 1, 1, 1); - TAIL2ROT = new ModelRenderer(this, "TAIL2ROT"); - TAIL2ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL2ROT, 0F, 0F, 0F); - TAIL2ROT.mirror = true; - TAIL2ROT.addBox("tail2", -5.5F, -2.5F, 0F, 11, 6, 3); - TAIL2ROT.addBox("bodydeclef12", -4.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecrig12", 3.5F, -3.5F, 1F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinrig12", 1F, -3.5F, 0.5F, 1, 1, 1); - TAIL2ROT.addBox("bodydecinlef12", -2F, -3.5F, 0.5F, 1, 1, 1); - TAIL3ROT = new ModelRenderer(this, "TAIL3ROT"); - TAIL3ROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAIL3ROT, 0F, 0F, 0F); - TAIL3ROT.mirror = true; - TAIL3ROT.addBox("tail3", -4.5F, -1.5F, 0F, 9, 5, 4); - TAIL3ROT.addBox("bodydecrig13", 2.5F, -2.5F, 1.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinrig13", 0.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydecinlef13", -1.5F, -2.5F, 0.5F, 1, 1, 1); - TAIL3ROT.addBox("bodydeclef13", -4F, -2.5F, 1.5F, 1, 1, 1); - TAILROT4 = new ModelRenderer(this, "TAILROT4"); - TAILROT4.setRotationPoint(0F, 1.5F, 4F); - setRotation(TAILROT4, 0F, 0F, 0F); - TAILROT4.mirror = true; - TAILROT4.addBox("tail4", -4F, -2F, 0F, 8, 4, 4); - TAILROT4.addBox("bodydecrig14", 2F, -3F, 1.5F, 1, 1, 1); - TAILROT4.addBox("bodydecinlef14", -0.5F, -3F, 0.5F, 1, 1, 1); - TAILROT4.addBox("bodydeclef14", -3F, -3F, 1.5F, 1, 1, 1); - TAILROT5 = new ModelRenderer(this, "TAILROT5"); - TAILROT5.setRotationPoint(0F, 0.5F, 4F); - setRotation(TAILROT5, 0F, 0F, 0F); - TAILROT5.mirror = true; - TAILROT5.addBox("tail5", -3F, -1.5F, 0F, 6, 3, 5); - TAILROT5.addBox("bodydeclef15", -2F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig16", 1F, -2.5F, 3.5F, 1, 1, 1); - TAILROT5.addBox("bodydecrig15", 1F, -2.5F, 1.5F, 1, 1, 1); - TAILROT5.addBox("bodydeclef16", -2F, -2.5F, 3.5F, 1, 1, 1); - TAILROT6 = new ModelRenderer(this, "TAILROT6"); - TAILROT6.setRotationPoint(0F, 0.5F, 5F); - setRotation(TAILROT6, 0F, 0F, 0F); - TAILROT6.mirror = true; - TAILROT6.addBox("tail6", -2.5F, -1F, 0F, 5, 2, 5); - TAILROT6.addBox("bodydeclef17", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig17", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT6.addBox("bodydecrig18", 0.5F, -2F, 3F, 1, 1, 1); - TAILROT6.addBox("bodydeclef18", -1.5F, -2F, 3F, 1, 1, 1); - TAILROT7 = new ModelRenderer(this, "TAILROT7"); - TAILROT7.setRotationPoint(0F, 0F, 5F); - setRotation(TAILROT7, 0F, 0F, 0F); - TAILROT7.mirror = true; - TAILROT7.addBox("tail7", -2F, -1F, 0F, 4, 2, 3); - TAILROT7.addBox("bodydecrig19", 0.5F, -2F, 1F, 1, 1, 1); - TAILROT7.addBox("bodydeclef19", -1.5F, -2F, 1F, 1, 1, 1); - TAILROT8 = new ModelRenderer(this, "TAILROT8"); - TAILROT8.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT8, 0F, 0F, 0F); - TAILROT8.mirror = true; - TAILROT8.addBox("tail8", -1.5F, -1F, 0F, 3, 2, 2); - TAILROT8.addBox("bodydecrig20", 0.5F, -2F, 0.5F, 1, 1, 1); - TAILROT8.addBox("bodydeclef20", -1.5F, -2F, 0.5F, 1, 1, 1); - TAILROT9 = new ModelRenderer(this, "TAILROT9"); - TAILROT9.setRotationPoint(0F, 0F, 2F); - setRotation(TAILROT9, 0F, 0F, 0F); - TAILROT9.mirror = true; - TAILROT9.addBox("tail9", -1F, -1F, 0F, 2, 2, 1); - TAILROT8.addChild(TAILROT9); - TAILROT7.addChild(TAILROT8); - TAILROT6.addChild(TAILROT7); - TAILROT5.addChild(TAILROT6); - TAILROT4.addChild(TAILROT5); - TAIL3ROT.addChild(TAILROT4); - TAIL2ROT.addChild(TAIL3ROT); - TAIL1ROT.addChild(TAIL2ROT); - BODY6ROT.addChild(TAIL1ROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(7F, 1F, 0F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", 0F, -2F, -2F, 6, 4, 4); - LEG4TOPROT.addBox("leg4deco", 0F, -3F, -1.5F, 5, 1, 3); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(4F, 2F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -2F, 0F, -2F, 4, 4, 4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODY6ROT.addChild(LEG4TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-8F, 1F, 0F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -5F, -2F, -2F, 6, 4, 4); - LEG3TOPROT.addBox("leg3deco", -4F, -3F, -1.5F, 5, 1, 3); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(-3F, 2F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -2F, 0F, -2F, 4, 4, 4); - LEG3TOPROT.addChild(LEG3BOTROT); - BODY6ROT.addChild(LEG3TOPROT); - BODY5ROT.addChild(BODY6ROT); - BODY4ROT.addChild(BODY5ROT); - BODY3ROT.addChild(BODY4ROT); - BODY2ROT.addChild(BODY3ROT); - BODY1ROT.addChild(BODY2ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 6.0F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.7F / var8, 1.7F / var8, 1.7F / var8); - GL11.glTranslatef(0.0f, field_78145_g * f5, field_78151_h * f5); - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODY1ROT.render(f5); - GL11.glPopMatrix(); - } else { - MOUTHBOTROT.render(f5); - MOUTHTOPROT.render(f5); - BODY1ROT.render(f5); - - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG2TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG1TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODY1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 0 / 4 * (float) Math.PI) * 0.1F * par3; - BODY2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; - BODY3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 2 / 4 * (float) Math.PI) * 0.1F * par3; - BODY4ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 3 / 4 * (float) Math.PI) * 0.1F * par3; - BODY5ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 4 / 4 * (float) Math.PI) * 0.1F * par3; - BODY6ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 5 / 4 * (float) Math.PI) * 0.1F * par3; - - TAIL1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 6 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 7 / 4 * (float) Math.PI) * 0.1F * par3; - TAIL3ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 8 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT4.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 9 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT5.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 10 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT6.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 11 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT7.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 12 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT8.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 13 / 4 * (float) Math.PI) * 0.1F * par3; - TAILROT9.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 14 / 4 * (float) Math.PI) * 0.1F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - MOUTHTOPROT.rotateAngleX = -Math.abs(MathHelper.cos(f * 0.6662F) * f1) + Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - MOUTHTOPROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - - MOUTHBOTROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - MOUTHBOTROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/60fc9501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/60fc9501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 46d4960..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/60fc9501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/625a44a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/625a44a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f781967..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/625a44a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/701582f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/701582f4c42100141fce95f06aba7e85 deleted file mode 100644 index 8925e3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/701582f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCarved; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericEdge; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericLimited; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import com.ngb.projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a03a19e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a03a19e5c42100141fce95f06aba7e85 deleted file mode 100644 index ee7feb4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a03a19e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Class Holds Entity Age Methods - * such as setting and saving age - */ -public class EntityGenericAgeable extends EntityGenericCreature{ - - public EntityGenericAgeable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Growing Age */ - this.dataWatcher.addObject(12, new Integer(0)); - } - /** - * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's - * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the - * Entity is considered a child. - */ - public int getGrowingAge() { return this.dataWatcher.getWatchableObjectInt(12); } - public void setGrowingAge(int par1) { this.dataWatcher.updateObject(12, Integer.valueOf(par1)); } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onUpdate() { - super.onUpdate(); - int var1 = this.getGrowingAge(); - - if (var1 < 0){ - ++var1; - this.setGrowingAge(var1); - } - else if (var1 > 0){ - --var1; - this.setGrowingAge(var1); - } - } - - @Override - public boolean isChild() { - return getGrowingAge() < 0; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a0a66a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a0a66a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5bcfbd7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a0a66a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a22e7e01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a22e7e01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9de43fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/a22e7e01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionFireResistance extends SubItemPotionGeneric { - - public SubItemPotionFireResistance(Item item, int subID) { - super(item, subID, "potion.fireResistance"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.fireResistance); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.INCENDIARY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INCENDIARY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b0097be5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b0097be5c42100141fce95f06aba7e85 deleted file mode 100644 index f8600cb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b0097be5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityOstrich; -import projectzulu.common.mobs.models.ModelOstrich; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class OstrichDeclaration extends SpawnableDeclaration { - - public OstrichDeclaration() { - super("Ostrich", 19, EntityOstrich.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (25 << 16) + (18 << 8) + 14; - eggColor2 = (232 << 16) + (107 << 8) + 101; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.32f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelOstrich(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "ostrich.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b09029a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b09029a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f5e9a65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b09029a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBearHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBearHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 20F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b0d1b2f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b0d1b2f9c42100141fce95f06aba7e85 deleted file mode 100644 index 543f6e2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/b0d1b2f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.potion.brewingstands.PotionIngredients.IngredientProperty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemGenerics extends Item implements IngredientProperty { - - public enum Properties { - /* Generic Items */ - PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - - /* Potion Effect Ingredients */ - BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( - "Antennae", 23, true), ShinyBauble("Shiny Bauble", 24, true), Talon("Talon", 25, true), Bark("Bark", - 27, true), SmallHeart("Small Heart", 28, true), LargeHeart("Large Heart", 29, true), Gill("Gill", 30, - true), Ectoplasm("Ectoplasm", 31), FrogLegs("Frog Legs", 32, true), RabbitsFoot("Rabbits Feet", 33, - true), PricklyPowder("Prickly Powder", 34, true), PowderSlush("Powder Slush", 35, true), GlowingGoo( - "Glowing Goo", 36, true), SmallUnhealthyHeart("Small Unhealthy Heart", 37, true), LargeUnhealthyHeart( - "Large Unhealthy Heart", 38, true); - - public final String displayName; - public final boolean isIngredient; - public final int meta; - - public int meta() { - return meta; - } - - @SideOnly(Side.CLIENT) - private IIcon icon; - - Properties(String name, int meta, boolean isIngredient) { - this.displayName = name; - this.meta = meta; - this.isIngredient = isIngredient; - } - - Properties(String name, int iconIndex) { - this(name, iconIndex, false); - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Properties getPropertyByMeta(int meta) { - for (Properties property : Properties.values()) { - if (property.meta == meta) { - return property; - } - } - return null; - } - } - - public ItemGenerics() { - super(); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Properties.getPropertyByMeta(par1).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - for (Properties type : Properties.values()) { - type.setIcon(par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + type.toString().toLowerCase())); - } - } - - @Override - public boolean isIngredient(ItemStack ingredient) { - Properties.getPropertyByMeta(ingredient.getItemDamage()); - return true; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - for (final Properties property : Properties.values()) { - if (property.meta == itemStack.getItemDamage()) { - return "item.".concat(property.displayName.toLowerCase().replaceAll("\\s", "")); - } - } - return ""; - } - - @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (final Properties property : Properties.values()) { - par3List.add(new ItemStack(item, 1, property.meta)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/e02fa2f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/e02fa2f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3df5e4c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cb/e02fa2f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,172 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.EnumSet; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; - -public class RenderHelper { - - public static enum Surface { - TOP(0), BOTTOM(1), - - /* +x is RIGHT */ - RIGHT(2), LEFT(3), - - /* +z is FRONT */ - FRONT(4), BACK(5); - public final int index; - - Surface(int index) { - this.index = index; - } - } - - public static boolean renderRotated2D(IIcon icon, float iconScale, RenderBlocks renderer, double posX, double posY, - double posZ, double xWidth, double yHeight, double angle) { - - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double minU = icon.getMinU(); - double maxU = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / iconScale; - double minV = icon.getMinV(); - double maxV = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / iconScale; - - double yMin = posY; - - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarX * Math.cos(angle); - - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + 0.0D, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + 0.0D, point1Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, maxU, minV); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle) { - renderRotatedRectangle(icon, iconScale, renderer, posX, posY, posZ, xWidth, yHeight, zWidth, angle, - EnumSet.allOf(Surface.class)); - return true; - } - - public static boolean renderRotatedRectangle(IIcon icon, float iconScale, RenderBlocks renderer, double posX, - double posY, double posZ, double xWidth, double yHeight, double zWidth, double angle, - EnumSet sidesToDraw) { - angle = angle * Math.PI / 180f; - Tessellator tessellator = Tessellator.instance; - double deltaU = icon.getMaxU() - icon.getMinU(); - double deltaV = icon.getMaxV() - icon.getMinV(); - double minU = icon.getMinU() + deltaU / 2 * (1 - 1 / iconScale); - double maxU = icon.getMaxU() - deltaU / 2 * (1 - 1 / iconScale); - double minV = icon.getMinV() + deltaV / 2 * (1 - 1 / iconScale); - double maxV = icon.getMaxV() - deltaV / 2 * (1 - 1 / iconScale); - - double yMin = posY; - - double intermedVarZ = -zWidth / 2; - double intermedVarX = +xWidth / 2; - double point1X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point1Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = -zWidth / 2; - intermedVarX = -xWidth / 2; - double point2X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point2Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = -xWidth / 2; - double point3X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point3Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - intermedVarZ = +zWidth / 2; - intermedVarX = +xWidth / 2; - double point4X = posX + 0.5D + intermedVarZ * Math.cos(angle) - intermedVarX * Math.sin(angle); - double point4Z = posZ + 0.5D + intermedVarZ * Math.sin(angle) + intermedVarX * Math.cos(angle); - - for (Surface surface : sidesToDraw) { - switch (surface) { - case RIGHT: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case LEFT: - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, minU, minV); - break; - case BACK: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - case FRONT: - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - - tessellator.addVertexWithUV(point2X, yMin, point2Z, maxU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, maxU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, minU, minV); - break; - case TOP: - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin + yHeight, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin + yHeight, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin + yHeight, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin + yHeight, point1Z, minU, minV); - break; - case BOTTOM: - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - - tessellator.addVertexWithUV(point4X, yMin, point4Z, maxU, minV); - tessellator.addVertexWithUV(point3X, yMin, point3Z, maxU, maxV); - tessellator.addVertexWithUV(point2X, yMin, point2Z, minU, maxV); - tessellator.addVertexWithUV(point1X, yMin, point1Z, minU, minV); - break; - } - - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/3145bda0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/3145bda0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c379644..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/3145bda0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemSetDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String[] name; - private boolean[] isEnabled; - private boolean[] isCreated; - - public ItemSetDeclaration(String[] name) { - this(name, 0); - } - - public ItemSetDeclaration(String[] name, int registerPass) { - this.registerPass = registerPass; - this.name = name; - - isEnabled = new boolean[name.length]; - isCreated = new boolean[name.length]; - for (int i = 0; i < name.length; i++) { - isEnabled[i] = true; - isCreated[i] = false; - } - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - for (int i = 0; i < name.length; i++) { - Property property = config.get("item", name[i] + " isEnabled", isEnabled[i]); - isEnabled[i] = property.getBoolean(isEnabled[i]); - if (isEnabled[i]) { - preCreateLoadConfig(config); - isCreated[i] = createItem(i); - postCreateLoadConfig(config); - } - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(int partIndex); - - @Override - public final void register(Side side) { - for (int i = 0; i < name.length; i++) { - if (isCreated[i]) { - registerItem(i); - if (!side.isServer()) { - clientRegisterBlock(i); - } - } - } - } - - protected abstract void registerItem(int partIndex); - - protected void clientRegisterBlock(int partIndex) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/40c20be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/40c20be4c42100141fce95f06aba7e85 deleted file mode 100644 index eaab348..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/40c20be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChatAllowedCharacters; -import net.minecraft.world.World; - -import org.lwjgl.input.Keyboard; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.packets.PacketNameSync; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiAnimalName extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ - private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Entity Name:"; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - World world; - EntityPlayer player; - /* ID of Entity to be Named */ - int entityID; - public String entityName = ""; - - public GuiAnimalName(World world, EntityPlayer player, int entityID) { - this.world = world; - this.player = player; - this.entityID = entityID; - entityName = ((EntityGenericTameable) world.getEntityByID(entityID)).getUsername(); - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - // this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketNameSync packet = new PacketNameSync().setPacketData(entityID, entityName); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called from the main game loop to update the screen. - */ - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - protected void keyTyped(char par1, int par2) { - if (par2 == 14 && this.entityName.length() > 0) { - this.entityName = this.entityName.substring(0, this.entityName.length() - 1); - } - - if (allowedCharacters[par1] >= 0 && this.entityName.length() < 10) { - this.entityName = this.entityName + par1; - } - } - - /** - * Draws the screen and all the components in it. - */ - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - this.drawCenteredString(fontRendererObj, this.screenTitle, this.width / 2, 40, 16777215); - this.drawCenteredString(fontRendererObj, this.entityName, this.width / 2, 40 + fontRendererObj.FONT_HEIGHT, - 16777215); - - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/418033f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/418033f4c42100141fce95f06aba7e85 deleted file mode 100644 index 19ca43d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/418033f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectLabyrinth; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/41887ff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/41887ff5c42100141fce95f06aba7e85 deleted file mode 100644 index ee536f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/41887ff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseBeige; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/41d8b79ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/41d8b79ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f157fad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/41d8b79ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,215 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityAerial extends EntityLiving { - - protected ChunkCoordinates targetPosition; - /** Tries to Assign targetPosition - * Checks if Valid first using isTargetPositionValid - * Returns False if invald - */ - public boolean setTargetPosition(ChunkCoordinates targetPosition){ - if(isTargetPositionValid(targetPosition)){ - this.targetPosition = targetPosition; - return true; - } - return false; - } - protected int maxFlightHeight = 20; - public int getMaxFlightHeight(){ return maxFlightHeight; } - public EntityAerial(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handle whether Entity is Flying or not*/ - if( defaultGrounded() ){ - this.dataWatcher.addObject(17, Byte.valueOf((byte)1)); - }else{ - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - } - - } - - public boolean defaultGrounded() { - return true; - } - - public boolean isEntityGrounded() { - return this.dataWatcher.getWatchableObjectByte(17) != 0; - } - protected void setEntityGrounded(Boolean par1) { - if(par1){ - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - }else { - this.dataWatcher.updateObject(17, Byte.valueOf((byte)0)); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("Is Grounded", this.dataWatcher.getWatchableObjectByte(17)); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - if(par1NBTTagCompound.hasKey("Is Grounded")){ - this.dataWatcher.updateObject(17, par1NBTTagCompound.getByte("Is Grounded")); - } - } - - @Override - protected void updateAITasks() { - if(!isEntityGrounded() && targetPosition != null){ - /* Get The Direction I want to travel in */ - double var1 = (double)this.targetPosition.posX + 0.5D - this.posX; - double var3 = (double)this.targetPosition.posY + 0.1D - this.posY; - double var5 = (double)this.targetPosition.posZ + 0.5D - this.posZ; - - /* Change Velocity */ - /* Normalize the Direction I want to travel in, then add and scale it to Motion */ - this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D*0.3D; - this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D*0.3D; - this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D*0.3D; - float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; - float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); - this.moveForward = 0.5F; - this.rotationYaw += var8; - } - super.updateAITasks(); - } - - protected boolean shouldBeFlying() { - return false; - } - - public boolean isTargetPositionValid(){ - return isTargetPositionValid(this.targetPosition); - } - - public boolean isTargetPositionValid(ChunkCoordinates targetPosition){ - /* Invalid if Water, is below height = 3 (superflat), and if its null */ - if (targetPosition != null && (!this.worldObj.isAirBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ) || targetPosition.posY < 3 - || this.worldObj.getBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ).getMaterial().equals(Material.water))){ -// targetPosition = null; - return false; - } - return true; - } - - /* Checks if Entity is at the target position, return true if TargetPosition is null*/ - public boolean atTargetPosition(){ - if(targetPosition != null){ - return getDistance(targetPosition.posX, targetPosition.posY, targetPosition.posZ) < 2; - } - return true; - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if(isEntityGrounded()){ - super.moveEntityWithHeading(par1, par2); - return; - } - - if (this.isInWater()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } - else if (this.handleLavaMovement()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - else - { - float var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double)var3; - this.motionY *= (double)var3; - this.motionZ *= (double)var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) - { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwing; - } - - - /** - * Method Designed for Flying Entities to adjust the Direction They are facing to the direction they are moving - */ - protected void adjustRotationToWaypoint() { - double var8 = targetPosition.posX - this.posX; - double var10 = targetPosition.posZ - this.posZ; - float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI);// - 90.0F; - float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); - - if (var15 > 30.0F){ - var15 = 30.0F; - } - - if (var15 < -30.0F){ - var15 = -30.0F; - } - this.renderYawOffset = this.rotationYaw += var15; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/712f31e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/712f31e5c42100141fce95f06aba7e85 deleted file mode 100644 index 421f59e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/712f31e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,116 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/b00b5a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/b00b5a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 500597d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/b00b5a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,1046 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entity.EntityTreeEnt; - -public class ModelTreeEnt extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTTOPROT; - ModelRenderer mosscb3; - ModelRenderer mosscf2; - ModelRenderer mosscf1; - ModelRenderer mosscf3; - ModelRenderer mosscb2; - ModelRenderer mosscb; - ModelRenderer body; - ModelRenderer ARMLEFTOPROT; - ModelRenderer mossual2; - ModelRenderer mossual3; - private ModelRenderer mossual1; - private ModelRenderer mossual5; - private ModelRenderer mossual4; - private ModelRenderer mossual6; - private ModelRenderer mossual7; - private ModelRenderer mossual8; - private ModelRenderer armleftop; - private ModelRenderer ARMLEFBOTROT; - private ModelRenderer fingerl1; - private ModelRenderer fingerl3; - private ModelRenderer fingerl2; - private ModelRenderer mosslal2; - private ModelRenderer mosslal1; - private ModelRenderer mosslal3; - private ModelRenderer mosslal5; - private ModelRenderer mosslal4; - private ModelRenderer armlefbot; - private ModelRenderer ARMRIGTOPROT; - private ModelRenderer mossuar3; - private ModelRenderer mossuar2; - private ModelRenderer mossuar1; - private ModelRenderer mossuar5; - private ModelRenderer mossuar4; - private ModelRenderer mossuar8; - private ModelRenderer mossuar6; - private ModelRenderer mossuar7; - private ModelRenderer armrigtop; - private ModelRenderer ARMRIGBOTROT; - private ModelRenderer fingerr3; - private ModelRenderer fingerr1; - private ModelRenderer fingerr2; - private ModelRenderer mosslar2; - private ModelRenderer mosslar1; - private ModelRenderer mosslar3; - private ModelRenderer mosslar4; - private ModelRenderer mosslar5; - private ModelRenderer armrigbot; - private ModelRenderer BACKTREESTEM6; - private ModelRenderer backtreesleaves6; - private ModelRenderer backtreestem6; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer backtreestem5; - private ModelRenderer backtreesleaves5; - private ModelRenderer BACKTREESTEM4; - private ModelRenderer backtreesleaves4; - private ModelRenderer backtreestem4; - private ModelRenderer BACKTREESTEM3; - private ModelRenderer backtreesleaves3; - private ModelRenderer backtreestem3; - private ModelRenderer BACKTREESTEM2; - private ModelRenderer backtreesleaves2; - private ModelRenderer backtreestem2; - private ModelRenderer BACKTREESTEM1; - private ModelRenderer backtreesleaves1; - private ModelRenderer backtreestem1; - private ModelRenderer HEADROT; - private ModelRenderer brow4; - private ModelRenderer NOSEROT; - private ModelRenderer nose2; - private ModelRenderer nose1; - private ModelRenderer nose3; - private ModelRenderer brow3; - private ModelRenderer brow1; - private ModelRenderer brow5; - private ModelRenderer brow2; - private ModelRenderer head; - private ModelRenderer mossulr1; - private ModelRenderer mossulr2; - private ModelRenderer legrigtop; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer mossllr2; - private ModelRenderer mossllr1; - private ModelRenderer toer6; - private ModelRenderer toer5; - private ModelRenderer toer4; - private ModelRenderer toer3; - private ModelRenderer toer2; - private ModelRenderer toer1; - private ModelRenderer legrigbot; - private ModelRenderer mossull2; - private ModelRenderer mossull1; - private ModelRenderer mossull4; - private ModelRenderer legleftop; - private ModelRenderer mossull3; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer toel4; - private ModelRenderer toel6; - private ModelRenderer toel5; - private ModelRenderer toel3; - private ModelRenderer toel2; - private ModelRenderer toel1; - private ModelRenderer mosslll1; - private ModelRenderer mosslll2; - private ModelRenderer leglefbot; - - public ModelTreeEnt() { - textureWidth = 128; - textureHeight = 64; - float heightToRaise = 8f; - // setTextureOffset("BODYROT.bodyfold", 0, 0); - // setTextureOffset("LEGRIGTOPROT.legrigtopfold", 0, 0); - // setTextureOffset("LEGLEFTTOPROT.legleftopfold", 0, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F - heightToRaise, 0.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - mosscb3 = new ModelRenderer(this, 0, 36); - mosscb3.addBox(0F, 0F, 0F, 7, 11, 3); - BODYROT.addChild(mosscb3); - mosscb3.setRotationPoint(-3.5F, -12F, 3F); - mosscb3.setTextureSize(128, 64); - mosscb3.mirror = true; - setRotation(mosscb3, 0F, 0F, 0F); - mosscf2 = new ModelRenderer(this, 0, 52); - mosscf2.addBox(-1.5F, -1.5F, -0.5F, 4, 6, 1); - BODYROT.addChild(mosscf2); - mosscf2.setRotationPoint(-4F, -4F, -3.5F); - mosscf2.setTextureSize(128, 64); - mosscf2.mirror = true; - setRotation(mosscf2, 0F, 0F, 0F); - mosscf1 = new ModelRenderer(this, 0, 52); - mosscf1.addBox(-1.5F, -1.5F, -0.5F, 5, 5, 1); - BODYROT.addChild(mosscf1); - mosscf1.setRotationPoint(1F, -8F, -3.5F); - mosscf1.setTextureSize(128, 64); - mosscf1.mirror = true; - setRotation(mosscf1, 0F, 0F, 0F); - mosscf3 = new ModelRenderer(this, 0, 52); - mosscf3.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - BODYROT.addChild(mosscf3); - mosscf3.setRotationPoint(4F, -1F, -3.5F); - mosscf3.setTextureSize(128, 64); - mosscf3.mirror = true; - setRotation(mosscf3, 0F, 0F, 0F); - mosscb2 = new ModelRenderer(this, 0, 28); - mosscb2.addBox(0F, 0F, 0F, 7, 3, 4); - BODYROT.addChild(mosscb2); - mosscb2.setRotationPoint(-3.5F, -15F, 1F); - mosscb2.setTextureSize(128, 64); - mosscb2.mirror = true; - setRotation(mosscb2, 0F, 0F, 0F); - mosscb = new ModelRenderer(this, 0, 20); - mosscb.addBox(0F, 0F, 0F, 9, 3, 4); - BODYROT.addChild(mosscb); - mosscb.setRotationPoint(-4.5F, -15F, -3F); - mosscb.setTextureSize(128, 64); - mosscb.mirror = true; - setRotation(mosscb, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 15, 14, 6); - BODYROT.addChild(body); - body.setRotationPoint(-8F, -12F, -3F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - ARMLEFTOPROT = new ModelRenderer(this, "ARMLEFTOPROT"); - BODYROT.addChild(ARMLEFTOPROT); - ARMLEFTOPROT.setRotationPoint(-10.5F, -10F, 0F); - setRotation(ARMLEFTOPROT, 0F, 0F, 0F); - ARMLEFTOPROT.mirror = true; - mossual2 = new ModelRenderer(this, 0, 52); - mossual2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual2); - mossual2.setRotationPoint(-0.5F, 8F, -3F); - mossual2.setTextureSize(128, 64); - mossual2.mirror = true; - setRotation(mossual2, 0F, 0F, 0F); - mossual3 = new ModelRenderer(this, 0, 52); - mossual3.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual3); - mossual3.setRotationPoint(-0.5F, 7F, -3F); - mossual3.setTextureSize(128, 64); - mossual3.mirror = true; - setRotation(mossual3, 0F, 0F, 0F); - mossual1 = new ModelRenderer(this, 0, 52); - mossual1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual1); - mossual1.setRotationPoint(0.5F, 1F, -3F); - mossual1.setTextureSize(128, 64); - mossual1.mirror = true; - setRotation(mossual1, 0F, 0F, 0F); - mossual5 = new ModelRenderer(this, 0, 52); - mossual5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMLEFTOPROT.addChild(mossual5); - mossual5.setRotationPoint(-3F, 11F, -1.5F); - mossual5.setTextureSize(128, 64); - mossual5.mirror = true; - setRotation(mossual5, 0F, 0F, 0F); - mossual4 = new ModelRenderer(this, 0, 52); - mossual4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFTOPROT.addChild(mossual4); - mossual4.setRotationPoint(-3F, 1F, -0.5F); - mossual4.setTextureSize(128, 64); - mossual4.mirror = true; - setRotation(mossual4, 0F, 0F, 0F); - mossual6 = new ModelRenderer(this, 0, 52); - mossual6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMLEFTOPROT.addChild(mossual6); - mossual6.setRotationPoint(0F, 7F, 2.333333F); - mossual6.setTextureSize(128, 64); - mossual6.mirror = true; - setRotation(mossual6, 0F, 0F, 0F); - mossual7 = new ModelRenderer(this, 0, 52); - mossual7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMLEFTOPROT.addChild(mossual7); - mossual7.setRotationPoint(-0.5F, 6F, 3.5F); - mossual7.setTextureSize(128, 64); - mossual7.mirror = true; - setRotation(mossual7, 0F, 0F, 0F); - mossual8 = new ModelRenderer(this, 0, 52); - mossual8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFTOPROT.addChild(mossual8); - mossual8.setRotationPoint(-0.5F, 0F, 3F); - mossual8.setTextureSize(128, 64); - mossual8.mirror = true; - setRotation(mossual8, 0F, 0F, 0F); - armleftop = new ModelRenderer(this, 42, 0); - armleftop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMLEFTOPROT.addChild(armleftop); - armleftop.setRotationPoint(0F, -2F, 0F); - armleftop.setTextureSize(128, 64); - armleftop.mirror = true; - setRotation(armleftop, 0F, 0F, 0F); - ARMLEFBOTROT = new ModelRenderer(this, "ARMLEFBOTROT"); - ARMLEFTOPROT.addChild(ARMLEFBOTROT); - ARMLEFBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMLEFBOTROT, 0F, 0F, 0F); - ARMLEFBOTROT.mirror = true; - fingerl1 = new ModelRenderer(this, 32, 20); - fingerl1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl1); - fingerl1.setRotationPoint(-2F, 14F, 0F); - fingerl1.setTextureSize(128, 64); - fingerl1.mirror = true; - setRotation(fingerl1, 0F, 0F, 0F); - fingerl3 = new ModelRenderer(this, 32, 20); - fingerl3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl3); - fingerl3.setRotationPoint(1F, 14F, 2F); - fingerl3.setTextureSize(128, 64); - fingerl3.mirror = true; - setRotation(fingerl3, 0F, 0F, 0F); - fingerl2 = new ModelRenderer(this, 32, 20); - fingerl2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMLEFBOTROT.addChild(fingerl2); - fingerl2.setRotationPoint(1F, 14F, -2F); - fingerl2.setTextureSize(128, 64); - fingerl2.mirror = true; - setRotation(fingerl2, 0F, 0F, 0F); - mosslal2 = new ModelRenderer(this, 0, 52); - mosslal2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal2); - mosslal2.setRotationPoint(0.5F, 4F, -3F); - mosslal2.setTextureSize(128, 64); - mosslal2.mirror = true; - setRotation(mosslal2, 0F, 0F, 0F); - mosslal1 = new ModelRenderer(this, 0, 52); - mosslal1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal1); - mosslal1.setRotationPoint(-0.5F, 3F, -3F); - mosslal1.setTextureSize(128, 64); - mosslal1.mirror = true; - setRotation(mosslal1, 0F, 0F, 0F); - mosslal3 = new ModelRenderer(this, 0, 52); - mosslal3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMLEFBOTROT.addChild(mosslal3); - mosslal3.setRotationPoint(-3F, 6F, -0.5F); - mosslal3.setTextureSize(128, 64); - mosslal3.mirror = true; - setRotation(mosslal3, 0F, 0F, 0F); - mosslal5 = new ModelRenderer(this, 0, 52); - mosslal5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMLEFBOTROT.addChild(mosslal5); - mosslal5.setRotationPoint(0.5F, 4F, 3F); - mosslal5.setTextureSize(128, 64); - mosslal5.mirror = true; - setRotation(mosslal5, 0F, 0F, 0F); - mosslal4 = new ModelRenderer(this, 0, 52); - mosslal4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMLEFBOTROT.addChild(mosslal4); - mosslal4.setRotationPoint(-0.5F, 3F, 3F); - mosslal4.setTextureSize(128, 64); - mosslal4.mirror = true; - setRotation(mosslal4, 0F, 0F, 0F); - armlefbot = new ModelRenderer(this, 42, 21); - armlefbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMLEFBOTROT.addChild(armlefbot); - armlefbot.setRotationPoint(0F, 0F, 0F); - armlefbot.setTextureSize(128, 64); - armlefbot.mirror = true; - setRotation(armlefbot, 0F, 0F, 0F); - // armleftopfold.addChildModelRenderer(ARMLEFBOTROT); - // bodyfold.addChildModelRenderer(ARMLEFTOPROT); - ARMRIGTOPROT = new ModelRenderer(this, "ARMRIGTOPROT"); - BODYROT.addChild(ARMRIGTOPROT); - ARMRIGTOPROT.setRotationPoint(9.5F, -10F, 0F); - setRotation(ARMRIGTOPROT, 0F, 0F, 0F); - ARMRIGTOPROT.mirror = true; - mossuar3 = new ModelRenderer(this, 0, 52); - mossuar3.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar3); - mossuar3.setRotationPoint(0.5F, 8F, -3F); - mossuar3.setTextureSize(128, 64); - mossuar3.mirror = true; - setRotation(mossuar3, 0F, 0F, 0F); - mossuar2 = new ModelRenderer(this, 0, 52); - mossuar2.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar2); - mossuar2.setRotationPoint(-0.5F, 7F, -3F); - mossuar2.setTextureSize(128, 64); - mossuar2.mirror = true; - setRotation(mossuar2, 0F, 0F, 0F); - mossuar1 = new ModelRenderer(this, 0, 52); - mossuar1.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar1); - mossuar1.setRotationPoint(0.5F, 1F, -3F); - mossuar1.setTextureSize(128, 64); - mossuar1.mirror = true; - setRotation(mossuar1, 0F, 0F, 0F); - mossuar5 = new ModelRenderer(this, 0, 52); - mossuar5.addBox(-0.5F, -3F, -1F, 1, 4, 3); - ARMRIGTOPROT.addChild(mossuar5); - mossuar5.setRotationPoint(3F, 11F, -1F); - mossuar5.setTextureSize(128, 64); - mossuar5.mirror = true; - setRotation(mossuar5, 0F, 0F, 0F); - mossuar4 = new ModelRenderer(this, 0, 52); - mossuar4.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGTOPROT.addChild(mossuar4); - mossuar4.setRotationPoint(3F, 1F, -0.5F); - mossuar4.setTextureSize(128, 64); - mossuar4.mirror = true; - setRotation(mossuar4, 0F, 0F, 0F); - mossuar8 = new ModelRenderer(this, 0, 52); - mossuar8.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGTOPROT.addChild(mossuar8); - mossuar8.setRotationPoint(0.5F, 8F, 3F); - mossuar8.setTextureSize(128, 64); - mossuar8.mirror = true; - setRotation(mossuar8, 0F, 0F, 0F); - mossuar6 = new ModelRenderer(this, 0, 52); - mossuar6.addBox(-1.5F, -1.5F, -0.5F, 2, 6, 1); - ARMRIGTOPROT.addChild(mossuar6); - mossuar6.setRotationPoint(0.5F, 1F, 3F); - mossuar6.setTextureSize(128, 64); - mossuar6.mirror = true; - setRotation(mossuar6, 0F, 0F, 0F); - mossuar7 = new ModelRenderer(this, 0, 52); - mossuar7.addBox(-1.5F, -1.5F, -0.5F, 4, 1, 1); - ARMRIGTOPROT.addChild(mossuar7); - mossuar7.setRotationPoint(-0.5F, 7F, 3F); - mossuar7.setTextureSize(128, 64); - mossuar7.mirror = true; - setRotation(mossuar7, 0F, 0F, 0F); - armrigtop = new ModelRenderer(this, 42, 0); - armrigtop.addBox(-2.5F, -2F, -2.5F, 5, 16, 5); - ARMRIGTOPROT.addChild(armrigtop); - armrigtop.setRotationPoint(0F, -2F, 0F); - armrigtop.setTextureSize(128, 64); - armrigtop.mirror = true; - setRotation(armrigtop, 0F, 0F, 0F); - ARMRIGBOTROT = new ModelRenderer(this, "ARMRIGBOTROT"); - ARMRIGTOPROT.addChild(ARMRIGBOTROT); - ARMRIGBOTROT.setRotationPoint(0F, 12F, 0F); - setRotation(ARMRIGBOTROT, 0F, 0F, 0F); - ARMRIGBOTROT.mirror = true; - fingerr3 = new ModelRenderer(this, 32, 20); - fingerr3.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr3); - fingerr3.setRotationPoint(-1F, 14F, 2F); - fingerr3.setTextureSize(128, 64); - fingerr3.mirror = true; - setRotation(fingerr3, 0F, 0F, 0F); - fingerr1 = new ModelRenderer(this, 32, 20); - fingerr1.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr1); - fingerr1.setRotationPoint(2F, 14F, 0F); - fingerr1.setTextureSize(128, 64); - fingerr1.mirror = true; - setRotation(fingerr1, 0F, 0F, 0F); - fingerr2 = new ModelRenderer(this, 32, 20); - fingerr2.addBox(-0.5F, 0F, -0.5F, 1, 3, 1); - ARMRIGBOTROT.addChild(fingerr2); - fingerr2.setRotationPoint(-1F, 14F, -2F); - fingerr2.setTextureSize(128, 64); - fingerr2.mirror = true; - setRotation(fingerr2, 0F, 0F, 0F); - mosslar2 = new ModelRenderer(this, 0, 52); - mosslar2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar2); - mosslar2.setRotationPoint(0.5F, 4F, -3F); - mosslar2.setTextureSize(128, 64); - mosslar2.mirror = true; - setRotation(mosslar2, 0F, 0F, 0F); - mosslar1 = new ModelRenderer(this, 0, 52); - mosslar1.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar1); - mosslar1.setRotationPoint(-0.5F, 3F, -3F); - mosslar1.setTextureSize(128, 64); - mosslar1.mirror = true; - setRotation(mosslar1, 0F, 0F, 0F); - mosslar3 = new ModelRenderer(this, 0, 52); - mosslar3.addBox(-0.5F, -3F, -1F, 1, 6, 2); - ARMRIGBOTROT.addChild(mosslar3); - mosslar3.setRotationPoint(3F, 6F, -0.5F); - mosslar3.setTextureSize(128, 64); - mosslar3.mirror = true; - setRotation(mosslar3, 0F, 0F, 0F); - mosslar4 = new ModelRenderer(this, 0, 52); - mosslar4.addBox(-1.5F, -1.5F, -0.5F, 3, 1, 1); - ARMRIGBOTROT.addChild(mosslar4); - mosslar4.setRotationPoint(-0.5F, 3F, 3F); - mosslar4.setTextureSize(128, 64); - mosslar4.mirror = true; - setRotation(mosslar4, 0F, 0F, 0F); - mosslar5 = new ModelRenderer(this, 0, 52); - mosslar5.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - ARMRIGBOTROT.addChild(mosslar5); - mosslar5.setRotationPoint(0.5F, 4F, 3F); - mosslar5.setTextureSize(128, 64); - mosslar5.mirror = true; - setRotation(mosslar5, 0F, 0F, 0F); - armrigbot = new ModelRenderer(this, 42, 21); - armrigbot.addBox(-2.5F, 0F, -2.5F, 5, 14, 5); - ARMRIGBOTROT.addChild(armrigbot); - armrigbot.setRotationPoint(0F, 0F, 0F); - armrigbot.setTextureSize(128, 64); - armrigbot.mirror = true; - setRotation(armrigbot, 0F, 0F, 0F); - // armrigtopfold.addChildModelRenderer(ARMRIGBOTROT); - // bodyfold.addChildModelRenderer(ARMRIGTOPROT); - - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BODYROT.addChild(BACKTREESTEM6); - BACKTREESTEM6.setRotationPoint(-3F, -15F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - backtreesleaves6 = new ModelRenderer(this, 23, 42); - backtreesleaves6.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM6.addChild(backtreesleaves6); - backtreesleaves6.setRotationPoint(0F, -4F, 0F); - backtreesleaves6.setTextureSize(128, 64); - backtreesleaves6.mirror = true; - setRotation(backtreesleaves6, 0F, 0F, 0F); - backtreestem6 = new ModelRenderer(this, 32, 28); - backtreestem6.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM6.addChild(backtreestem6); - backtreestem6.setRotationPoint(0F, 0F, 0F); - backtreestem6.setTextureSize(128, 64); - backtreestem6.mirror = true; - setRotation(backtreestem6, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM6); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM5.setRotationPoint(3F, -15F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - backtreestem5 = new ModelRenderer(this, 32, 28); - backtreestem5.addBox(-0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addChild(backtreestem5); - backtreestem5.setRotationPoint(0F, 0F, 0F); - backtreestem5.setTextureSize(128, 64); - backtreestem5.mirror = true; - setRotation(backtreestem5, 0F, 0F, 0F); - backtreesleaves5 = new ModelRenderer(this, 23, 42); - backtreesleaves5.addBox(-3F, -3F, -3F, 6, 3, 6); - BACKTREESTEM5.addChild(backtreesleaves5); - backtreesleaves5.setRotationPoint(0F, -4F, 0F); - backtreesleaves5.setTextureSize(128, 64); - backtreesleaves5.mirror = true; - setRotation(backtreesleaves5, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM5); - BACKTREESTEM4 = new ModelRenderer(this, "BACKTREESTEM4"); - BODYROT.addChild(BACKTREESTEM4); - BACKTREESTEM4.setRotationPoint(3F, -3F, 5.5F); - setRotation(BACKTREESTEM4, 0F, 0F, 0F); - BACKTREESTEM4.mirror = true; - backtreesleaves4 = new ModelRenderer(this, 23, 33); - backtreesleaves4.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM4.addChild(backtreesleaves4); - backtreesleaves4.setRotationPoint(0F, 0F, 3F); - backtreesleaves4.setTextureSize(128, 64); - backtreesleaves4.mirror = true; - setRotation(backtreesleaves4, 0F, 0F, 0F); - backtreestem4 = new ModelRenderer(this, 23, 29); - backtreestem4.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM4.addChild(backtreestem4); - backtreestem4.setRotationPoint(0F, 0F, 0F); - backtreestem4.setTextureSize(128, 64); - backtreestem4.mirror = true; - setRotation(backtreestem4, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM4); - BACKTREESTEM3 = new ModelRenderer(this, "BACKTREESTEM3"); - BODYROT.addChild(BACKTREESTEM3); - BACKTREESTEM3.setRotationPoint(-3F, -3F, 5.5F); - setRotation(BACKTREESTEM3, 0F, 0F, 0F); - BACKTREESTEM3.mirror = true; - backtreesleaves3 = new ModelRenderer(this, 23, 33); - backtreesleaves3.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM3.addChild(backtreesleaves3); - backtreesleaves3.setRotationPoint(0F, 0F, 3F); - backtreesleaves3.setTextureSize(128, 64); - backtreesleaves3.mirror = true; - setRotation(backtreesleaves3, 0F, 0F, 0F); - backtreestem3 = new ModelRenderer(this, 23, 29); - backtreestem3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM3.addChild(backtreestem3); - backtreestem3.setRotationPoint(0F, 0F, 0F); - backtreestem3.setTextureSize(128, 64); - backtreestem3.mirror = true; - setRotation(backtreestem3, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM3); - BACKTREESTEM2 = new ModelRenderer(this, "BACKTREESTEM2"); - BODYROT.addChild(BACKTREESTEM2); - BACKTREESTEM2.setRotationPoint(3F, -11F, 5.5F); - setRotation(BACKTREESTEM2, 0F, 0F, 0F); - BACKTREESTEM2.mirror = true; - backtreesleaves2 = new ModelRenderer(this, 23, 33); - backtreesleaves2.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM2.addChild(backtreesleaves2); - backtreesleaves2.setRotationPoint(0F, 0F, 3F); - backtreesleaves2.setTextureSize(128, 64); - backtreesleaves2.mirror = true; - setRotation(backtreesleaves2, 0F, 0F, 0F); - backtreestem2 = new ModelRenderer(this, 23, 29); - backtreestem2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM2.addChild(backtreestem2); - backtreestem2.setRotationPoint(0F, 0F, 0F); - backtreestem2.setTextureSize(128, 64); - backtreestem2.mirror = true; - setRotation(backtreestem2, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(BACKTREESTEM2); - BACKTREESTEM1 = new ModelRenderer(this, "BACKTREESTEM1"); - BODYROT.addChild(BACKTREESTEM1); - BACKTREESTEM1.setRotationPoint(-3F, -11F, 5.5F); - setRotation(BACKTREESTEM1, 0F, 0F, 0F); - BACKTREESTEM1.mirror = true; - backtreesleaves1 = new ModelRenderer(this, 23, 33); - backtreesleaves1.addBox(-3F, -3F, 0F, 6, 6, 3); - BACKTREESTEM1.addChild(backtreesleaves1); - backtreesleaves1.setRotationPoint(0F, 0F, 3F); - backtreesleaves1.setTextureSize(128, 64); - backtreesleaves1.mirror = true; - setRotation(backtreesleaves1, 0F, 0F, 0F); - backtreestem1 = new ModelRenderer(this, 23, 29); - backtreestem1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - BACKTREESTEM1.addChild(backtreestem1); - backtreestem1.setRotationPoint(0F, 0F, 0F); - backtreestem1.setTextureSize(128, 64); - backtreestem1.mirror = true; - setRotation(backtreestem1, 0F, 0F, 0F); - - // bodyfold.addChildModelRenderer(BACKTREESTEM1); - HEADROT = new ModelRenderer(this, "HEADROT"); - BODYROT.addChild(HEADROT); - HEADROT.setRotationPoint(0F, -12F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - brow4 = new ModelRenderer(this, 98, 18); - brow4.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow4); - brow4.setRotationPoint(0F, -5F, -3F); - brow4.setTextureSize(128, 64); - brow4.mirror = true; - setRotation(brow4, 0F, 0F, 0F); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - HEADROT.addChild(NOSEROT); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - nose2 = new ModelRenderer(this, 94, 20); - nose2.addBox(0F, 0F, 0F, 1, 1, 1); - NOSEROT.addChild(nose2); - nose2.setRotationPoint(-0.5F, 1F, -2.5F); - nose2.setTextureSize(128, 64); - nose2.mirror = true; - setRotation(nose2, 0F, 0F, 0F); - nose1 = new ModelRenderer(this, 90, 16); - nose1.addBox(0F, 0F, 0F, 1, 1, 2); - NOSEROT.addChild(nose1); - nose1.setRotationPoint(-0.5F, 0F, -2.5F); - nose1.setTextureSize(128, 64); - nose1.mirror = true; - setRotation(nose1, 0F, 0F, 0F); - nose3 = new ModelRenderer(this, 90, 22); - nose3.addBox(0F, 0F, 0F, 2, 2, 2); - NOSEROT.addChild(nose3); - nose3.setRotationPoint(-1F, 2F, -3F); - nose3.setTextureSize(128, 64); - nose3.mirror = true; - setRotation(nose3, 0F, 0F, 0F); - // headfold.addChildModelRenderer(NOSEROT); - brow3 = new ModelRenderer(this, 98, 18); - brow3.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow3); - brow3.setRotationPoint(-2F, -5F, -3F); - brow3.setTextureSize(128, 64); - brow3.mirror = true; - setRotation(brow3, 0F, 0F, 0F); - brow1 = new ModelRenderer(this, 106, 13); - brow1.addBox(-2.5F, -0.5F, -0.5F, 5, 2, 1); - HEADROT.addChild(brow1); - brow1.setRotationPoint(0F, -7F, -3F); - brow1.setTextureSize(128, 64); - brow1.mirror = true; - setRotation(brow1, 0F, 0F, 0F); - brow5 = new ModelRenderer(this, 98, 18); - brow5.addBox(-0.5F, -0.5F, -0.5F, 1, 2, 1); - HEADROT.addChild(brow5); - brow5.setRotationPoint(2F, -5F, -3F); - brow5.setTextureSize(128, 64); - brow5.mirror = true; - setRotation(brow5, 0F, 0F, 0F); - brow2 = new ModelRenderer(this, 106, 17); - brow2.addBox(-2.5F, -0.5F, -0.5F, 5, 3, 1); - HEADROT.addChild(brow2); - brow2.setRotationPoint(0F, -3F, -3F); - brow2.setTextureSize(128, 64); - brow2.mirror = true; - setRotation(brow2, 0F, 0F, 0F); - head = new ModelRenderer(this, 88, 0); - head.addBox(0F, 0F, 0F, 5, 12, 4); - HEADROT.addChild(head); - head.setRotationPoint(-2.5F, -9F, -2.5F); - head.setTextureSize(128, 64); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // bodyfold.addChildModelRenderer(HEADROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - mossulr1 = new ModelRenderer(this, 0, 52); - mossulr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr1); - mossulr1.setRotationPoint(0.5F, 4F, -3.5F); - mossulr1.setTextureSize(128, 64); - mossulr1.mirror = true; - setRotation(mossulr1, 0F, 0F, 0F); - mossulr2 = new ModelRenderer(this, 0, 52); - mossulr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGTOPROT.addChild(mossulr2); - mossulr2.setRotationPoint(0.5F, 4F, 3.5F); - mossulr2.setTextureSize(128, 64); - mossulr2.mirror = true; - setRotation(mossulr2, 0F, 0F, 0F); - legrigtop = new ModelRenderer(this, 62, 0); - legrigtop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGRIGTOPROT.addChild(legrigtop); - legrigtop.setRotationPoint(-0.5F, 0F, -0.5F); - legrigtop.setTextureSize(128, 64); - legrigtop.mirror = true; - setRotation(legrigtop, 0F, 0F, 0F); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGRIGBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - mossllr2 = new ModelRenderer(this, 0, 52); - mossllr2.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr2); - mossllr2.setRotationPoint(0.5F, 3F, 3.5F); - mossllr2.setTextureSize(128, 64); - mossllr2.mirror = true; - setRotation(mossllr2, 0F, 0F, 0F); - mossllr1 = new ModelRenderer(this, 0, 52); - mossllr1.addBox(-1.5F, -1.5F, -0.5F, 3, 4, 1); - LEGRIGBOTROT.addChild(mossllr1); - mossllr1.setRotationPoint(0.5F, 3F, -3.5F); - mossllr1.setTextureSize(128, 64); - mossllr1.mirror = true; - setRotation(mossllr1, 0F, 0F, 0F); - toer6 = new ModelRenderer(this, 62, 30); - toer6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer6); - toer6.setRotationPoint(2F, 8.5F, -2.5F); - toer6.setTextureSize(128, 64); - toer6.mirror = true; - setRotation(toer6, 0F, 0F, 0F); - toer5 = new ModelRenderer(this, 62, 30); - toer5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer5); - toer5.setRotationPoint(0F, 8.5F, -2.5F); - toer5.setTextureSize(128, 64); - toer5.mirror = true; - setRotation(toer5, 0F, 0F, 0F); - toer4 = new ModelRenderer(this, 62, 30); - toer4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGRIGBOTROT.addChild(toer4); - toer4.setRotationPoint(-2F, 8.5F, -2.5F); - toer4.setTextureSize(128, 64); - toer4.mirror = true; - setRotation(toer4, 0F, 0F, 0F); - toer3 = new ModelRenderer(this, 62, 30); - toer3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer3); - toer3.setRotationPoint(2F, 8.5F, 2.5F); - toer3.setTextureSize(128, 64); - toer3.mirror = true; - setRotation(toer3, 0F, 0F, 0F); - toer2 = new ModelRenderer(this, 62, 30); - toer2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer2); - toer2.setRotationPoint(0F, 8.5F, 2.5F); - toer2.setTextureSize(128, 64); - toer2.mirror = true; - setRotation(toer2, 0F, 0F, 0F); - toer1 = new ModelRenderer(this, 62, 30); - toer1.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGRIGBOTROT.addChild(toer1); - toer1.setRotationPoint(-2F, 8.5F, 2.5F); - toer1.setTextureSize(128, 64); - toer1.mirror = true; - setRotation(toer1, 0F, 0F, 0F); - legrigbot = new ModelRenderer(this, 62, 15); - legrigbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGRIGBOTROT.addChild(legrigbot); - legrigbot.setRotationPoint(-3.5F, 0F, -3F); - legrigbot.setTextureSize(128, 64); - legrigbot.mirror = true; - setRotation(legrigbot, 0F, 0F, 0F); - // legrigtopfold.addChildModelRenderer(LEGRIGBOTROT); - LEGLEFTTOPROT = new ModelRenderer(this, "LEGLEFTTOPROT"); - LEGLEFTTOPROT.setRotationPoint(-4.5F, 6F - heightToRaise, 0.5F); - setRotation(LEGLEFTTOPROT, 0F, 0F, 0F); - LEGLEFTTOPROT.mirror = true; - mossull2 = new ModelRenderer(this, 0, 52); - mossull2.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull2); - mossull2.setRotationPoint(1.5F, 5F, -3.5F); - mossull2.setTextureSize(128, 64); - mossull2.mirror = true; - setRotation(mossull2, 0F, 0F, 0F); - mossull1 = new ModelRenderer(this, 0, 52); - mossull1.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull1); - mossull1.setRotationPoint(-0.5F, 2F, -3.5F); - mossull1.setTextureSize(128, 64); - mossull1.mirror = true; - setRotation(mossull1, 0F, 0F, 0F); - mossull4 = new ModelRenderer(this, 0, 52); - mossull4.addBox(-1.5F, -1.5F, -0.5F, 2, 1, 1); - LEGLEFTTOPROT.addChild(mossull4); - mossull4.setRotationPoint(1.5F, 5F, 3.5F); - mossull4.setTextureSize(128, 64); - mossull4.mirror = true; - setRotation(mossull4, 0F, 0F, 0F); - legleftop = new ModelRenderer(this, 62, 0); - legleftop.addBox(-2.5F, 0F, -2.5F, 6, 9, 6); - LEGLEFTTOPROT.addChild(legleftop); - legleftop.setRotationPoint(-0.5F, 0F, 0F); - legleftop.setTextureSize(128, 64); - legleftop.mirror = true; - setRotation(legleftop, 0F, 0F, 0F); - mossull3 = new ModelRenderer(this, 0, 52); - mossull3.addBox(-1.5F, -1.5F, -0.5F, 2, 4, 1); - LEGLEFTTOPROT.addChild(mossull3); - mossull3.setRotationPoint(-0.5F, 2F, 3.5F); - mossull3.setTextureSize(128, 64); - mossull3.mirror = true; - setRotation(mossull3, 0F, 0F, 0F); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFTTOPROT.addChild(LEGLEFBOTROT); - LEGLEFBOTROT.setRotationPoint(0F, 9F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - toel4 = new ModelRenderer(this, 62, 30); - toel4.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel4); - toel4.setRotationPoint(-2.5F, 8.5F, -2.5F); - toel4.setTextureSize(128, 64); - toel4.mirror = true; - setRotation(toel4, 0F, 0F, 0F); - toel6 = new ModelRenderer(this, 62, 30); - toel6.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel6); - toel6.setRotationPoint(1.5F, 8.5F, -2.5F); - toel6.setTextureSize(128, 64); - toel6.mirror = true; - setRotation(toel6, 0F, 0F, 0F); - toel5 = new ModelRenderer(this, 62, 30); - toel5.addBox(-0.5F, -0.5F, -4F, 1, 1, 4); - LEGLEFBOTROT.addChild(toel5); - toel5.setRotationPoint(-0.5F, 8.5F, -2.5F); - toel5.setTextureSize(128, 64); - toel5.mirror = true; - setRotation(toel5, 0F, 0F, 0F); - toel3 = new ModelRenderer(this, 62, 30); - toel3.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel3); - toel3.setRotationPoint(1.5F, 8.5F, 2.5F); - toel3.setTextureSize(128, 64); - toel3.mirror = true; - setRotation(toel3, 0F, 0F, 0F); - toel2 = new ModelRenderer(this, 62, 30); - toel2.addBox(-0.5F, -0.5F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel2); - toel2.setRotationPoint(-0.5F, 8.5F, 2.5F); - toel2.setTextureSize(128, 64); - toel2.mirror = true; - setRotation(toel2, 0F, 0F, 0F); - toel1 = new ModelRenderer(this, 62, 30); - toel1.addBox(0F, 0F, 0F, 1, 1, 3); - LEGLEFBOTROT.addChild(toel1); - toel1.setRotationPoint(-3F, 8F, 2.5F); - toel1.setTextureSize(128, 64); - toel1.mirror = true; - setRotation(toel1, 0F, 0F, 0F); - mosslll1 = new ModelRenderer(this, 0, 52); - mosslll1.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll1); - mosslll1.setRotationPoint(-1F, 3F, -3.5F); - mosslll1.setTextureSize(128, 64); - mosslll1.mirror = true; - setRotation(mosslll1, 0F, 0F, 0F); - mosslll2 = new ModelRenderer(this, 0, 52); - mosslll2.addBox(-1.5F, -1.5F, -0.5F, 2, 5, 1); - LEGLEFBOTROT.addChild(mosslll2); - mosslll2.setRotationPoint(-1F, 3F, 3.5F); - mosslll2.setTextureSize(128, 64); - mosslll2.mirror = true; - setRotation(mosslll2, 0F, 0F, 0F); - leglefbot = new ModelRenderer(this, 62, 15); - leglefbot.addBox(0F, 0F, 0F, 7, 9, 6); - LEGLEFBOTROT.addChild(leglefbot); - leglefbot.setRotationPoint(-3.5F, 0F, -3F); - leglefbot.setTextureSize(128, 64); - leglefbot.mirror = true; - setRotation(leglefbot, 0F, 0F, 0F); - // legleftopfold.addChildModelRenderer(LEGLEFBOTROT); - } - - private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = 1.5f; - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale * f5); - LEGRIGTOPROT.render(scale * f5); - LEGLEFTTOPROT.render(scale * f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityTreeEnt var5 = (EntityTreeEnt) par1EntityLiving; - - /* Constant Animation Rotations */ - BACKTREESTEM1.rotateAngleY = (float) (-25 * Math.PI / 180f); - BACKTREESTEM2.rotateAngleY = (float) (+25 * Math.PI / 180f); - BACKTREESTEM3.rotateAngleY = (float) (-40 * Math.PI / 180f); - BACKTREESTEM4.rotateAngleY = (float) (+40 * Math.PI / 180f); - - BACKTREESTEM5.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM5.rotateAngleZ = (float) (+30 * Math.PI / 180f); - - BACKTREESTEM6.rotateAngleX = (float) (-30 * Math.PI / 180f); - BACKTREESTEM6.rotateAngleZ = (float) (-30 * Math.PI / 180f); - - toer1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toer3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toer6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - toel1.rotateAngleY = (float) (-15 * Math.PI / 180f); - toel3.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel4.rotateAngleY = (float) (+15 * Math.PI / 180f); - toel6.rotateAngleY = (float) (-15 * Math.PI / 180f); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFTTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - if (var5.getEntityState() == EntityStates.idle || var5.getEntityState() == EntityStates.looking) { - ARMLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - ARMRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - ARMLEFBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - ARMRIGBOTROT.rotateAngleX = (float) -Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - } else if (var5.getEntityState() == EntityStates.attacking) { - ARMRIGTOPROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = (float) (Math.PI / 180) * (-5 + 8 * MathHelper.cos(par2 * 0.6662F)); - ARMRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMRIGBOTROT.rotateAngleX = (float) (Math.PI / 180) * (-80 + 8 * MathHelper.cos(par2 * 0.6662F)); - - ARMLEFTOPROT.rotateAngleZ = (float) (5 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = (float) (Math.PI / 180) - * (-5 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ARMLEFTOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - ARMLEFBOTROT.rotateAngleX = (float) (Math.PI / 180) - * (-80 + 8 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - } - - float minTime; - float maxTime; - if (var5.getAnimTime() > var5.maxAnimTime * 7 / 8) { - minTime = var5.maxAnimTime * 7 / 8; - maxTime = var5.maxAnimTime; - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-75 - * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (75 * Math.PI / 180), (float) (5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-5 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 6 / 8) { - maxTime = var5.maxAnimTime * 7 / 8; - minTime = var5.maxAnimTime * 6 / 8; - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (30 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-60 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-30 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } else if (var5.getAnimTime() > var5.maxAnimTime * 5 / 8) { - maxTime = var5.maxAnimTime * 6 / 8; - minTime = var5.maxAnimTime * 5 / 4; - - ARMRIGTOPROT.rotateAngleZ = (float) (-75 * Math.PI / 180); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = (float) (75 * Math.PI / 180); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (15 * Math.PI / 180), (float) (-60 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-110 - * Math.PI / 180), (float) (-80 * Math.PI / 180)); - } else if (var5.maxAnimTime > 0) { - maxTime = var5.maxAnimTime * 5 / 4; - minTime = 0; - - ARMRIGTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (-75 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMRIGTOPROT.rotateAngleY = 0.0f; - ARMRIGBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - - ARMLEFTOPROT.rotateAngleZ = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (5 * Math.PI / 180), (float) (75 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-5 - * Math.PI / 180), (float) (15 * Math.PI / 180)); - ARMLEFTOPROT.rotateAngleY = 0.0f; - ARMLEFBOTROT.rotateAngleX = mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, (float) (-80 - * Math.PI / 180), (float) (-110 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/d0605ef4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/d0605ef4c42100141fce95f06aba7e85 deleted file mode 100644 index 2426a1c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/d0605ef4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/d07c77f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/d07c77f6c42100141fce95f06aba7e85 deleted file mode 100644 index 913c130..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/d07c77f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -public enum ButtonIDs { - NEWENTRY(-1), SAVENCLOSE(-2), DELENTRY(-6), CANCEL(-3), FORWARD(-4), BACKWARDS(-5); - - int index; - - ButtonIDs(int index) { - this.index = index; - } - - public static ButtonIDs getButtonByIndex(int index) { - for (ButtonIDs buttonID : ButtonIDs.values()) { - if (buttonID.index == index) { - return buttonID; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e05070f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e05070f6c42100141fce95f06aba7e85 deleted file mode 100644 index c3a2e07..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e05070f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,345 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e0df6df6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e0df6df6c42100141fce95f06aba7e85 deleted file mode 100644 index a32960f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cc/e0df6df6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.nbt.NBTBase; - -import org.lwjgl.util.Point; - -public class GUIEditNodeTextField extends GuiTextField { - private NBTNode selectedNode = null; - - public GUIEditNodeTextField(FontRenderer par1FontRenderer, int xPos, int yPos, int width, int height) { - super(par1FontRenderer, xPos, yPos, width, height); - } - - public GUIEditNodeTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(30000); - } - - public GUIEditNodeTextField(GUIEditNodeTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - - this.selectedNode = oldTextFields.selectedNode; - setText(oldTextFields.getText()); - setupTextField(30000); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } - - public boolean isEnabled() { - return selectedNode != null; - } - - public void setSelectedNode(NBTNode selectedNode) { - this.selectedNode = selectedNode; - setText(selectedNode.getValue()); - } - - public boolean saveAndClear(NBTTree nodeTree) { - NBTBase newNBT = selectedNode.createNBTFromString(getText()); - if (newNBT != null) { - if (selectedNode.getParent() != null) { - selectedNode.getParent().replaceChild(selectedNode, - new NBTNode(newNBT, selectedNode.getParent(), selectedNode.getTagName())); - } else { - // Properties name is arbitrary, the top compound in entity NBT is/was typically called properties - selectedNode = new NBTNode(newNBT, null, "Properties"); - } - clear(); - return true; - } - return false; - } - - public void clear() { - selectedNode = null; - setText(""); - } - - @Override - public boolean textboxKeyTyped(char keyChar, int keyID) { - if (selectedNode != null) { - return super.textboxKeyTyped(keyChar, keyID); - } - return false; - } - - @Override - public void mouseClicked(int par1, int par2, int par3) { - if (selectedNode != null) { - super.mouseClicked(par1, par2, par3); - } - } - - @Override - public void drawTextBox() { - super.drawTextBox(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/212950e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/212950e5c42100141fce95f06aba7e85 deleted file mode 100644 index 9dcd7a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/212950e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAIBase; - -public class EntityAISmoothSwimming extends EntityAIBase{ - private EntityLiving theEntity; - private boolean smootherSwimming = false; - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving){ - this.theEntity = par1EntityLiving; - this.setMutexBits(4); - par1EntityLiving.getNavigator().setCanSwim(true); - } - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving, boolean smootherSwimming){ - this(par1EntityLiving); - this.smootherSwimming = smootherSwimming; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - - /** - * Updates the task - */ - public void updateTask(){ -// if(smootherSwimming -//// && this.theEntity.getRNG().nextFloat() < 0.8F -//// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ) -// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ)){ -// this.theEntity.getJumpHelper().setJumping(); -// } - - if(this.theEntity.getRNG().nextFloat() < 0.8F){ - this.theEntity.getJumpHelper().setJumping(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/3073e2e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/3073e2e4c42100141fce95f06aba7e85 deleted file mode 100644 index d6627a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/3073e2e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/32d7e7ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/32d7e7ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7ed9081..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/32d7e7ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.ItemArmor; -import projectzulu.common.ProjectZulu_Core; - -public class ItemScaleArmor extends ItemArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemScaleArmor(ArmorMaterial par2EnumArmorMaterial, int par3, int par4) { - super(par2EnumArmorMaterial, par3, par4); - // super(par1); - this.material = par2EnumArmorMaterial; - this.armorType = par4; - this.renderIndex = par3; - this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); - this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/618fdf9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/618fdf9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7ff86b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/618fdf9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,325 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/72c00d9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/72c00d9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 61489ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/72c00d9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBoar; -import projectzulu.common.mobs.models.ModelBoar; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/90312bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/90312bf6c42100141fce95f06aba7e85 deleted file mode 100644 index 2fcbea3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/90312bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/909f47ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/909f47ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6e837bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/909f47ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/919f78f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/919f78f4c42100141fce95f06aba7e85 deleted file mode 100644 index 0cb9561..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/919f78f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/928dcdfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/928dcdfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ee7000..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/928dcdfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBoar; -import projectzulu.common.mobs.models.ModelBoar; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BoarDeclaration extends SpawnableDeclaration { - - public BoarDeclaration() { - super("Boar", 10, EntityBoar.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (122 << 16) + (77 << 8) + 32; - eggColor2 = (158 << 16) + (99 << 8) + 42; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 2); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBoar(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "boar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet frozenForest = new HashSet(); - frozenForest.addAll(typeToArray(Type.FOREST)); - frozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(frozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b122dfe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b122dfe5c42100141fce95f06aba7e85 deleted file mode 100644 index 8917d74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b122dfe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,143 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b14a1ff6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b14a1ff6c42100141fce95f06aba7e85 deleted file mode 100644 index 5045311..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/b14a1ff6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.NBTWriter; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/c0edfbe6c3ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/c0edfbe6c3ab00141ee9bf3050c1025b new file mode 100644 index 0000000..a331b91 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/c0edfbe6c3ab00141ee9bf3050c1025b @@ -0,0 +1,102 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/e02578a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/e02578a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9ea7694..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/e02578a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,104 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/e0fddd9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/e0fddd9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d236a83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/e0fddd9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/f05b26ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/f05b26ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index edb9913..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/f05b26ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/f060d0f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/f060d0f8c42100141fce95f06aba7e85 deleted file mode 100644 index 3728933..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cd/f060d0f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityLizardSpit; -import com.ngb.projectzulu.common.mobs.renders.RenderLizardSpit; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/004e4bf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/004e4bf4c42100141fce95f06aba7e85 deleted file mode 100644 index 5d9fb30..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/004e4bf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/0192fef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/0192fef7c42100141fce95f06aba7e85 deleted file mode 100644 index 978c409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/0192fef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.HauntedArmorWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPScatteredTombstonesAndFlowers implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } else if (piecePos.posY == 1) { - if (random.nextInt(90) == 0) { - return new HauntedArmorWithMeta(); - } - - if (piecePos.posX % 2 == 1 ^ piecePos.posZ % 2 == 1 && random.nextInt(100) <= 20) { - return BlockList.tombstone.isPresent() ? new BlockWithMeta(BlockList.tombstone.get()) - : new BlockWithMeta(Blocks.air); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.red_flower, 0); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.yellow_flower, 0); - } else if (50 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.tallgrass, 1); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "tombstonesandflowers"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/11c8c3f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/11c8c3f6c42100141fce95f06aba7e85 deleted file mode 100644 index 3336c5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/11c8c3f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderUniversalFlowerPot implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - // TODO: Render Universal Pot - renderer.renderStandardBlock(par1Block, par2, par3, par4); - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - IIcon var8 = par1Block.getBlockTextureFromSide(0); - float var9 = (var7 >> 16 & 255) / 255.0F; - float var10 = (var7 >> 8 & 255) / 255.0F; - float var11 = (var7 & 255) / 255.0F; - float var12; - float var14; - - if (EntityRenderer.anaglyphEnable) { - var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; - var9 = var12; - var10 = var13; - var11 = var14; - } - - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); - var12 = 0.1865F; - renderer.renderFaceXPos(par1Block, par2 - 0.5F + var12, par3, par4, var8); - renderer.renderFaceXNeg(par1Block, par2 + 0.5F - var12, par3, par4, var8); - renderer.renderFaceZPos(par1Block, par2, par3, par4 - 0.5F + var12, var8); - renderer.renderFaceZNeg(par1Block, par2, par3, par4 + 0.5F - var12, var8); - renderer.renderFaceYNeg(Blocks.dirt, par2, par3 - 0.35F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - renderer.renderFaceYPos(Blocks.dirt, par2, par3 - 0.5F + var12 + 0.1875F, par4, - Blocks.dirt.getBlockTextureFromSide(0)); - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/21cef99fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/21cef99fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 227aed0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/21cef99fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,92 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCathedral; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/32f1ad01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/32f1ad01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 78034fb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/32f1ad01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/51a20df7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/51a20df7c42100141fce95f06aba7e85 deleted file mode 100644 index 88dfd23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/51a20df7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/90592300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/90592300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f7b2878..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/90592300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; - -public abstract class BaseFeature implements TerrainFeature { - private boolean shouldSpawn = true; - protected int minChunkDistance; - protected int chunksPerSpawn; - protected boolean printToLog; - - private Size size; - private String featureName; - - public BaseFeature(String featureName, Size size) { - this.featureName = featureName.toLowerCase(); - this.size = size; - } - - @Override - public String getFeatureName() { - return featureName; - } - - @Override - public boolean isEnabled() { - return shouldSpawn; - } - - @Override - public Size getFeatureSize() { - return size; - } - - @Override - public final void initialize(File modConfigDirectory) { - FeatureConfiguration configuration = new FeatureConfiguration(modConfigDirectory); - configuration.load(); - loadSettings(configuration); - configuration.save(); - } - - protected abstract void loadDefaultSettings(); - - protected void loadSettings(FeatureConfiguration config) { - loadDefaultSettings(); - - shouldSpawn = config.getFeatureProperty(this, "General", "Should Generate", shouldSpawn).getBoolean(shouldSpawn); - - minChunkDistance = config.getFeatureProperty(this, "General", "minChunkDistance", minChunkDistance).getInt( - minChunkDistance); - minChunkDistance = minChunkDistance < 1 ? 1 : minChunkDistance; - - chunksPerSpawn = config.getFeatureProperty(this, "General", "chunksPerSpawn", chunksPerSpawn).getInt(chunksPerSpawn); - chunksPerSpawn = chunksPerSpawn < 1 ? 1 : chunksPerSpawn; - - printToLog = config.getFeatureProperty(this, "General", "printToLog", printToLog).getBoolean(printToLog); - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (shouldSpawn && (chunkX % minChunkDistance == 0 || chunkZ % minChunkDistance == 0)) { - if (random.nextInt(chunksPerSpawn) == 0) { - return true; - } - } - return false; - } - - @Override - public boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - throw new UnsupportedOperationException("Reverse lookup feature has not been implemented yet."); - } - - protected void logGeneration(ChunkCoordinates genBlockCoords) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/917556e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/917556e6c42100141fce95f06aba7e85 deleted file mode 100644 index 88da588..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/917556e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; - -/* Helper Class to contain both BlockID and Meta in a single Structure */ -public class BlockWithMeta extends WeightedRandom.Item { - public final Block block; - public final int meta; - - public BlockWithMeta(Block block) { - this(block, 0); - } - - public BlockWithMeta(Block block, int meta) { - this(block, meta, 1); - } - - public BlockWithMeta(Block block, int meta, int weight) { - super(weight); - this.block = block; - this.meta = meta; - } - - /** - * Helper Function to Place Block/TileEntity/Spawner. Overridden in child to make use of specific knowledge, i.e. A - * Chests Loot Chance - */ - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (block != null) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/917ccc9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/917ccc9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 467ebf7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/917ccc9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/b0b86cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/b0b86cf4c42100141fce95f06aba7e85 deleted file mode 100644 index 3e05ee2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/b0b86cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/c04e76e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/c04e76e5c42100141fce95f06aba7e85 deleted file mode 100644 index fb973e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/c04e76e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.entity.EntityLizardSpit; -import projectzulu.common.mobs.renders.RenderLizardSpit; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardSpitDeclaration extends CreatureDeclaration { - - public LizardSpitDeclaration() { - super("Lizard Spit", 3, EntityLizardSpit.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) {} - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) {} - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderLizardSpit(0.5f); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/c13aa9e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/c13aa9e4c42100141fce95f06aba7e85 deleted file mode 100644 index 91d1bb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/c13aa9e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.core; - -/** - * For usage see: {@link Pair} - */ -public class PairDirectoryFile { - private final K directory; - private final V file; - - public static PairDirectoryFile createPair(K directory, V file) { - return new PairDirectoryFile(directory, file); - } - - public PairDirectoryFile(K directory, V file) { - this.file = file; - this.directory = directory; - } - - public K getDirectory() { - return directory; - } - - public V getFile() { - return file; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairDirectoryFile)) { return false; } - PairDirectoryFile pair = (PairDirectoryFile)object; - return directory.equals(pair.directory) && file.equals(pair.file); - } - - @Override - public int hashCode(){ - return 7 * directory.hashCode() + 13 * file.hashCode(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d1eaa6f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d1eaa6f9c42100141fce95f06aba7e85 deleted file mode 100644 index f51f09b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/d1eaa6f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.core; -/** - * Usage: - * Pair pair = Pair.createPair(1, "test"); - * pair.getElement0(); - * pair.getElement1(); - * @param - * @param - */ -public class Pair { - - private final K element0; - private final V element1; - - public static Pair createPair(K element0, V element1) { - return new Pair(element0, element1); - } - - public Pair(K element0, V element1) { - this.element0 = element0; - this.element1 = element1; - } - - public K getElement0() { - return element0; - } - - public V getElement1() { - return element1; - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f197a4a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f197a4a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 734f12b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f197a4a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -//package projectzulu.common.mobs.entityai; -// -//import net.minecraft.command.IEntitySelector; -//import net.minecraft.entity.EntityLiving; -//import projectzulu.common.mobs.EntityGenericCreature; -//import projectzulu.common.mobs.EntityStates; -// -//public class EntityZuluAINearestRevengeTarget extends EntityAINearestAttackableTarget{ -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5){ -// super(par1EntityLiving, par2Class, par3, par4, par5); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1EntityLiving, Class par2Class, float par3, int par4, boolean par5, boolean par6){ -// super(par1EntityLiving, par2Class, par3, par4, par5, par6); -// } -// -// public EntityZuluAINearestRevengeTarget(EntityLiving par1, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ -// super(par1, par2, par3, par4, par5, par6, par7IEntitySelector); -// } -// -// /** -// * Returns whether the EntityAIBase should begin execution. -// */ -// public boolean shouldExecute() { -// /* getAITarget acts as Tempory target timer, as it only lasts a few seconds, Reminder: getAttackTarget is the persistent form */ -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.shouldExecute(); -// } -// return false; -// } -// -// @Override -// public boolean continueExecuting() { -// if( taskOwner.getAITarget() != null && (((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.attacking || ((EntityGenericCreature)taskOwner).getEntityState() == EntityStates.looking)){ -// return super.continueExecuting(); -// } -// return false; -// } -// -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f1e5a39fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f1e5a39fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f18cb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ce/f1e5a39fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionResistance extends SubItemPotionHalfPower { - - public SubItemPotionResistance(Item itemID, int subID) { - super(itemID, subID, "Resistance"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 13, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.resistance); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/01a4f0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/01a4f0e4c42100141fce95f06aba7e85 deleted file mode 100644 index 1e5246b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/01a4f0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/1257369fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/1257369fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d65e15b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/1257369fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,132 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBoar extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEGROT1; - private ModelRenderer LEGROT2; - private ModelRenderer LEGROT3; - private ModelRenderer LEGROT4; - - public ModelBoar() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - setTextureOffset("BODYROT.body", 12, 8); - setTextureOffset("LEGROT1.leg1", 0, 13); - setTextureOffset("LEGROT2.leg2", 0, 13); - setTextureOffset("LEGROT3.leg3", 0, 13); - setTextureOffset("LEGROT4.leg4", 0, 13); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 14F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 14.5F, -4F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -4.5F, 0F, 10, 8, 16); - LEGROT1 = new ModelRenderer(this, "LEGROT1"); - LEGROT1.setRotationPoint(-3F, 3.5F, 14F); - setRotation(LEGROT1, 0F, 0F, 0F); - LEGROT1.mirror = true; - LEGROT1.addBox("leg1", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT1); - LEGROT2 = new ModelRenderer(this, "LEGROT2"); - LEGROT2.setRotationPoint(3F, 3.5F, 14F); - setRotation(LEGROT2, 0F, 0F, 0F); - LEGROT2.mirror = true; - LEGROT2.addBox("leg2", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT2); - LEGROT3 = new ModelRenderer(this, "LEGROT3"); - LEGROT3.setRotationPoint(-3F, 3.5F, 2F); - setRotation(LEGROT3, 0F, 0F, 0F); - LEGROT3.mirror = true; - LEGROT3.addBox("leg3", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT3); - LEGROT4 = new ModelRenderer(this, "LEGROT4"); - LEGROT4.setRotationPoint(3F, 3.5F, 2F); - setRotation(LEGROT4, 0F, 0F, 0F); - LEGROT4.mirror = true; - LEGROT4.addBox("leg4", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT4); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_x = 0.0f; - float field_78145_g = 2.2F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGROT1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/3275c19ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/3275c19ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 62635f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/3275c19ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/404e4df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/404e4df8c42100141fce95f06aba7e85 deleted file mode 100644 index e466233..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/404e4df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionSlowfall extends SubItemPotionGeneric { - - public SubItemPotionSlowfall(Item itemID, int subID) { - super(itemID, subID, "potion.slowfall"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.slowfall; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/501bd4e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/501bd4e4c42100141fce95f06aba7e85 deleted file mode 100644 index 4a5aa7e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/501bd4e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParser { - - public enum KeyType { - CHAINABLE, VALUE, PARENT, NONE; - } - - public abstract boolean isInvertable(); - - public abstract boolean isInverted(String parseable); - - public abstract Operand parseOperand(String parseable); - - public abstract boolean isMatch(String title); - - public abstract KeyType getKeyType(); - - public abstract boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue); - - public abstract boolean parseValue(String parseable, HashMap valueCache); - - /** - * Evaluate Function that evaluates whether the Key Parsed is Valid as part of a Chain - * - * @param world World being evaluated - * @param entity Entity being processed. May be Null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @param typeValuePair Pair containing parsed Key and Values - * @param valueCache Map of values from the parent tag - * @return - */ - public abstract boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, - int zCoord, TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/604189f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/604189f4c42100141fce95f06aba7e85 deleted file mode 100644 index 98567ad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/604189f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world2.Direction; -import com.ngb.projectzulu.common.world2.MazeCell; - -public abstract class ArchitectBase implements Architect { - protected BlueprintSetStockpile stockpile; - protected Random random; - - public ArchitectBase(World world) { - this.random = world.rand; - stockpile = new BlueprintSetStockpile(world.rand); - } - - /** - * Checks if the selected cell has walls in 3 cardinal directions - */ - public static Boolean isDeadEnd(MazeCell[][] allCells, Point buildCoords, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby == 3 ? true : false; - } - - /** - * Checks if the selected cell is touching a valid number of valid cells - */ - public static Boolean isTouchingAmount(MazeCell[][] allCells, Point buildCoords, int minTouching, int maxTouching, - boolean countEdges, int... rawState) { - int wallsNearby = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = buildCoords.x + direction.x; - int neighbourZ = buildCoords.y + direction.z; - if (ArchitectBase.isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - if (countEdges) { - wallsNearby++; - } - continue; - } - for (int state : rawState) { - if (allCells[neighbourX][neighbourZ].rawState == state) { - wallsNearby++; - break; - } - } - } - return wallsNearby >= minTouching && wallsNearby <= maxTouching ? true : false; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - public static boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/610a0cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/610a0cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 8557ed0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/610a0cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,103 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/800d58e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/800d58e4c42100141fce95f06aba7e85 deleted file mode 100644 index 56df7ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/800d58e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemStructurePlacer; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a03f9600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a03f9600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e2d6b55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a03f9600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a0e442ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a0e442ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e306471..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/a0e442ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/b166b0e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/b166b0e4c42100141fce95f06aba7e85 deleted file mode 100644 index b577ce5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/b166b0e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/c01b63f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/c01b63f4c42100141fce95f06aba7e85 deleted file mode 100644 index e14370e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/c01b63f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.MimicWithMeta; -import com.ngb.projectzulu.common.world.terrain.PyramidFeature; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetTreasureDeadEnd implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetTreasureDeadEnd() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "deadend"; - } - - @Override - public int getWeight() { - return 50; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - cells[buildCoords.x][buildCoords.y].rawState = 2; - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 && ArchitectBase.isDeadEnd(cells, buildCoords, 1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1) { - if (random.nextInt(5) == 0) { - PyramidFeature terrainFeature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), terrainFeature.chestLootChance, - terrainFeature.chestMaxLoot); - - } else if (random.nextInt(4) == 0) { - return new MimicWithMeta(); - } - } - return new BlockWithMeta(Blocks.air); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/c04d82a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/c04d82a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb76021..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/c04d82a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/e0cba0f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/e0cba0f5c42100141fce95f06aba7e85 deleted file mode 100644 index db93898..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/e0cba0f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,174 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f0d669f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f0d669f8c42100141fce95f06aba7e85 deleted file mode 100644 index 56f5443..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f0d669f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.potion.effects.PotionCleansing; -import com.ngb.projectzulu.common.potion.effects.PotionCurse; -import com.ngb.projectzulu.common.potion.effects.PotionHarm2; -import com.ngb.projectzulu.common.potion.effects.PotionHeal2; -import com.ngb.projectzulu.common.potion.effects.PotionIncendiary; -import com.ngb.projectzulu.common.potion.effects.PotionSlowFall; -import com.ngb.projectzulu.common.potion.effects.PotionThorns; -import com.ngb.projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f0d8a9fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f0d8a9fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 78503e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f0d8a9fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f249acfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f249acfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 10a3d58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/cf/f249acfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/105aeee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/105aeee4c42100141fce95f06aba7e85 deleted file mode 100644 index 33df0df..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/105aeee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/109834a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/109834a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1e5246b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/109834a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/11348dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/11348dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7379320..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/11348dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,260 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/218dfb9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/218dfb9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 628bb47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/218dfb9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/5131809fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/5131809fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bd660aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/5131809fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionSlowFall extends PotionZulu { - - public PotionSlowFall(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(0, 0); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int amplifier) { - amplifier = amplifier > 10 ? 10 : amplifier < 0 ? 0 : amplifier; - if (par1EntityLiving.fallDistance > (10 - amplifier) * 2) { - par1EntityLiving.fallDistance = (10 - amplifier) * 2; - } - par1EntityLiving.motionY = Math.max(par1EntityLiving.motionY, -1.2f + (amplifier + 1f) * (0.1f)); - super.performEffect(par1EntityLiving, amplifier); - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 4 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/60ea35e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/60ea35e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5938363..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/60ea35e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,99 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityOstrich extends EntityGenericAnimal implements IAnimals { - - public EntityOstrich(World par1World) { - super(par1World); - setSize(1.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.2f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.wheat_seeds, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichlivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "ostrichhurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.wheat_seeds) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 12), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/7161f9e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/7161f9e5c42100141fce95f06aba7e85 deleted file mode 100644 index abd0d74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/7161f9e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionNightVision extends SubItemPotionGeneric { - - public SubItemPotionNightVision(Item itemID, int subID) { - super(itemID, subID, "potion.nightVision"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 13, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.nightVision); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - if (SubItemPotionList.INVISIBILITY.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.INVISIBILITY.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } else if (ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.Antennae.meta) { - if (SubItemPotionList.BLINDNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.BLINDNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/801b9aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/801b9aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0f2bace..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/801b9aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/808f6f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/808f6f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bb6d89c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/808f6f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandTriple extends BlockBrewingStandBase { - - public BlockBrewingStandTriple(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int par2) { - return new TileEntityBrewingTriple(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/b23d1efac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/b23d1efac42100141fce95f06aba7e85 deleted file mode 100644 index 3dde31b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/b23d1efac42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemAloeVera extends ItemBlock { - - public ItemAloeVera(Block block) { - super(block); - setHasSubtypes(true); - } - - public int getMetadata(int par1) { - return par1; - } - - public String getUnlocalizedName(ItemStack itemstack) { - String name = ""; - switch (itemstack.getItemDamage()) { - case 0: { - name = "base_1"; - break; - } - case 1: { - name = "base_2"; - break; - } - case 2: { - name = "base_3"; - break; - } - case 3: { - name = "base_4"; - break; - } - case 4: { - name = "flower_1"; - break; - } - case 5: { - name = "flower_2"; - break; - } - case 6: { - name = "flower_3"; - break; - } - case 7: { - name = "flower_4"; - break; - } - case 8: { - name = "flower_5"; - break; - } - default: - name = "base_1"; - } - return getUnlocalizedName() + "." + name; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/c048f2fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/c048f2fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3116a94..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/c048f2fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public ScaleArmorDeclaration(int renderIndex) { - super(new String[] { "ScaleHelmet", "ScaleChest", "ScaleLegs", "ScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.scaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.scaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.scaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.scaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.scaleArmorHead.get(); - break; - case 1: - item = ItemList.scaleArmorChest.get(); - break; - case 2: - item = ItemList.scaleArmorLeg.get(); - break; - case 3: - item = ItemList.scaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/f07cd600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/f07cd600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 78503e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d/f07cd600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMimic extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - boolean shouldHover = false; - - public EntityMimic(World par1World) { - super(par1World); - setSize(1.0f, 1.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMimic(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mimicliving"; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - /* If Player is Still Nearby after activation, do not become passive */ - if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - setAngerLevel(400); - } - } - - /** - * Returns true if this entity should push and be pushed by other entities when colliding. - */ - @Override - public boolean canBePushed() { - if (getEntityState() == EntityStates.idle) { - return false; - } else { - return !this.isDead; - } - } - - // Called when player interacts with mob, eg get milk, saddle - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - entityAttackedReaction(par1EntityPlayer); - return super.interact(par1EntityPlayer); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/001a8ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/001a8ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 3f682c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/001a8ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,14 +0,0 @@ -package projectzulu.common; - -public class CommonProxyProjectZulu { - - public int addArmor(String armor) { - return 0; - } - - public void bossHealthTicker() { - } - - public void registerModelsAndRender() { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/013d8de6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/013d8de6c42100141fce95f06aba7e85 deleted file mode 100644 index 0f2bace..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/013d8de6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/4044239fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/4044239fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7a14c74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/4044239fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseWhite; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/7127cbffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/7127cbffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d5696d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/7127cbffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreePlank; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/814b9ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/814b9ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d222aa6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/814b9ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import org.lwjgl.opengl.GL11; - -public class TileEntityUniversalFlowerPotRenderer extends TileEntitySpecialRenderer { - private RenderBlocks blockRenderer = new RenderBlocks(); - private RenderItem itemRenderer = new RenderItem(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - - renderTileEntityUniversalFlowerPotAt((TileEntityUniversalFlowerPot) tileEntity, xRenderCoord, yRenderCoord, - zRenderCoord, var8); - } - - private void renderTileEntityUniversalFlowerPotAt(TileEntityUniversalFlowerPot tileEntity, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float var8) { - - ItemStack itemStackToRender = tileEntity.getStackInSlot(0); - - if (itemStackToRender != null) { - Item itemToRender = itemStackToRender.getItem(); - - /* Try to See if I should render as Block */ - if (itemToRender != null && itemToRender instanceof ItemBlock - && Block.getBlockFromItem(itemToRender).getRenderType() != -1) { - Block blockToRender = Block.getBlockFromItem(itemToRender); - int meta = itemStackToRender.getItemDamage() > 16 ? 16 : itemStackToRender.getItemDamage() < 0 ? 0 - : itemStackToRender.getItemDamage(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glPushMatrix(); - float scaleBlock = (float) (0.29f / (blockToRender.getBlockBoundsMaxX() - blockToRender - .getBlockBoundsMinX())); - float scaleY = (float) (scaleBlock * (blockToRender.getBlockBoundsMaxY() - blockToRender - .getBlockBoundsMinY())); - - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.2 + scaleY), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleBlock, scaleBlock, scaleBlock); - - float brightness = 15f; - this.blockRenderer.renderBlockAsItem(blockToRender, meta, brightness); - GL11.glPopMatrix(); - return; - } - - /* Finally, try to render as Item */ - if (itemToRender != null) { - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(tileEntity.getWorldObj(), xRenderCoord, yRenderCoord, - zRenderCoord, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 0.6f; - GL11.glPushMatrix(); - this.bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), - (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - - } - } - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/8165f6e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/8165f6e3c42100141fce95f06aba7e85 deleted file mode 100644 index dc19269..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/8165f6e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a02ffefdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a02ffefdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 16b6634..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a02ffefdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockWateredDirt; -import projectzulu.common.blocks.ItemWateredDirt; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WateredDirtDeclaration extends BlockDeclaration { - - public WateredDirtDeclaration() { - super("WateredDirt"); - } - - @Override - protected boolean createBlock() { - BlockList.wateredDirt = Optional.of((new BlockWateredDirt()).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.wateredDirt.get(); - GameRegistry.registerBlock(block, ItemWateredDirt.class, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0348ea2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0348ea2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8578e9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/a0348ea2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetWall implements BlueprintSet, Blueprint { - - final List blocks = new ArrayList(); - - public BPSetWall() { - blocks.add(new BlockWithMeta(Blocks.sandstone, 0, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 1, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 2, 5)); - blocks.add(new BlockWithMeta(Blocks.sandstone, 3, 5)); - } - - @Override - public String getIdentifier() { - return "wall"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 1; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, blocks); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/c1dd73e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/c1dd73e5c42100141fce95f06aba7e85 deleted file mode 100644 index f98a97a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/c1dd73e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityLizard; -import projectzulu.common.mobs.models.ModelLizard; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/d010819ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/d010819ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a51477b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d0/d010819ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/109f1ea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/109f1ea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d6627a1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/109f1ea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/20e57ee6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/20e57ee6c42100141fce95f06aba7e85 deleted file mode 100644 index f1b984a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/20e57ee6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/21c456f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/21c456f8c42100141fce95f06aba7e85 deleted file mode 100644 index 82cf4ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/21c456f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/30de02f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/30de02f5c42100141fce95f06aba7e85 deleted file mode 100644 index 91020f2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/30de02f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class TileEntityBrewingStandRenderer extends TileEntitySpecialRenderer { - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - renderTileEntity((TileEntityBrewingBase) tileEntity, xRenderCoord, yRenderCoord, zRenderCoord, var8); - } - - private void renderTileEntity(TileEntityBrewingBase tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - RenderItem itemRenderer = new RenderItem(); - itemRenderer.setRenderManager(RenderManager.instance); - - ItemStack ingredientStack = tileEntity.brewingItemStacks[tileEntity.brewingItemStacks.length - 1]; - if (ingredientStack != null) { - if (ingredientStack.stackSize > 1) { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.28f); - } else { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.4f); - } - } - - float[] zOffsets = new float[] { 0, +0.29f, -0.29f }; - float[] rotation = new float[] { 90f, 0.0f, 0.0f }; - for (int i = 0; i < tileEntity.brewingItemStacks.length - 1; i++) { - ItemStack stackToRender = tileEntity.brewingItemStacks[i]; - if (stackToRender == null) { - continue; - } - renderItemStack(stackToRender, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord - 0.25D, - zRenderCoord + zOffsets[i], rotation[i], 0.6f); - } - } - - private void renderItemStack(ItemStack stackToRender, RenderItem renderer, World world, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float rotation, float scale) { - EntityItem entityItemToRender = new EntityItem(world, xRenderCoord, yRenderCoord, zRenderCoord, stackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = scale; - GL11.glPushMatrix(); - bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); - renderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/41c9dbffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/41c9dbffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 35ca46b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/41c9dbffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/61e941a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/61e941a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4505454..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/61e941a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,290 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.EntityPZPotion; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/709fa7ce9922001414aab7e331350948 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/709fa7ce9922001414aab7e331350948 deleted file mode 100644 index 819fa27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/709fa7ce9922001414aab7e331350948 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityRedFinch; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class YellowFinchDeclaration extends SpawnableDeclaration { - - public YellowFinchDeclaration() { - super("Yellow Finch", 22, EntityYellowFinch.class, EnumCreatureType.ambient); - setSpawnProperties(10, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 1); - - eggColor1 = (255 << 16) + (29 << 8) + 0; - eggColor2 = (255 << 16) + (203 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - customMobData.entityProperties = new EntityProperties(8f, 0.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/70dbdef4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/70dbdef4c42100141fce95f06aba7e85 deleted file mode 100644 index c5703aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/70dbdef4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/90b327fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/90b327fac42100141fce95f06aba7e85 deleted file mode 100644 index 24411cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/90b327fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,135 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelOstrichHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - - public ModelOstrichHead(){ - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 26F, -1F); - setRotation(BODYROT, -1.570796F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK1ROT.addChild(NECK3ROT); - BODYROT.addChild(NECK1ROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - switch ((int)skullState) { - case 1: - BODYROT.rotateAngleX = (float) (-90*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-10*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (25*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (30*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (40*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (30*Math.PI/180); - HEADROT.rotateAngleX = (float) (20*Math.PI/180); - break; - default: - BODYROT.rotateAngleX = (float) (0*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-35*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-30*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-25*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (-20*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (+25*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (+30*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (+35*Math.PI/180); - HEADROT.rotateAngleX = (float) (+50*Math.PI/180); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/a121b5e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/a121b5e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2fbb6be..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/a121b5e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.blocks.GuiAnimalName; -import projectzulu.common.blocks.tombstone.GuiTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.universalpot.ContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.GuiContainerUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.dungeon.GuiLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; -import projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingBase; -import cpw.mods.fml.common.network.IGuiHandler; - -public class ZuluGuiHandler implements IGuiHandler { - - @Override - public Object getServerGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - - TileEntity tileEntityServer; - switch (GuiID.getGuiIDByID(guiID)) { - case FlowerPot: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityUniversalFlowerPot) { - return new ContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityServer); - } - case BrewingStand: - tileEntityServer = world.getTileEntity(x, y, z); - if (tileEntityServer instanceof TileEntityBrewingBase) { - return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - default: - break; - } - return null; - - } - - @Override - public Object getClientGuiElement(int guiID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tileEntityClient; - switch (GuiID.getGuiIDByID(guiID)) { - case Tombstone: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityTombstone) { - return new GuiTombstone((TileEntityTombstone) tileEntityClient); - } - break; - case FlowerPot: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityUniversalFlowerPot) { - return new GuiContainerUniversalFlowerPot(player.inventory, - (TileEntityUniversalFlowerPot) tileEntityClient); - } - break; - case AnimalName: - return new GuiAnimalName(world, player, x); - case MobSpawner: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityLimitedMobSpawner) { - return new GuiLimitedMobSpawner((TileEntityLimitedMobSpawner) tileEntityClient); - } - case BrewingStand: - tileEntityClient = world.getTileEntity(x, y, z); - if (tileEntityClient instanceof TileEntityBrewingBase) { - return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); - } - case Unknown: - throw new IllegalStateException("GuiID cannot be Found" + guiID); - } - - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b003f7fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b003f7fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 42bbbb8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/b003f7fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemStructurePlacer; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class StructurePlacerDeclaration extends ItemDeclaration { - - public StructurePlacerDeclaration() { - super("StructurePlacer"); - } - - @Override - protected boolean createItem() { - ItemList.structurePlacer = Optional.of(new ItemStructurePlacer(name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.structurePlacer.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/c169b99fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/c169b99fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b4ee220..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/c169b99fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d039edbacaab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d039edbacaab00141ee9bf3050c1025b new file mode 100644 index 0000000..f56db0d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/d039edbacaab00141ee9bf3050c1025b @@ -0,0 +1,117 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void preInit(FMLPreInitializationEvent event, File configDirectory) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + //displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + config.save(); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e17a4afec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e17a4afec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 236b80c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d1/e17a4afec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/10c8c3f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/10c8c3f6c42100141fce95f06aba7e85 deleted file mode 100644 index c4b490f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/10c8c3f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,151 +0,0 @@ -package com.ngb.projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityUniversalFlowerPot extends TileEntity implements IInventory { - - private ItemStack[] inventory; - - public TileEntityUniversalFlowerPot() { - inventory = new ItemStack[1]; - } - - @Override - public int getSizeInventory() { - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public ItemStack decrStackSize(int slot, int amt) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize <= amt) { - setInventorySlotContents(slot, null); - } else { - stack = stack.splitStack(amt); - if (stack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - setInventorySlotContents(slot, null); - } - return stack; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this - && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - - NBTTagList itemList = new NBTTagList(); - for (int i = 0; i < inventory.length; i++) { - ItemStack stack = inventory[i]; - if (stack != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) i); - stack.writeToNBT(tag); - itemList.appendTag(tag); - } - } - tagCompound.setTag("Inventory", itemList); - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/319f26fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/319f26fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 290fe25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/319f26fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,120 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/407444e32d24001415179d45b0e27e9a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/407444e32d24001415179d45b0e27e9a deleted file mode 100644 index 63fcc53..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/407444e32d24001415179d45b0e27e9a +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString("Here lies " + player + " slain by a " event.source.getSourceOfDamage().getCommandSenderName()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/418f4bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/418f4bfac42100141fce95f06aba7e85 deleted file mode 100644 index c4017d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/418f4bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -public enum ItemList { - instance; - /* Items */ - public static Optional ankh = Optional.absent(); - public static Optional scaleItem = Optional.absent(); - public static Optional furPelt = Optional.absent(); - - public static Optional aloeVeraSeeds = Optional.absent(); - public static Optional waterDroplets = Optional.absent(); - - public static Optional coconutItem = Optional.absent(); - public static Optional coconutSeed = Optional.absent(); - public static Optional coconutShell = Optional.absent(); - public static Optional coconutMilkFragment = Optional.absent(); - - public static Optional genericCraftingItems = Optional.absent(); - public static Optional scrapMeat = Optional.absent(); - public static Optional structurePlacer = Optional.absent(); - public static Optional potionIngredients = Optional.absent(); - public static Optional customPotions = Optional.absent(); - public static Optional vanillaPotions = Optional.absent(); - - /* Armor */ - public static Optional scaleArmorHead = Optional.absent(); - public static Optional scaleArmorChest = Optional.absent(); - public static Optional scaleArmorLeg = Optional.absent(); - public static Optional scaleArmorBoots = Optional.absent(); - - public static Optional goldScaleArmorHead = Optional.absent(); - public static Optional goldScaleArmorChest = Optional.absent(); - public static Optional goldScaleArmorLeg = Optional.absent(); - public static Optional goldScaleArmorBoots = Optional.absent(); - - public static Optional ironScaleArmorHead = Optional.absent(); - public static Optional ironScaleArmorChest = Optional.absent(); - public static Optional ironScaleArmorLeg = Optional.absent(); - public static Optional ironScaleArmorBoots = Optional.absent(); - - public static Optional diamondScaleArmorHead = Optional.absent(); - public static Optional diamondScaleArmorChest = Optional.absent(); - public static Optional diamondScaleArmorLeg = Optional.absent(); - public static Optional diamondScaleArmorBoots = Optional.absent(); - - public static Optional whiteClothHead = Optional.absent(); - public static Optional whiteClothChest = Optional.absent(); - public static Optional whiteClothLeg = Optional.absent(); - public static Optional whiteClothBoots = Optional.absent(); - - public static Optional redClothHead = Optional.absent(); - public static Optional redClothChest = Optional.absent(); - public static Optional redClothLeg = Optional.absent(); - public static Optional redClothBoots = Optional.absent(); - - public static Optional greenClothHead = Optional.absent(); - public static Optional greenClothChest = Optional.absent(); - public static Optional greenClothLeg = Optional.absent(); - public static Optional greenClothBoots = Optional.absent(); - - public static Optional blueClothHead = Optional.absent(); - public static Optional blueClothChest = Optional.absent(); - public static Optional blueClothLeg = Optional.absent(); - public static Optional blueClothBoots = Optional.absent(); - - public static Optional cactusArmorHead = Optional.absent(); - public static Optional cactusArmorChest = Optional.absent(); - public static Optional cactusArmorLeg = Optional.absent(); - public static Optional cactusArmorBoots = Optional.absent(); - - public static Optional furArmorHead = Optional.absent(); - public static Optional furArmorChest = Optional.absent(); - public static Optional furArmorLeg = Optional.absent(); - public static Optional furArmorBoots = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/507ae89dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/507ae89dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fdcde8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/507ae89dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/5081132bc52100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/5081132bc52100141fce95f06aba7e85 deleted file mode 100644 index 1f3fa9b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/5081132bc52100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public abstract class BaseModule implements Module { - - @Override - public void registration(ItemBlockManager manager) { - } - - @Override - public void registration(CustomEntityManager manager) { - } - - @Override - public void registration(FeatureGenerator manager) { - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - } - - @Override - public void init(FMLInitializationEvent event, File configDirectory) { - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - } - - @Override - public void serverStart(FMLServerStartedEvent event, File configDirectory) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/620fa3f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/620fa3f8c42100141fce95f06aba7e85 deleted file mode 100644 index c81a2ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/620fa3f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummy extends ModelBiped { - - /** - * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms - * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how - * "far" arms and legs can swing at most. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/907469fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/907469fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9229b3b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/907469fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/91fc8ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/91fc8ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 91c8e41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/91fc8ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/a0264ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/a0264ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 4262051..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/a0264ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/a0aa27a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/a0aa27a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 27b395e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/a0aa27a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,13 +0,0 @@ -package projectzulu.common.potion.effects; - -public class PotionBubbling extends PotionZulu { - - protected PotionBubbling(int par1, boolean par2, int par3) { - super(par1, par2, par3); - } - - @Override - public boolean isInstant() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/b159b3ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/b159b3ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 306b828..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/b159b3ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandSingle; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandSingleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandSingleDeclaration() { - super("BrewingStandSingle"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Single Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandSingle = Optional.of(new BlockBrewingStandSingle(renderID).setBlockName("brewingsingle") - .setBlockTextureName(DefaultProps.blockKey + ":brewingsingle")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandSingle.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingSingle.class, "TileEntityBrewingSingle"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Single Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingSingle.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/d0b603e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/d0b603e5c42100141fce95f06aba7e85 deleted file mode 100644 index 28ccce0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/d0b603e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/e0355c998d2100141bd6a937048980ed b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/e0355c998d2100141bd6a937048980ed deleted file mode 100644 index 5ea5b20..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/e0355c998d2100141bd6a937048980ed +++ /dev/null @@ -1,353 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - 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(vec3, vec31); - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/f08635f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/f08635f5c42100141fce95f06aba7e85 deleted file mode 100644 index 558f554..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d2/f08635f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelPolarBear extends ModelBear { - - public ModelPolarBear() { - super(12); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 2 * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/212ee7e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/212ee7e4c42100141fce95f06aba7e85 deleted file mode 100644 index 88bb27a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/212ee7e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,109 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/31e887a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/31e887a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e235fe4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/31e887a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/4073c7a8302000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/4073c7a8302000141dbfc2e92eb0e949 deleted file mode 100644 index 2450331..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/4073c7a8302000141dbfc2e92eb0e949 +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.soulmod; - -public class SoulmodT1 { - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/504f64ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/504f64ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d30545..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/504f64ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,325 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/6073a8a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/6073a8a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c6ecb6e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/6073a8a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.Architect; - -public abstract class BuildingManagerBase implements BuildingManager { - public World world; - protected int blueprintPasses = 1; - - public BuildingManagerBase(World world) { - this.world = world; - - } - - @Override - public final void generate() { - randomizeCells(); - - for (int i = 1; i <= blueprintPasses; i++) { - assignBlueprints(i, blueprintPasses); - } - - construct(); - } - - protected ChunkCoordinates calcTranslatedPosition(FeatureDirection direction, ChunkCoordinates startingPos, - int xWidth, int zWidth, int height) { - if (direction == null) { - direction = FeatureDirection.CENTERED; - } - - switch (direction) { - case NORTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth); - case SOUTH: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ + 1); - case WEST: - return new ChunkCoordinates(startingPos.posX - xWidth, startingPos.posY, startingPos.posZ - zWidth / 2); - case EAST: - return new ChunkCoordinates(startingPos.posX + 1, startingPos.posY, startingPos.posZ - zWidth / 2); - case CENTERED: - default: - return new ChunkCoordinates(startingPos.posX - xWidth / 2, startingPos.posY, startingPos.posZ - zWidth / 2); - } - } - - /** - * Method to Perform processing on the Cell array. Typically this invloves invoking the Randomizer - */ - protected abstract void randomizeCells(); - - /** - * Method to Assign Blueprints to cells. Multiple can be peformed. The lastCall boolean indicates when the final - * pass is being performed, during which all cells should receive blueprints - */ - protected abstract void assignBlueprints(int pass, int maxPass); - - protected abstract void construct(); - - protected void processCellPieces(MazeCell currentCell, Architect architect) { - ChunkCoordinates pieceCoords = new ChunkCoordinates(0, 0, 0); - for (int pieceX = 0; pieceX < currentCell.size; pieceX++) { - for (int pieceZ = 0; pieceZ < currentCell.size; pieceZ++) { - for (int pieceY = 0; pieceY < currentCell.getHeight(); pieceY++) { - - /* Set Local Piece coordinates */ - pieceCoords.set(pieceX, pieceY, pieceZ); - BlockWithMeta block = architect.getBlockFromBlueprint(currentCell, - new ChunkCoordinates(pieceCoords)); - - /* Set Absolute Piece coordinates */ - pieceCoords.set(currentCell.initialPos.posX + pieceX, currentCell.initialPos.posY + pieceY, - currentCell.initialPos.posZ + pieceZ); - handleBlockPlacement(block, pieceCoords, world.rand); - } - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - return; - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/609041a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/609041a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41748eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/609041a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,321 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/828c9ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/828c9ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c27af5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/828c9ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public abstract class BPOasisEdge implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - - List flowers = new ArrayList(); - boolean inverted; - - public BPOasisEdge(boolean inverted) { - this.inverted = inverted; - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 10)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 6)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return grass; - } else { - return sand; - } - } else if (piecePos.posY == 3) { - if (isGrass(CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, random)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } else { - return air; - } - } - return air; - } - - public abstract boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random); - - @Override - public final String getIdentifier() { - return "OasisEdge".concat(Boolean.toString(inverted)).concat(childIdentifier()); - } - - public abstract String childIdentifier(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/90ca2500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/90ca2500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 97d61e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/90ca2500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/910454e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/910454e6c42100141fce95f06aba7e85 deleted file mode 100644 index 2320610..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/910454e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,543 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.src.BiomeGenBase; -//import net.minecraft.src.Block; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.EntityPlayer; -//import net.minecraft.src.EntityPlayerMP; -//import net.minecraft.src.Material; -//import net.minecraft.src.NBTTagCompound; -//import net.minecraft.src.Potion; -//import net.minecraft.src.PotionEffect; -//import net.minecraft.src.World; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class TemperatureTickerAttempt2 implements ITickHandler, IPlayerTracker{ -// -// public static final int tempDataWatcher = 18; -// -// /* Player Tempurature HashMaps */ -// private static float playerTemperature = 0; -//// private static Map temperatureMap = new HashMap(); -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// private static Map playerLocTempMap = new HashMap(); -// -//// private static Map playerOuterTempModifierMap = new HashMap(); -// -//// private static float[] blockTempMod = new float[4096]; -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private static float defaultTemperature = 0; -// -// private short DirtyFlag = 0; -// public TemperatureTickerAttempt2(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( lastWorldNameMap.containsKey( player.getEntityName() ) ){ -//// playerTemperature = temperatureMap.get( player.getEntityName() ); -// playerTemperature = getTempFromDataWatcher(player, tempDataWatcher); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -//// System.out.println("Should be Reading :".concat(worldName).concat(lastWorldName) ); -// -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// -//// System.out.println( "SETUP" ); -// -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// -//// /* Read From File */ -//// if ( HasPendingRead() ){ -//// readNBTFromFile(player); -//// ClearPendingRead(); -////// System.out.println( "READ" ); -//// } -// -// } -// -// /* Get Outside Temperature */ -// Float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// Float unTouchedPlayerLocationTemperature = playerLocationTemperature; -// Float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -//// playerLocationTemperature -= 0.1f*Math.abs(worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature()); -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -//// playerLocationTemperature += item.getAddToPlayTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -//// playerTemperature += item.getAddToLocTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// useFastHeatTransfer = currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 100 - (int)playerTemperatureDegrees)); -// -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Set Temperature To Datawatcher on Server Side */ -// if(player instanceof EntityPlayerMP){ -// updateTempInDataWatcher(player, tempDataWatcher, playerTemperature); -// } -// -// /* Save Temperature To Map*/ -//// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -//// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -//// if(player instanceof EntityPlayerMP){ -//// -//// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -//// DataOutputStream data = new DataOutputStream(bytes); -////// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -//// try { -//// data.writeFloat(playerTemperature); -//// } catch (Exception e) { -//// e.printStackTrace(); -//// } -//// -//// Packet250CustomPayload packet = new Packet250CustomPayload(); -//// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -//// packet.data = bytes.toByteArray(); -//// packet.length = packet.data.length; -//// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -////// System.out.println( player.getEntityName().concat("Sent Packet ")); -//// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// try -// { -// -////// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// // File file = new File(ModLoader.getMinecraftInstance().getMinecraftDir() + "/saves/" + ModLoader.getMinecraftInstance().theWorld.saveHandler.getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// if(!file.exists()) -//// { -//// file.createNewFile(); -//// } -//// FileOutputStream fileoutputstream = new FileOutputStream(file); -//// NBTTagCompound nbttagcompound = new NBTTagCompound(); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), getTempFromDataWatcher(player, tempDataWatcher) ); -// -//// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), playerTemperature); -// -//// CompressedStreamTools.writeCompressed(nbttagcompound, fileoutputstream); -//// fileoutputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// try -// { -//// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// -//// if(!file.exists()) -//// { -//// return; -//// } -//// FileInputStream fileinputstream = new FileInputStream(file); -//// NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// if (nbttagcompound.hasKey( player.getEntityName().concat("zulu_temperature_a") )){ -// updateTempInDataWatcher(player, tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -// -//// player.getDataWatcher().updateObject(tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -//// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") ); -// } -// -//// fileinputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -//// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -//// -//// /* Get Relevent Data From DataStream */ -//// float tempTemp = playerTemperature; -//// try { -//// tempTemp = data.readFloat(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// } -//// -//// /* Make Sure Player Exists, then Assign data to map */ -//// if(temperatureMap.containsKey(sender.getEntityName())){ -//// temperatureMap.put(sender.getEntityName(), tempTemp); -////// System.out.println( sender.getEntityName().concat("Received Packet ")); -//// -//// } -//// -//// -//// } -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -//// temperatureMap.put(player.getEntityName(), 0.0f); -// -// lastWorldNameMap.put(player.getEntityName(), ""); -// player.getDataWatcher().addObject(tempDataWatcher, (int)playerTemperature); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -//// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// -// } -// -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell) && !player.worldObj.isRemote){ -// player.getDataWatcher().updateObject(tempDataWatcher, defaultTemperature); -//// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -//// System.out.println("Player Respawned"); -// -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) getTempFromDataWatcher(player, tempDataWatcher); -//// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static void updateTempInDataWatcher(EntityPlayer player, int index, float value){ -// player.getDataWatcher().updateObject(index, (int)value); -// } -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static Float getTempFromDataWatcher(EntityPlayer player, int index){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) player.getDataWatcher().getWatchableObjectInt(index); -// } -// return 0f; -// } -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/919ac3f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/919ac3f9c42100141fce95f06aba7e85 deleted file mode 100644 index 437b4ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/919ac3f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZPotionTab extends CreativeTabs { - - public CreativePZPotionTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - public Item getTabIconItem() { - return Items.potionitem; - } - - @Override - public int func_151243_f() { - return 3; - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu Potions"; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/a19421f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/a19421f6c42100141fce95f06aba7e85 deleted file mode 100644 index 2f6ebe5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/a19421f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserTop extends KeyParserBase { - - public KeyParserTop(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isTopBlock = world.getBiomeGenForCoords(xCoord, zCoord).topBlock == world.getBlock(xCoord, yCoord - 1, - zCoord); - return isInverted ? isTopBlock : !isTopBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/b0fa9ce4b9ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/b0fa9ce4b9ab00141ee9bf3050c1025b new file mode 100644 index 0000000..2573cc3 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/b0fa9ce4b9ab00141ee9bf3050c1025b @@ -0,0 +1,289 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = true; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + + config.save(); + + System.out.println("***** Done setting up the config for spawned bugs"); + + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(6); + + if (stickDrop == 0) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.grass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(20) == 0) { + int bugType = rand1.nextInt(20); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/b2f78c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/b2f78c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f92608a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/b2f78c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c000b94a0c2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c000b94a0c2100141769cb1ed0c338cd deleted file mode 100644 index 6bb1657..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/c000b94a0c2100141769cb1ed0c338cd +++ /dev/null @@ -1,357 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e069499fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e069499fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5a34409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e069499fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,596 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e0949be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e0949be6c42100141fce95f06aba7e85 deleted file mode 100644 index 49280ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/e0949be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world2; - -import org.apache.commons.lang3.tuple.Pair; - -/** - * For usage see: {@link Pair} - */ -public class BoundaryPair { - private final K lower; - private final V upper; - - public static BoundaryPair createPair(K lower, V upper) { - return new BoundaryPair(lower, upper); - } - - public BoundaryPair(K lower, V upper) { - this.lower = lower; - this.upper = upper; - } - - public K getLowerLimit() { - return lower; - } - - public V getUpperLimit() { - return upper; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/f16f0aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/f16f0aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index be62ca8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d3/f16f0aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -public enum ItemList { - instance; - /* Items */ - public static Optional ankh = Optional.absent(); - public static Optional scaleItem = Optional.absent(); - public static Optional furPelt = Optional.absent(); - - public static Optional aloeVeraSeeds = Optional.absent(); - public static Optional waterDroplets = Optional.absent(); - - public static Optional coconutItem = Optional.absent(); - public static Optional coconutSeed = Optional.absent(); - public static Optional coconutShell = Optional.absent(); - public static Optional coconutMilkFragment = Optional.absent(); - - public static Optional genericCraftingItems = Optional.absent(); - public static Optional scrapMeat = Optional.absent(); - public static Optional structurePlacer = Optional.absent(); - public static Optional potionIngredients = Optional.absent(); - public static Optional customPotions = Optional.absent(); - public static Optional vanillaPotions = Optional.absent(); - - /* Armor */ - public static Optional scaleArmorHead = Optional.absent(); - public static Optional scaleArmorChest = Optional.absent(); - public static Optional scaleArmorLeg = Optional.absent(); - public static Optional scaleArmorBoots = Optional.absent(); - - public static Optional goldScaleArmorHead = Optional.absent(); - public static Optional goldScaleArmorChest = Optional.absent(); - public static Optional goldScaleArmorLeg = Optional.absent(); - public static Optional goldScaleArmorBoots = Optional.absent(); - - public static Optional ironScaleArmorHead = Optional.absent(); - public static Optional ironScaleArmorChest = Optional.absent(); - public static Optional ironScaleArmorLeg = Optional.absent(); - public static Optional ironScaleArmorBoots = Optional.absent(); - - public static Optional diamondScaleArmorHead = Optional.absent(); - public static Optional diamondScaleArmorChest = Optional.absent(); - public static Optional diamondScaleArmorLeg = Optional.absent(); - public static Optional diamondScaleArmorBoots = Optional.absent(); - - public static Optional whiteClothHead = Optional.absent(); - public static Optional whiteClothChest = Optional.absent(); - public static Optional whiteClothLeg = Optional.absent(); - public static Optional whiteClothBoots = Optional.absent(); - - public static Optional redClothHead = Optional.absent(); - public static Optional redClothChest = Optional.absent(); - public static Optional redClothLeg = Optional.absent(); - public static Optional redClothBoots = Optional.absent(); - - public static Optional greenClothHead = Optional.absent(); - public static Optional greenClothChest = Optional.absent(); - public static Optional greenClothLeg = Optional.absent(); - public static Optional greenClothBoots = Optional.absent(); - - public static Optional blueClothHead = Optional.absent(); - public static Optional blueClothChest = Optional.absent(); - public static Optional blueClothLeg = Optional.absent(); - public static Optional blueClothBoots = Optional.absent(); - - public static Optional cactusArmorHead = Optional.absent(); - public static Optional cactusArmorChest = Optional.absent(); - public static Optional cactusArmorLeg = Optional.absent(); - public static Optional cactusArmorBoots = Optional.absent(); - - public static Optional furArmorHead = Optional.absent(); - public static Optional furArmorChest = Optional.absent(); - public static Optional furArmorLeg = Optional.absent(); - public static Optional furArmorBoots = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/1161649ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/1161649ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f410cb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/1161649ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public interface TerrainFeature { - - /** - * The ordinal declaration of this ENUM determines priority during feature generation. Value declared first gets - * precedent. - */ - enum Size { - /* Feature is larger than a single chunk */ - LARGE, - /* Is approximately the size of a chunk */ - MEDIUM, - /* Size is less than a chunk, but more than a block */ - SMALL, - /* Spans a single or a couple blocks */ - TINY - } - - public enum FeatureDirection { - /* Structure should be centered on Current Block */ - CENTERED, - /* Structure should be centered along X but generate along -Z axis away from this block */ - NORTH, - /* Structure should be centered along X but generate along +Z axis away from this block */ - SOUTH, - /* Structure should be centered along Z but generate along -X axis away from this block */ - WEST, - /* Structure should be centered along Z but generate along +X axis away from this block */ - EAST; - } - - public abstract String getFeatureName(); - - public abstract boolean isEnabled(); - - public abstract Size getFeatureSize(); - - public abstract void initialize(File modConfigDirectory); - - /** - * From the World and Chunk. Generates an array of positions to attempt to generate the feature at. - * - * Each Point should be able to spawn - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @return - */ - public abstract ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ); - - /** - * Determines if the Feature can generate at the specified coordinates - * - * @param world World to generate in - * @param chunkX X Coordinate of Chunk to generate in - * @param chunkZ Z Coordinate of Chunk to generate in - * @param genBlockCoords Coordinates to generate at - * @param random - * @return - */ - public abstract boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract boolean isStructureHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random); - - public abstract void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, - Random random, FeatureDirection direction); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/20c456f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/20c456f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6f62f6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/20c456f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/21e57ee6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/21e57ee6c42100141fce95f06aba7e85 deleted file mode 100644 index da42b04..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/21e57ee6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,240 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/31ca35f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/31ca35f4c42100141fce95f06aba7e85 deleted file mode 100644 index 2b7fc01..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/31ca35f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,92 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectCathedral; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; -import com.ngb.projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerCathedral extends BuildingManagerBase { - - public ArchitectCathedral architect; - public Randomizer randomizer; - - MazeCell[][] cathedral; - - public BuildingManagerCathedral(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCathedral(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 7; - int zCells = 7; - int cellSize = 6; - int cellHeight = 15; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cathedral = new MazeCell[xCells][zCells]; - for (int i = 0; i < cathedral.length; i++) { - for (int j = 0; j < cathedral[0].length; j++) { - cathedral[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cathedral); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - architect.assignBlueprint(cathedral, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cathedral.length; cellX++) { - for (int cellZ = 0; cellZ < cathedral[0].length; cellZ++) { - MazeCell currentCell = cathedral[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - if (blockWithMeta == null || !world.blockExists(position.posX, position.posY, position.posZ)) { - blockWithMeta = new BlockWithMeta(Blocks.air); - } - - /* - * Check if There is a Tile At This Block, if so, remove it This Doesn't Seem to Work, So Block Is only placed - * if there is not TileEntity so as to prevent crash - */ - TileEntity tileEntity = world.getTileEntity(position.posX, position.posY, position.posZ); - if (tileEntity != null) { - tileEntity.invalidate(); - world.removeTileEntity(position.posX, position.posY, position.posZ); - world.setBlock(position.posX, position.posY, position.posZ, Block.getBlockFromName("air")); - } else { - /* Check Block to See How Block wants to be Placed */ - blockWithMeta.placeBlock(world, position, random); - } - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/3216ade5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/3216ade5c42100141fce95f06aba7e85 deleted file mode 100644 index 068d4dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/3216ade5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,439 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/50181c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/50181c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d892468..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/50181c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,84 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBlack; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/51163de5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/51163de5c42100141fce95f06aba7e85 deleted file mode 100644 index 0ac6e9c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/51163de5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.mobs.entity; - -public enum EntityStates { - /* Primary States : Practically used by Everything */ - idle(0), - looking(1), - attacking(2), - - /* Secondary States : Common */ - fleeing(7), - following(6), - inLove(8), - sitting(9), - - /* Tertiary States : Used Rarely */ - stayStill(11), - posture(5), - inCover(10), - unknown(-1); - - public final int index; - public int index() { return index; } - - EntityStates(int index) { - this.index = index; - } - - /* Return unknown if State Cannot be Found */ - public static EntityStates getEntityByIndex(int index){ - for (EntityStates entityState : EntityStates.values()) { - if(entityState.index == index){ - return entityState; - } - } - return unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/615da2f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/615da2f6c42100141fce95f06aba7e85 deleted file mode 100644 index 474f140..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/615da2f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; - -public interface ItemBlockDeclaration { - - public enum Type { - Block, Item; - } - - public abstract Type getType(); - - public abstract int getRegisterPass(); - - /** - * Loads ands saves the ItemBlock from the configuration filed. - * - * Called twice. Once for ItemBlocks already in the Config and again for new Items. Pass is indicated by readOnly - * boolean. - * - * @param config Configuration file to read save from - * @param readOnly Boolean indicating this is the pass for ItemBlock already in the Configuration file - */ - public abstract void createWithConfig(Configuration config, boolean readOnly); - - /** - * Registers the Created Block with the Environment - * - * i.e GameRegistry - */ - public abstract void register(Side side); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/616239f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/616239f6c42100141fce95f06aba7e85 deleted file mode 100644 index 89b649b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/616239f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/61d8479ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/61d8479ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9cc6afe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/61d8479ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.core; - - -public enum GuiID { - Tombstone(0), - FlowerPot(1), - AnimalName(2), - MobSpawner(3), - BrewingStand(4), - Unknown(-1); - - private int iD; - private GuiID(int iD) { - this.iD = iD; - } - - public int getID(){ - return iD; - } - - public static GuiID getGuiIDByID(int iD){ - for (GuiID guiID : GuiID.values()) { - if(guiID.iD == iD){ - return guiID; - } - } - return Unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/703f55a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/703f55a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b7e48a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/703f55a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/705c62e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/705c62e6c42100141fce95f06aba7e85 deleted file mode 100644 index 44c6f23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/705c62e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,160 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/71bb769fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/71bb769fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 55aa04c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/71bb769fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingSingle extends TileEntityBrewingBase { - - public TileEntityBrewingSingle() { - brewingItemStacks = new ItemStack[2]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/80f6d29dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/80f6d29dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 02ea4e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/80f6d29dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityMobHeads extends TileEntity { - - /* Passed in From Item Damage */ - private int skullType; - private int rotation; - private String ExtraType = ""; - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("SkullType", (byte) (this.skullType & 255)); - par1NBTTagCompound.setByte("Rot", (byte) (this.rotation & 255)); - par1NBTTagCompound.setString("ExtraType", this.ExtraType); - - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - skullType = par1NBTTagCompound.getByte("SkullType"); - rotation = par1NBTTagCompound.getByte("Rot"); - - if (par1NBTTagCompound.hasKey("ExtraType")) { - this.ExtraType = par1NBTTagCompound.getString("ExtraType"); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - NBTTagCompound tag = packet.func_148857_g(); - skullType = tag.getByte("SkullType"); - rotation = tag.getByte("Rot"); - } - - public void setSkullType(int par1, String par2Str) { - skullType = par1; - ExtraType = par2Str; - } - - public int getSkullType() { - return skullType; - } - - public void setRotation(int par1) { - rotation = par1; - } - - @SideOnly(Side.CLIENT) - public int getRotation() { - return rotation; - } - - @SideOnly(Side.CLIENT) - public String getExtraType() { - return ExtraType; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/b1681af6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/b1681af6c42100141fce95f06aba7e85 deleted file mode 100644 index 4c1ab76..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/b1681af6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,127 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import com.ngb.projectzulu.common.core.ProjectZuluLog; - - -public class ParsingHelper { - - /** - * Attempt to Parse an Integer. Performs no filters. - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static int parseInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Integer. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static int parseFilteredInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Long. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static Long parseFilteredLong(String value, Long fallBack, String fieldName) { - try { - return Long.parseLong(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an long. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an long. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Float. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static float parseFilteredFloat(String value, float fallBack, String fieldName) { - try { - return Float.parseFloat(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Double. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static double parseFilteredDouble(String value, double fallBack, String fieldName) { - try { - return Double.parseDouble(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Boolean - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static boolean parseBoolean(String value, boolean fallBack, String fieldName) { - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for a boolean. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for a boolean. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } else { - return Boolean.parseBoolean(value); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/c044eef4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/c044eef4c42100141fce95f06aba7e85 deleted file mode 100644 index e986f3f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/c044eef4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import com.ngb.projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/c0c6ee9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/c0c6ee9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e2b4a0c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/c0c6ee9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f01e2358c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f01e2358c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 57062eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f01e2358c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,66 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityGenericCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityGenericCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)chunkcoordinates.posX, (double)chunkcoordinates.posY, (double)chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f040fae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f040fae4c42100141fce95f06aba7e85 deleted file mode 100644 index d53c409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f040fae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,133 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.keys.KeyParser.KeyType; - -/** - * For style see {@link OptionalSettings} - */ -public abstract class OptionalSettingsBase extends OptionalSettings { - - public static int defaultBlockRange = 3; - public static int defaultSpawnRate = 40; - - public OptionalSettingsBase(String parseableString, EnumSet validKeys) { - super(parseableString, validKeys); - parseString(); - } - - @Override - public boolean isOptionalEnabled() { - return isEnabled; - } - - @Override - public boolean isInverted() { - return isInverted; - } - - @Override - protected final void parseString() { - if (stringParsed || parseableString.equals("")) { - return; - } - stringParsed = true; - String[] masterParts = parseableString.split(":"); - for (int i = 0; i < masterParts.length; i++) { - if (i == 0) { - for (Key key : validKeys) { - if (key.keyParser == null || key.keyParser.getKeyType() != KeyType.PARENT) { - continue; - } - if (key.keyParser.isMatch(masterParts[i])) { - isEnabled = true; - if (key.keyParser.isInvertable() && key.keyParser.isInverted(masterParts[i])) { - isInverted = true; - } else { - isInverted = false; - } - /* The isOperand operation is not needed since isMatch return false for invalid characters */ - operand = key.keyParser.parseOperand(masterParts[i]); - } - } - } else { - String[] childParts = masterParts[i].split(",", 2); - boolean foundMatch = false; - for (Key key : validKeys) { - if (key.keyParser == null) { - continue; - } - if (key.keyParser.isMatch(childParts[0])) { - foundMatch = true; - if (key.keyParser.getKeyType() == KeyType.CHAINABLE) { - if (!key.keyParser.parseChainable(masterParts[i], parsedChainable, operandvalue)) { - ProjectZuluLog.severe("Failed to Parse Chainable from %s", masterParts[i]); - } - } else if (key.keyParser.getKeyType() == KeyType.VALUE) { - if (!key.keyParser.parseValue(masterParts[i], valueCache)) { - ProjectZuluLog.severe("Failed to Parse Value from %s", masterParts[i]); - } - } - break; - } - } - if (!foundMatch) { - ProjectZuluLog.severe("Could Not Recognize any valid %s properties from %s", this.getClass() - .getSimpleName(), masterParts[i]); - } - } - } - } - - /** - * - * @param world World being evaluated - * @param entity Entity being processed. May be null where not applicable. - * @param xCoord X coord location in the world - * @param yCoord Y coord location in the world - * @param zCoord Z coord location in the world - * @return - */ - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord) { - boolean outcome = true; - for (int i = 0; i < parsedChainable.size(); i++) { - TypeValuePair typeValuePair = parsedChainable.get(i); - if (i != 0) { - if (operandvalue.get(i) == Operand.AND && outcome == true) { - continue; - } else if (operandvalue.get(i) == Operand.OR && outcome == false) { - return false; - } - } - - Key key = typeValuePair.getType(); - outcome = key.keyParser.isValidLocation(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - return outcome; - } - - /** - * Checks if the Distance to - * - * @param playerDistance Distance to the playe rin [m^2] - * @param defaultCutoff Default Range in [m] - * @return True to Continue as Normal, False to Interrupt - */ - public boolean isMidDistance(int playerDistance, int defaultCutoff) { - parseString(); - Integer tempCutoff = (Integer) valueCache.get(Key.spawnRange); - defaultCutoff = tempCutoff == null ? defaultCutoff : tempCutoff; - return playerDistance > defaultCutoff * defaultCutoff; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = world.getTopSolidOrLiquidBlock(xCoord, zCoord); - return blockHeight <= yCoord; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f28d01fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f28d01fac42100141fce95f06aba7e85 deleted file mode 100644 index aa6ea58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d4/f28d01fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreePlank; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/101365a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/101365a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b059077..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/101365a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.BlockTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/113ba8f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/113ba8f4c42100141fce95f06aba7e85 deleted file mode 100644 index 47a2259..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/113ba8f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempBlock { - - /** - * Factor that adds to the current Player Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Block is Nearby - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHeatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/301b2a01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/301b2a01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb41917..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/301b2a01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/30d4a300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/30d4a300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 08b2311..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/30d4a300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/318919f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/318919f7c42100141fce95f06aba7e85 deleted file mode 100644 index 6e7e8ca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/318919f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockZuluSlab; -import com.ngb.projectzulu.common.blocks.ItemZuluSlab; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeDoubleSlabDeclaration extends BlockDeclaration { - - public PalmTreeDoubleSlabDeclaration() { - super("PalmTreeDoubleSlab", 2); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeDoubleSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreeSlab.get(), - BlockList.palmTreePlank.get())).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeDoubleSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/40f6aef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/40f6aef8c42100141fce95f06aba7e85 deleted file mode 100644 index ec402ce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/40f6aef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,291 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/4153e4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/4153e4f7c42100141fce95f06aba7e85 deleted file mode 100644 index 7df639e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/4153e4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import net.minecraft.block.Block; - -import com.google.common.base.Optional; - -public enum BlockList { - instance; - public static Optional palmHoloTree = Optional.absent(); // Not Used? - - public static Optional aloeVera = Optional.absent(); - public static Optional wateredDirt = Optional.absent(); - public static Optional tumbleweed = Optional.absent(); - public static Optional jasper = Optional.absent(); - - public static Optional palmTreeLog = Optional.absent(); - public static Optional palmTreePlank = Optional.absent(); - public static Optional palmTreeSlab = Optional.absent(); - public static Optional palmTreeDoubleSlab = Optional.absent(); - public static Optional palmTreeStairs = Optional.absent(); - public static Optional palmTreeLeaves = Optional.absent(); - public static Optional palmTreeSapling = Optional.absent(); - public static Optional coconut = Optional.absent(); - - public static Optional nightBloom = Optional.absent(); - public static Optional creeperBlossom = Optional.absent(); - public static Optional quickSand = Optional.absent(); - - public static Optional spike = Optional.absent(); - public static Optional campfire = Optional.absent(); - public static Optional mobHeads = Optional.absent(); - public static Optional tombstone = Optional.absent(); - - public static Optional universalFlowerPot = Optional.absent(); - public static Optional customBrewingStand = Optional.absent(); - public static Optional limitedMobSpawner = Optional.absent(); - public static Optional brewingStandSingle = Optional.absent(); - public static Optional brewingStandTriple = Optional.absent(); - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/62c63afac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/62c63afac42100141fce95f06aba7e85 deleted file mode 100644 index 2d0ebb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/62c63afac42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70cc77fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70cc77fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8567684..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/70cc77fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,206 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/917735a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/917735a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7e4971d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/917735a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,52 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelPenguinHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelPenguinHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 24F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/91acd09dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/91acd09dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 80f72f2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/91acd09dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,93 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelVultureHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer HEADROT; - - - public ModelVultureHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("NECKROT1.neck1", 8, 10); - setTextureOffset("NECKROT2.neck2", 8, 10); - setTextureOffset("NECKROT3.neck3", 8, 10); - setTextureOffset("HEADROT.mouthbot", 0, 25); - setTextureOffset("HEADROT.mouthtal", 6, 25); - setTextureOffset("HEADROT.mouthtop", 0, 21); - setTextureOffset("HEADROT.head", 0, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F, 24.5F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, 0F, 1F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -0.5F, -2F, -0.5F, 1, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("mouthbot", -0.5F, 0.5F, -4F, 1, 1, 2); - HEADROT.addBox("mouthtal", -1F, 0.5F, -5F, 2, 2, 1); - HEADROT.addBox("mouthtop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - NECKROT3.addChild(HEADROT); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - BODYROT.addChild(NECKROT1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); - break; - - default: - NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/91c028f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/91c028f6c42100141fce95f06aba7e85 deleted file mode 100644 index 433cdfb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/91c028f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public abstract class KeyParserRange extends KeyParserBase { - - public KeyParserRange(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 3) { - int min = ParsingHelper.parseFilteredInteger(pieces[1], 16, "1st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[2], -1, "2nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int current = getCurrent(world, entity, xCoord, yCoord, zCoord, typeValuePair, valueCache); - int minRange = (Integer) values[1]; - int maxRange = (Integer) values[2]; - - boolean isValid = !(current <= maxRange && current >= minRange); - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - abstract int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b19a579fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b19a579fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 58633e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/b19a579fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,173 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelRhino extends ModelBase { - float heightToRaise = 9f; - float renderScale = 1.6f; - - ModelRenderer LEG3ROT; - ModelRenderer LEG4ROT; - ModelRenderer LEG2ROT; - ModelRenderer HEADROT; - ModelRenderer LEG1ROT; - ModelRenderer TAILROT; - ModelRenderer BODYROT; - - public ModelRhino() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG3ROT.leg3", 48, 13); - setTextureOffset("LEG3ROT.toe31", 0, 0); - setTextureOffset("LEG3ROT.toe32", 0, 0); - setTextureOffset("LEG3ROT.toe33", 0, 0); - setTextureOffset("LEG4ROT.leg4", 68, 13); - setTextureOffset("LEG4ROT.toe41", 0, 0); - setTextureOffset("LEG4ROT.toe42", 0, 0); - setTextureOffset("LEG4ROT.toe43", 0, 0); - setTextureOffset("LEG2ROT.leg2", 68, 0); - setTextureOffset("LEG2ROT.toe21", 0, 0); - setTextureOffset("LEG2ROT.toe22", 0, 0); - setTextureOffset("LEG2ROT.toe23", 0, 0); - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - setTextureOffset("LEG1ROT.toe11", 0, 0); - setTextureOffset("LEG1ROT.toe12", 0, 0); - setTextureOffset("LEG1ROT.toe13", 0, 0); - setTextureOffset("LEG1ROT.leg1", 48, 0); - setTextureOffset("TAILROT.tail", 0, 25); - setTextureOffset("BODYROT.leg1dec", 20, 25); - setTextureOffset("BODYROT.leg2dec", 20, 25); - setTextureOffset("BODYROT.body", 0, 32); - - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG3ROT.addBox("toe31", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe32", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG3ROT.addBox("toe33", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(4.5F, 15F - heightToRaise, 9.5F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2.5F, 0F, -2.5F, 5, 9, 5); - LEG4ROT.addBox("toe41", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe42", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG4ROT.addBox("toe43", 1.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(4F, 15F - heightToRaise, -5F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2.5F, 1F, -2.5F, 5, 8, 5); - LEG2ROT.addBox("toe21", -2.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe22", -0.5F, 8F, -3.5F, 1, 1, 1); - LEG2ROT.addBox("toe23", 1.5F, 8F, -3.5F, 1, 1, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 9F - heightToRaise, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-4F, 15F - heightToRaise, -5F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("toe11", -2.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe12", -0.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("toe13", 1.5F, 8F, -3F, 1, 1, 1); - LEG1ROT.addBox("leg1", -2.5F, 1F, -2F, 5, 8, 5); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 9F - heightToRaise, 12F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.5F, -0.5F, 0F, 1, 1, 6); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F - heightToRaise, -8F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("leg1dec", -7F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("leg2dec", 1F, 5F, 0F, 6, 1, 6); - BODYROT.addBox("body", -7F, -7F, 0F, 14, 12, 20); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 6.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(renderScale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - GL11.glPopMatrix(); - } else { - LEG3ROT.render(renderScale * f5); - LEG4ROT.render(renderScale * f5); - LEG2ROT.render(renderScale * f5); - HEADROT.render(renderScale * f5); - LEG1ROT.render(renderScale * f5); - TAILROT.render(renderScale * f5); - BODYROT.render(renderScale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Constant Animation Rotations */ - LEG1ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - TAILROT.rotateAngleX = (float) (-90 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/d0843be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/d0843be4c42100141fce95f06aba7e85 deleted file mode 100644 index e5acb66..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/d0843be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutShell; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/e10fcce5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/e10fcce5c42100141fce95f06aba7e85 deleted file mode 100644 index c7c4e95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/e10fcce5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; - -public class SlotBrewingStandSinglePotion extends Slot { - /** The player that has this container open. */ - private EntityPlayer player; - - public SlotBrewingStandSinglePotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, - int par5) { - super(par2IInventory, par3, par4, par5); - this.player = par1EntityPlayer; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return canHoldPotion(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 1; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack itemStack) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack)) { - this.player.addStat(AchievementList.potion, 1); - } - - super.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - /** - * Returns true if this itemstack can be filled with a potion - */ - public static boolean canHoldPotion(ItemStack itemStack) { - return itemStack != null - && (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack) || itemStack.getItem() == Items.potionitem - && itemStack.getItemDamage() == 0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/e20708f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/e20708f8c42100141fce95f06aba7e85 deleted file mode 100644 index 9e37e75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/e20708f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,220 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallwayEnd implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - return getWallBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner - || cellIndexDirection == CellIndexDirection.NorthEastCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner - || cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall); - } else { - piecePos = CellHelper.rotateCellTo(piecePos, cellSize, cellIndexDirection); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/f18b9bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/f18b9bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9aa6009..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/f18b9bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurPeltDeclaration extends ItemDeclaration { - - public FurPeltDeclaration() { - super("FurPelt"); - } - - @Override - protected boolean createItem() { - ItemList.furPelt = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.furPelt.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/f1ea23ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/f1ea23ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2420cc0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d5/f1ea23ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionDamageBoost; -import projectzulu.common.potion.subitem.SubItemPotionFireResistance; -import projectzulu.common.potion.subitem.SubItemPotionHarm; -import projectzulu.common.potion.subitem.SubItemPotionHeal; -import projectzulu.common.potion.subitem.SubItemPotionInvisibility; -import projectzulu.common.potion.subitem.SubItemPotionMoveSlowdown; -import projectzulu.common.potion.subitem.SubItemPotionMoveSpeed; -import projectzulu.common.potion.subitem.SubItemPotionNightVision; -import projectzulu.common.potion.subitem.SubItemPotionPoison; -import projectzulu.common.potion.subitem.SubItemPotionRegeneration; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionWeakness; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZVanillaPotionDeclaration extends ItemDeclaration { - - public PZVanillaPotionDeclaration() { - super("PZVanillaPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.vanillaPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - - addToLists(item, i++, SubItemPotionList.STRENGTH, list, SubItemPotionDamageBoost.class); - addToLists(item, i++, SubItemPotionList.REGENERATION, list, SubItemPotionRegeneration.class); - addToLists(item, i++, SubItemPotionList.POISON, list, SubItemPotionPoison.class); - addToLists(item, i++, SubItemPotionList.WEAKNESS, list, SubItemPotionWeakness.class); - addToLists(item, i++, SubItemPotionList.MOVE_SPEED, list, SubItemPotionMoveSpeed.class); - addToLists(item, i++, SubItemPotionList.MOVE_SLOW, list, SubItemPotionMoveSlowdown.class); - addToLists(item, i++, SubItemPotionList.FIRE_RESISTANCE, list, SubItemPotionFireResistance.class); - addToLists(item, i++, SubItemPotionList.NIGHT_VISION, list, SubItemPotionNightVision.class); - addToLists(item, i++, SubItemPotionList.INVISIBILITY, list, SubItemPotionInvisibility.class); - addToLists(item, i++, SubItemPotionList.HEAL, list, SubItemPotionHeal.class); - addToLists(item, i++, SubItemPotionList.HARM, list, SubItemPotionHarm.class); - - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.vanillaPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }).newInstance( - new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/00d893f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/00d893f9c42100141fce95f06aba7e85 deleted file mode 100644 index 194c9da..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/00d893f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/01233cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/01233cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ac0bd1b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/01233cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLimitedMobSpawner extends BlockContainer { - - public BlockLimitedMobSpawner() { - super(Material.rock); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, - float par7, float par8, float par9) { - if (player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isCreativeMode) { - ((EntityPlayer) player).openGui(ProjectZulu_Core.modInstance, GuiID.MobSpawner.getID(), par1World, par2, - par3, par4); - return true; - } - return super.onBlockActivated(par1World, par2, par3, par4, player, par6, par7, par8, par9); - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityLimitedMobSpawner(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/202ee7e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/202ee7e4c42100141fce95f06aba7e85 deleted file mode 100644 index 5fa2c4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/202ee7e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40e421fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40e421fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c0ba51c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/40e421fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.blocks.util.StringHelper; -import projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/50b907e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/50b907e6c42100141fce95f06aba7e85 deleted file mode 100644 index 26593f9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/50b907e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common; - -import java.io.File; - -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/607933e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/607933e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5414777..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/607933e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,152 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.client.model.ModelRenderer; -/** - * Used for Models that need to Track their Rotation - * i.e. Rotate based on their previous rotation angle - * See {@link #ModelArmadillo} - */ -public class EntityModelRotation { - public float rotateAngleX = 0; - public float rotateAngleY = 0; - public float rotateAngleZ = 0; - - public float rotationPointX; - public float rotationPointY; - public float rotationPointZ; - - public Boolean isSetup = false; - public String assignedPiece = "nothing"; - - private int xAngleDirec = 1; - private int yAngleDirec = 1; - public int zAngleDirec = 1; - - public EntityModelRotation() {} - - public void setup(ModelRenderer modelRenderer){ - rotateAngleX = modelRenderer.rotateAngleX; - rotateAngleY = modelRenderer.rotateAngleY; - rotateAngleZ = modelRenderer.rotateAngleZ; - rotationPointX = modelRenderer.rotationPointX; - rotationPointY = modelRenderer.rotationPointY; - rotationPointZ = modelRenderer.rotationPointZ; - - isSetup = true; - assignedPiece = modelRenderer.boxName; - } - - public float rotateX(float increment, float min, float max){ - rotateAngleX = clamp(rotateAngleX+increment, min, max); - return rotateAngleX; - } - - public float rotateY(float increment, float min, float max){ - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - public float rotateZ(float increment, float min, float max){ - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - - /** - * rotateZ Angle. - * par4 = 0 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min - */ - public float rotateZ(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleZ; - - case 2: - if(rotateAngleZ+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = max; - return rotateAngleZ; - } - - if(rotateAngleZ+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleZ = min; - return rotateAngleZ; - } - - rotateAngleZ = rotateAngleZ+increment*zAngleDirec; - return rotateAngleZ; - - default: - rotateAngleZ = clamp(rotateAngleZ+increment, min, max); - return rotateAngleZ; - } - } - - /* - * rotateY Angle. - * par4 = Default, clamp(min,max) - * par4 = 1, loop min--> max, max = min, min -->max (Not Implemented) - * par4 = 2, continuous min --> max --> min (Uses Cosine) - */ - public float rotateY(float increment, float min, float max, int par4){ - switch (par4) { - case 1: - // - return rotateAngleY; - - case 2: - if(rotateAngleY+increment*zAngleDirec >= max){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = max; - return rotateAngleY; - } - - if(rotateAngleY+increment*zAngleDirec <= min){ - zAngleDirec = zAngleDirec*-1; - rotateAngleY = min; - return rotateAngleY; - } - - rotateAngleY = rotateAngleY+increment*zAngleDirec; - return rotateAngleY; - - default: - rotateAngleY = clamp(rotateAngleY+increment, min, max); - return rotateAngleY; - } - } - - - - private float clamp(float number, float min, float max){ - return Math.max(Math.min(number, max), min); - } - private float loop(float number, float min, float max){ - if(number>max){ - return min+number-max; - } - if(number entityClass) { - return new RenderGenericLiving(new ModelRabbit(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rabbit.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/905ee7c54e20001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/905ee7c54e20001413909a661a93f408 deleted file mode 100644 index cfd8ae2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/905ee7c54e20001413909a661a93f408 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a direction when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - //return par0EntityCreature.a((double) k, (double) l, (double) i1); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/9094f68bce21001418ceed54b1d01b94 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/9094f68bce21001418ceed54b1d01b94 deleted file mode 100644 index d7c0f19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/9094f68bce21001418ceed54b1d01b94 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "com.ngb.projectzulu.common.ClientProxyProjectZulu", serverSide = "com.ngb.projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/a014b8ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/a014b8ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5c6556f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/a014b8ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/c0787af8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/c0787af8c42100141fce95f06aba7e85 deleted file mode 100644 index 91020f2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/c0787af8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -public class TileEntityBrewingStandRenderer extends TileEntitySpecialRenderer { - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - renderTileEntity((TileEntityBrewingBase) tileEntity, xRenderCoord, yRenderCoord, zRenderCoord, var8); - } - - private void renderTileEntity(TileEntityBrewingBase tileEntity, double xRenderCoord, double yRenderCoord, - double zRenderCoord, float var8) { - RenderItem itemRenderer = new RenderItem(); - itemRenderer.setRenderManager(RenderManager.instance); - - ItemStack ingredientStack = tileEntity.brewingItemStacks[tileEntity.brewingItemStacks.length - 1]; - if (ingredientStack != null) { - if (ingredientStack.stackSize > 1) { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.28f); - } else { - renderItemStack(ingredientStack, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord + 0.3D, - zRenderCoord, (float) (Math.pow(400 - tileEntity.getBrewTime(), 2)) / 20 + 90f, 0.4f); - } - } - - float[] zOffsets = new float[] { 0, +0.29f, -0.29f }; - float[] rotation = new float[] { 90f, 0.0f, 0.0f }; - for (int i = 0; i < tileEntity.brewingItemStacks.length - 1; i++) { - ItemStack stackToRender = tileEntity.brewingItemStacks[i]; - if (stackToRender == null) { - continue; - } - renderItemStack(stackToRender, itemRenderer, tileEntity.getWorldObj(), xRenderCoord, yRenderCoord - 0.25D, - zRenderCoord + zOffsets[i], rotation[i], 0.6f); - } - } - - private void renderItemStack(ItemStack stackToRender, RenderItem renderer, World world, double xRenderCoord, - double yRenderCoord, double zRenderCoord, float rotation, float scale) { - EntityItem entityItemToRender = new EntityItem(world, xRenderCoord, yRenderCoord, zRenderCoord, stackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = scale; - GL11.glPushMatrix(); - bindTexture(TextureMap.locationBlocksTexture); - GL11.glTranslatef((float) xRenderCoord + 0.5f, (float) (yRenderCoord + 0.3), (float) zRenderCoord + 0.5f); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); - renderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/d12706e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/d12706e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4a2e5ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/d12706e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,232 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/e287449fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/e287449fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5853d75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/e287449fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,211 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGiraffe; - -public class ModelGiraffe extends ModelBase { - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer tail; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - private ModelRenderer HEADROT; - - public ModelGiraffe() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT1.neck1", 103, 36); - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - body = new ModelRenderer(this, 0, 24); - body.addBox(-7F, -16F, -23F, 14, 16, 24); - body.setRotationPoint(0F, 5F, 11F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 56, 12); - body2.addBox(-5F, -28F, 2F, 10, 21, 12); - body2.setRotationPoint(0F, 5F, 11F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 1.047198F, 0F, 0F); - body3 = new ModelRenderer(this, 92, 0); - body3.addBox(-4.5F, -26F, -23F, 11, 10, 6); - body3.setRotationPoint(-1F, 5F, 11F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 0); - leg1.addBox(-2F, 0F, -2F, 4, 19, 4); - leg1.setRotationPoint(-5F, 5F, -9F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 18, 0); - leg2.addBox(-2F, 0F, -2F, 4, 19, 4); - leg2.setRotationPoint(5F, 5F, -9F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 36, 0); - leg3.addBox(-2F, 0F, -2F, 4, 19, 4); - leg3.setRotationPoint(-5F, 5F, 9F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 24); - leg4.addBox(-2F, 0F, -2F, 4, 19, 4); - leg4.setRotationPoint(5F, 5F, 9F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - tail = new ModelRenderer(this, 54, 0); - tail.addBox(-1F, 0F, 0F, 2, 17, 2); - tail.setRotationPoint(0F, -8F, 12F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -21F, -9F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -3F, -3F, -3F, 6, 3, 6); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - body2.render(f5); - body3.render(f5); - leg1.render(f5); - leg2.render(f5); - leg3.render(f5); - leg4.render(f5); - tail.render(f5); - NECKROT1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -45), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityGiraffe var5 = (EntityGiraffe) par1EntityLiving; - /* State Animation Rotations */ - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg1.rotateAngleZ = (float) (0 * Math.PI / 180); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg2.rotateAngleZ = (float) (0 * Math.PI / 180); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - float minTime; - float maxTime; - if (var5.getAnimTime() > 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f1819ef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f1819ef5c42100141fce95f06aba7e85 deleted file mode 100644 index abb2d27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f1819ef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIWander extends EntityAIBase -{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityGenericCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityGenericCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && !entity.isEntityGrounded()) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f1bec501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f1bec501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6fab236..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d6/f1bec501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,117 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY == cellHeight - 2) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (piecePos.posY % 2 == 1) { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - private boolean isCorner(ChunkCoordinates piecePos, int cellSize) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) - && (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1)) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "cemeterytomb2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/003be0f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/003be0f4c42100141fce95f06aba7e85 deleted file mode 100644 index 34cf1bd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/003be0f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/0199d5fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/0199d5fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 034b47f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/0199d5fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCampfire; -import projectzulu.common.blocks.ItemCampFire; -import projectzulu.common.blocks.RenderCampFire; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/30d94dfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/30d94dfac42100141fce95f06aba7e85 deleted file mode 100644 index 2c74d6e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/30d94dfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/42b077ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/42b077ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa5814f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/42b077ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectLabyrinth; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerLabyrinth extends BuildingManagerBase { - - public ArchitectLabyrinth architect; - public Randomizer randomizer; - - MazeCell[][] labyrinth; - MazeCell[][] stairs; - - public BuildingManagerLabyrinth(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectLabyrinth(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 15; - int zCells = 15; - int cellSize = 3; - int cellHeight = 5; - - int stairZCells = MathHelper.ceiling_float_int(15f / cellHeight); - int stairCellSize = cellSize + 2; - int stairCellHeight = stairCellSize * 2; - - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize - + stairZCells * stairCellSize, cellHeight); - - stairs = new MazeCell[1][stairZCells]; - for (int i = 0; i < stairs.length; i++) { - for (int j = 0; j < stairs[0].length; j++) { - stairs[i][j] = new MazeCell(stairCellSize, stairCellHeight, new ChunkCoordinates(startingPos.posX - 1 - + stairCellSize * i + cellSize * (xCells / 2), startingPos.posY + 1 + stairCellSize - * (stairs[0].length - 1 - j), startingPos.posZ + stairCellSize * j)); - } - } - - labyrinth = new MazeCell[xCells][zCells]; - for (int i = 0; i < labyrinth.length; i++) { - for (int j = 0; j < labyrinth[0].length; j++) { - labyrinth[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + stairCellSize * stairs[0].length + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(labyrinth); - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - architect.assignBlueprint(labyrinth, new Point(cellX, cellZ), pass, maxPasses); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - architect.assignStairs(stairs, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int cellX = 0; cellX < labyrinth.length; cellX++) { - for (int cellZ = 0; cellZ < labyrinth[0].length; cellZ++) { - MazeCell currentCell = labyrinth[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - - for (int cellX = 0; cellX < stairs.length; cellX++) { - for (int cellZ = 0; cellZ < stairs[0].length; cellZ++) { - MazeCell currentCell = stairs[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/61eed8a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/61eed8a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8cc96e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/61eed8a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityVulture; -import projectzulu.common.mobs.models.ModelVulture; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/70d792e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/70d792e5c42100141fce95f06aba7e85 deleted file mode 100644 index 1a9641a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/70d792e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,156 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFinch; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelFinch extends ModelBase { - - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - - public ModelFinch() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - - Body = new ModelRenderer(this, 0, 0); - Body.addBox(-1F, -1F, -2F, 2, 2, 4); - Body.setRotationPoint(0F, 21.3F, 0F); - Body.setTextureSize(32, 32); - Body.mirror = true; - setRotation(Body, 0F, 0F, 0F); - wingrig = new ModelRenderer(this, 13, 0); - wingrig.addBox(0F, 0F, -1.5F, 1, 1, 3); - wingrig.setRotationPoint(1F, 20.3F, 0F); - wingrig.setTextureSize(32, 32); - wingrig.mirror = true; - setRotation(wingrig, 0F, 0F, 0F); - winglef = new ModelRenderer(this, 22, 0); - winglef.addBox(-1F, 0F, -1.5F, 1, 1, 3); - winglef.setRotationPoint(-1F, 20.3F, 0F); - winglef.setTextureSize(32, 32); - winglef.mirror = true; - setRotation(winglef, 0F, 0F, 0F); - tail = new ModelRenderer(this, 14, 8); - tail.addBox(-0.4666667F, 0F, 0F, 1, 1, 3); - tail.setRotationPoint(0F, 20.8F, 1F); - tail.setTextureSize(32, 32); - tail.mirror = true; - setRotation(tail, 0.3346075F, 0F, 0F); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 22.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 22.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 1F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 1, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19.8F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - Body.render(f5); - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityFinch var5 = (EntityFinch) par1EntityLiving; - if (var5.getEntityState() == EntityStates.posture) { - /* On Ground Idle Standing Animation */ - } else { - winglef.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f) * 1.8F * 0.5f; - wingrig.rotateAngleZ = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f - + (float) Math.PI) * 1.8F * 0.5f; - tail.rotateAngleX = MathHelper.cos(var5.worldObj.getWorldTime() * 0.6662F * 2f + (float) Math.PI) * 0.3f; - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/80e9d1a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/80e9d1a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 22fcd19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/80e9d1a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPenguin; -import projectzulu.common.mobs.models.ModelPenguin; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PenguinDeclaration extends SpawnableDeclaration { - - public PenguinDeclaration() { - super("Penguin", 14, EntityPenguin.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (22 << 16) + (16 << 8) + 13; - eggColor2 = (235 << 16) + (235 << 8) + 235; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/818d90e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/818d90e5c42100141fce95f06aba7e85 deleted file mode 100644 index f4f6002..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/818d90e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,291 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelElephant extends ModelBase { - - private static float heightToRaise = 12f; - - ModelRenderer body; - ModelRenderer tail; - ModelRenderer LEG4TOPROT; - ModelRenderer LEG3TOPROT; - ModelRenderer LEG1TOPROT; - ModelRenderer LEG2TOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - public ModelElephant() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("LEG4TOPROT.leg4top", 0, 40); - setTextureOffset("LEG4BOTROT.leg4bot", 0, 52); - setTextureOffset("LEG3TOPROT.leg3top", 0, 40); - setTextureOffset("LEG3BOTROT.leg3bot", 0, 52); - setTextureOffset("LEG1TOPROT.leg1top", 0, 40); - setTextureOffset("LEG1BOTROT.leg1bot", 0, 52); - setTextureOffset("LEG2TOPROT.leg2top", 0, 40); - setTextureOffset("LEG2BOTROT.leg2bot", 0, 52); - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); - setTextureOffset("EARLEFROT.earlef", 55, 41); - setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - body = new ModelRenderer(this, 0, 0); - body.addBox(0F, 0F, 0F, 14, 12, 24); - body.setRotationPoint(-7F, 0F - heightToRaise, -12F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - tail = new ModelRenderer(this, 46, 46); - tail.addBox(0F, 0F, 0F, 2, 16, 2); - tail.setRotationPoint(-1F, 4F - heightToRaise, 11F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(4F, 12F - heightToRaise, 9F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("leg4top", -3F, 0F, -3F, 6, 6, 6); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("leg4bot", -3F, 0F, -3F, 6, 6, 6); - LEG4TOPROT.addChild(LEG4BOTROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(-4F, 12F - heightToRaise, 9F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("leg3top", -3F, 0F, -3F, 6, 6, 6); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("leg3bot", -3F, 0F, -3F, 6, 6, 6); - LEG3TOPROT.addChild(LEG3BOTROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 12F - heightToRaise, -9F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -3F, 0F, -3F, 6, 6, 6); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1bot", -3F, 0F, -3F, 6, 6, 6); - LEG1TOPROT.addChild(LEG1BOTROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 12F - heightToRaise, -9F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -3F, 0F, -3F, 6, 6, 6); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -3F, 0F, -3F, 6, 6, 6); - LEG2TOPROT.addChild(LEG2BOTROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 6F - heightToRaise, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); - setRotation(EARLEFROT, 0F, 1.22173F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(7F, -0.5F, -4F); - setRotation(EARRIGROT, 0F, -1.22173F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); - HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - if (this.isChild) { - float field_78145_g = 1.0f; - float field_78151_h = 0.0f; - - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * 1.7f); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(0.8F / var8, 0.8F / var8, 0.8F / var8); - GL11.glTranslatef(0.0F, 14F * f5, 0.0F); - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - GL11.glPopMatrix(); - } else { - body.render(f5 * 2); - tail.render(f5 * 2); - LEG4TOPROT.render(f5 * 2); - LEG3TOPROT.render(f5 * 2); - LEG1TOPROT.render(f5 * 2); - LEG2TOPROT.render(f5 * 2); - HEADROT.render(f5 * 2); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - EARLEFROT.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - EARRIGROT.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F - * ModelHelper.abs(Math.log(par3 + 1))); - - TRUNK1ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos((par2) * 0.6662F + (float) Math.PI / 2)); - TRUNK2ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK3ROT.rotateAngleX = (float) (0.0 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F)); - TRUNK4ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK5ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK6ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - TRUNK7ROT.rotateAngleX = (float) (Math.abs(45 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F / 4 + (float) Math.PI / 2))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/a0baf7f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/a0baf7f4c42100141fce95f06aba7e85 deleted file mode 100644 index f5b676c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/a0baf7f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionIncendiary extends PotionZulu { - - public PotionIncendiary(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(1, 2); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int par2) { - super.performEffect(par1EntityLiving, par2); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int par3, double par4) { - par2EntityLiving.setFire((int) (2 + 1.5 * par3)); - super.affectEntity(par1EntityLiving, par2EntityLiving, par3, par4); - } - - @Override - public boolean isInstant() { - return true; - } - - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/a19f8001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/a19f8001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 420cf55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/a19f8001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b11c5bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b11c5bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6ed23bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/b11c5bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/d10bea9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/d10bea9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ac94f9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/d10bea9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e0639cff9620001419c88e79630e4081 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e0639cff9620001419c88e79630e4081 deleted file mode 100644 index e431049..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e0639cff9620001419c88e79630e4081 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIWander extends EntityAIBase -{ - private EntityCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e081a500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e081a500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7472e00..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e081a500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e173779ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e173779ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a01ee05..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d7/e173779ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,5 +0,0 @@ -package projectzulu.common.dungeon; - -public enum ListType { - NONE, Creature, Sound; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/119315ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/119315ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5bcfbd7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/119315ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/225594fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/225594fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f33c17d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/225594fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/312c59a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/312c59a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1d3b1e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/312c59a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,37 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreePlank; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/400a69ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/400a69ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e8a6fdd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/400a69ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,334 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/40b7e9a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/40b7e9a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1d46da4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/40b7e9a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,291 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/60d33bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/60d33bf6c42100141fce95f06aba7e85 deleted file mode 100644 index f89fb38..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/60d33bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/90df14f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/90df14f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2062c1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/90df14f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandTriple extends BlockBrewingStandBase { - - public BlockBrewingStandTriple(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int par2) { - return new TileEntityBrewingTriple(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/a143cbfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/a143cbfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c346ba6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/a143cbfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPolarBear; -import projectzulu.common.mobs.models.ModelPolarBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearPolarDeclaration extends SpawnableDeclaration { - - public BearPolarDeclaration() { - super("Polar Bear", 18, EntityPolarBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (201 << 16) + (201 << 8) + 201; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(25f, 5.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPolarBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearpolar.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/b0c54ff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/b0c54ff5c42100141fce95f06aba7e85 deleted file mode 100644 index 6ab31fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/b0c54ff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,190 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; - -public class ModelFollower extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelFollower() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/b104e4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/b104e4e5c42100141fce95f06aba7e85 deleted file mode 100644 index 5dd694e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/b104e4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,87 +0,0 @@ -package projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionBlindness; -import projectzulu.common.potion.subitem.SubItemPotionBubbling; -import projectzulu.common.potion.subitem.SubItemPotionCleansing; -import projectzulu.common.potion.subitem.SubItemPotionCurse; -import projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import projectzulu.common.potion.subitem.SubItemPotionJump; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionResistance; -import projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import projectzulu.common.potion.subitem.SubItemPotionThorns; -import projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/c1c40fe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/c1c40fe5c42100141fce95f06aba7e85 deleted file mode 100644 index 62635f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/c1c40fe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/e1a53bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/e1a53bf9c42100141fce95f06aba7e85 deleted file mode 100644 index d42b494..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/e1a53bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/f154c7e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/f154c7e5c42100141fce95f06aba7e85 deleted file mode 100644 index d9e3e93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d8/f154c7e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/00799af7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/00799af7c42100141fce95f06aba7e85 deleted file mode 100644 index dea3f3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/00799af7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockCampfire; -import com.ngb.projectzulu.common.blocks.ItemCampFire; -import com.ngb.projectzulu.common.blocks.RenderCampFire; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/00dd48f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/00dd48f4c42100141fce95f06aba7e85 deleted file mode 100644 index 464c70d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/00dd48f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,117 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY == cellHeight - 2) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (piecePos.posY % 2 == 1) { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - private boolean isCorner(ChunkCoordinates piecePos, int cellSize) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) - && (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1)) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "cemeterytomb2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/207307d7fa2000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/207307d7fa2000141769cb1ed0c338cd deleted file mode 100644 index 6a74aed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/207307d7fa2000141769cb1ed0c338cd +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.API; - -import projectzulu.common.potion.subitem.SubItemPotion; - -import com.google.common.base.Optional; - -public enum SubItemPotionList { - /* Vanilla Alternates */ - STRENGTH, REGENERATION, POISON, WEAKNESS, MOVE_SPEED, MOVE_SLOW, FIRE_RESISTANCE, NIGHT_VISION, BLINDNESS, HEAL, - HARM, INVISIBILITY, - - /* Custom Potions */ - BUBBLING, INCENDIARY, SLOWFALL, CLEANSING, THORNS, JUMP, DIG_SPEED, DIG_SLOW, RESISTANCE, WATER_BREATHING, CURSE; - - private Optional subItem = Optional.absent(); - - public boolean isPresent() { - return subItem.isPresent(); - } - - public SubItemPotion get() { - return subItem.get(); - } - - public void set(SubItemPotion potion) { - subItem = Optional.of(potion); - } - - public void clear() { - subItem = Optional.absent(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/2092ecffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/2092ecffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index df04f78..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/2092ecffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,104 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/215681e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/215681e6c42100141fce95f06aba7e85 deleted file mode 100644 index 11ca5e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/215681e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetTreasureDeadEnd implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetTreasureDeadEnd() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "deadend"; - } - - @Override - public int getWeight() { - return 50; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - cells[buildCoords.x][buildCoords.y].rawState = 2; - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 && ArchitectBase.isDeadEnd(cells, buildCoords, 1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1) { - if (random.nextInt(5) == 0) { - PyramidFeature terrainFeature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), terrainFeature.chestLootChance, - terrainFeature.chestMaxLoot); - - } else if (random.nextInt(4) == 0) { - return new MimicWithMeta(); - } - } - return new BlockWithMeta(Blocks.air); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/4005e5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/4005e5f9c42100141fce95f06aba7e85 deleted file mode 100644 index 348457f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/4005e5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.item.ItemSlab; -import net.minecraft.item.ItemStack; - -public class ItemZuluSlab extends ItemSlab { - - private static BlockSlab halfBlock; - private static BlockSlab doubleSlab; - private final boolean isFullBlock; - - /** - * Setup the half/double Slab instances required by ItemSlab This is a workaround as Forge does not allow Blocks to - * registered with an instance of an itemClass but an Item.class which only allow itemID constructor - */ - public static void initialise(BlockSlab halfBlock, BlockSlab doubleSlab) { - ItemZuluSlab.halfBlock = halfBlock; - ItemZuluSlab.doubleSlab = doubleSlab; - } - - public ItemZuluSlab(Block block) { - super(block, (BlockSlab) halfBlock, (BlockSlab) doubleSlab, block == doubleSlab); - isFullBlock = block == doubleSlab; - } - - /** - * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have - * different names based on their damage or NBT. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) { - return isFullBlock ? doubleSlab.func_150002_b(par1ItemStack.getItemDamage()) : super - .getUnlocalizedName(par1ItemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/61fbd5f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/61fbd5f7c42100141fce95f06aba7e85 deleted file mode 100644 index 3e5de5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/61fbd5f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/70686bf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/70686bf9c42100141fce95f06aba7e85 deleted file mode 100644 index 3699547..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/70686bf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/71549ef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/71549ef8c42100141fce95f06aba7e85 deleted file mode 100644 index 558f554..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/71549ef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelPolarBear extends ModelBear { - - public ModelPolarBear() { - super(12); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 2 * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/a0cbf1f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/a0cbf1f8c42100141fce95f06aba7e85 deleted file mode 100644 index db93898..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/a0cbf1f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,174 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -/** This AI is Compatible with Only Flying Entities: Designed Specifically for Vulture */ -public class EntityAIVultureFollow extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - int heightToFollow = 10; - private EnumSet setOfValidStates = EnumSet.allOf(EntityStates.class); - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIVultureFollow(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - public EntityAIVultureFollow setValidStates(EnumSet setOfValidStates){ - this.setOfValidStates = setOfValidStates; - return this; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - @Override - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if(!setOfValidStates.contains(attacker.getEntityState())){ - return false; - } - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY+heightToFollow, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - @Override - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - @Override - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - @Override - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - @Override - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+heightToFollow), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/a1a590a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/a1a590a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1212d27..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/a1a590a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,225 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEntrance implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return getWallBlock(CellHelper.mirrorCellTo(piecePos, cellSize, cellIndexDirection), cellSize, cellHeight, - random, cellIndexDirection); - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Building "Roof Floor" */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (cellIndexDirection == CellIndexDirection.SouthWestCorner - || cellIndexDirection == CellIndexDirection.SouthEastCorner) { - /* 'Front' Wall */ - if (piecePos.posZ == 1 && piecePos.posX > 2) { - /* Front Wall Door */ - if (piecePos.posX == cellSize - 1 && piecePos.posY > 0 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - if (slope < 0 && piecePos.posZ == 0) { - if (piecePos.posX == cellSize * 4 / 10) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 0 : 1); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 4 : 5); - } - } else if (piecePos.posX == cellSize * 4 / 10 + 1) { - if (piecePos.posY % 2 == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 1 : 0); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, - cellIndexDirection == CellIndexDirection.SouthWestCorner ? 5 : 4); - } - } else if (piecePos.posX > cellSize * 4 / 10 && piecePos.posY == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - - /* Air In Front of Doorway */ - if (piecePos.posZ == 0 && piecePos.posX > 2 && piecePos.posY < 4) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX <= 2 && piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Building "Roof Floor" */ - if (piecePos.posY > cellHeight - 2 * cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 7), cellHeight - cellSize); - - if (slope == 0) { - if (slope != slopeBelow) { - if (piecePos.posZ <= 1) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta(cellIndexDirection)); - } - } else { - if (piecePos.posZ <= 1 - && (cellIndexDirection == CellIndexDirection.SouthWestCorner || cellIndexDirection == CellIndexDirection.SouthEastCorner)) { - return woodenPlank; - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - } - - if (piecePos.posZ > 1 && slope > 0 && slope <= 2) { - return new BlockWithMeta(Blocks.air); - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posZ % 3 == 1 - && piecePos.posX > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - - } - } - /* Outer Walls */ - if (piecePos.posX == cellSize * 4 / 10 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - // Exclude Door side of wall - if (piecePos.posZ >= 1 - || (cellIndexDirection != CellIndexDirection.SouthWestCorner && cellIndexDirection != CellIndexDirection.SouthEastCorner)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else { - } - } - - /* Red Carpet */ - if (piecePos.posY == 1 && (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1)) { - return new BlockWithMeta(Blocks.carpet, 14); - } - - /* Floors */ - if (piecePos.posY == 0) { - if (piecePos.posX == cellSize * 4 / 10 + 1 && (piecePos.posZ <= 3 || piecePos.posY >= 5)) { - return new BlockWithMeta(Blocks.cobblestone, 0); - } - - /* Floor of Entrance */ - if (piecePos.posX > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - /* Floor Connecting To tower */ - if (piecePos.posZ > 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return 0; - case NorthEastCorner: - case SouthEastCorner: - return 1; - default: - return 0; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWestCorner: - case SouthWestCorner: - return top ? 0 : 5; - case NorthEastCorner: - case SouthEastCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - public int getDoorPillarStairMeta(CellIndexDirection cellIndexDirection, boolean top, boolean left) { - switch (cellIndexDirection) { - case SouthWestCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 4 : 5; - } - case SouthEastCorner: - if (top) { - return left ? 0 : 5; - } else { - return left ? 0 : 5; - } - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "CathedralEntrance"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/b068e900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/b068e900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 148721b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/b068e900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIVultureFollow; -import cpw.mods.fml.common.Loader; - -public class EntityVulture extends EntityGenericAnimal { - public EntityModelRotation eFEETROT = new EntityModelRotation(); - public EntityModelRotation eBODYROT = new EntityModelRotation(); - - public EntityModelRotation eLEFTWING = new EntityModelRotation(); - public EntityModelRotation ewingleft4 = new EntityModelRotation(); - public EntityModelRotation ewingleft3 = new EntityModelRotation(); - public EntityModelRotation ewingleft2 = new EntityModelRotation(); - public EntityModelRotation ewingleft1 = new EntityModelRotation(); - - public EntityModelRotation eRIGTHWING = new EntityModelRotation(); - public EntityModelRotation ewingrig4 = new EntityModelRotation(); - public EntityModelRotation ewingrig3 = new EntityModelRotation(); - public EntityModelRotation ewingrig2 = new EntityModelRotation(); - public EntityModelRotation ewingrig1 = new EntityModelRotation(); - - public EntityModelRotation eNECKROT1 = new EntityModelRotation(); - public EntityModelRotation eNECKROT2 = new EntityModelRotation(); - public EntityModelRotation eNECKROT3 = new EntityModelRotation(); - public EntityModelRotation eHEADROT = new EntityModelRotation(); - public EntityModelRotation eTAILROT = new EntityModelRotation(); - - boolean manyVultures = false; - private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData - .get("maxTargetHealth"); - float curiosity = 0; - int ticksToCheckAbilities = 3; - - public EntityVulture(World par1World) { - super(par1World); - setSize(1.0f, 1.4f); - - float moveSpeed = 0.18f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - maxFlightHeight = 20; - getNavigator().setAvoidsWater(true); - - tasks.addTask(2, - new EntityAIVultureFollow(this, moveSpeed, false).setValidStates(EnumSet.of(EntityStates.following))); - tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask( - 2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking, - EntityStates.following), EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "vulturehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - - /* Check if their is a nearby Player to Follow */ - EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); - if (nearbyPlayer != null) { - int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) - + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); - if (distToTargetXZ < 16) { - curiosity = 140; - } - } - shouldFollow = curiosity > 0 ? true : false; - curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); - - /* - * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to - * the Health of our Target - */ - Entity targetedEntity = nearbyPlayer; - if (curiosity > 0 && targetedEntity != null) { - int nearbyVultures = 0; - AxisAlignedBB var15 = this.boundingBox.copy(); - var15 = var15.expand(10, 10, 10); - List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); - if (nearbyEntities != null && !nearbyEntities.isEmpty()) { - Iterator var10 = nearbyEntities.iterator(); - - while (var10.hasNext()) { - Entity var4 = (Entity) var10.next(); - if (var4 instanceof EntityVulture - && (((EntityVulture) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) - .getEntityState() == EntityStates.attacking)) { - nearbyVultures += 1; - } - } - } - if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack - && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { - setAngerLevel(400); - } - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 16), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/b0e47b01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/b0e47b01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index eab260f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/b0e47b01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/c0b042e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/c0b042e4c42100141fce95f06aba7e85 deleted file mode 100644 index 05a40e1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/c0b042e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GreenClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public GreenClothArmorDeclaration(int renderIndex) { - super(new String[] { "GreenClothHelmet", "GreenClothChest", "GreenClothLegs", "GreenClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.greenClothHead = Optional.of(item); - return true; - case 1: - ItemList.greenClothChest = Optional.of(item); - return true; - case 2: - ItemList.greenClothLeg = Optional.of(item); - return true; - case 3: - ItemList.greenClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.greenClothHead.get(); - break; - case 1: - item = ItemList.greenClothChest.get(); - break; - case 2: - item = ItemList.greenClothLeg.get(); - break; - case 3: - item = ItemList.greenClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e082ad9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e082ad9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bce8efc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/e082ad9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempBlock { - - /** - * Factor that adds to the current Player Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Block is Nearby - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHeatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/f0c7a89fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/f0c7a89fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8506d03..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/d9/f0c7a89fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWaterBreathing extends SubItemPotionGeneric { - - public SubItemPotionWaterBreathing(Item itemID, int subID) { - super(itemID, subID, "potion.waterBreathing"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.waterBreathing); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/00f1729e0a2100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/00f1729e0a2100141769cb1ed0c338cd deleted file mode 100644 index 798743e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/00f1729e0a2100141769cb1ed0c338cd +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/10c565a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/10c565a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a806422..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/10c565a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityMimic; - -public class MimicWithMeta extends BlockWithMeta { - - public MimicWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityMimic entityMimic = new EntityMimic(world, position.posX + 0.5, position.posY, position.posZ + 0.5, - true); - world.spawnEntityInWorld(entityMimic); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/10e6bef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/10e6bef6c42100141fce95f06aba7e85 deleted file mode 100644 index aa21ffa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/10e6bef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,26 +0,0 @@ -package com.ngb.com.ngb.projectzulu.common; - -import com.ngb.projectzulu.common.blocks.EntityCreeperBlossomPrimed; -import com.ngb.projectzulu.common.blocks.RenderCreeperBlossomPrimed; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.mobs.BossHealthDisplayTicker; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; - -public class ClientProxyProjectZulu extends CommonProxyProjectZulu{ - - @Override - public int addArmor(String armor){ - return RenderingRegistry.addNewArmourRendererPrefix(armor); - } - - @Override - public void bossHealthTicker(){ - FMLCommonHandler.instance().bus().register(new BossHealthDisplayTicker()); - } - - @Override - public void registerModelsAndRender() { - CustomEntityManager.INSTANCE.registerModelsAndRender(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/11f29dfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/11f29dfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b256384..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/11f29dfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIControlledByPlayer; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHorseBase extends EntityGenericAnimal { - - private final EntityAIControlledByPlayer aiControlledByPlayer; - - public EntityHorseBase(World par1World) { - super(par1World); - setSize(1.5f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - - tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); - tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean isRideable() { - return true; - } - - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horse"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "horsehurt"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (this.riddenByEntity != null - && (par1DamageSource.getEntity() != null && par1DamageSource.getEntity().equals(this.riddenByEntity)) - || (par1DamageSource.getSourceOfDamage() != null && par1DamageSource.getSourceOfDamage().equals( - this.riddenByEntity))) { - return false; - } else { - return super.attackEntityFrom(par1DamageSource, par2); - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } - return false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/21355d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/21355d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9322eca..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/21355d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; - -public interface PZPacket { - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to encode into - */ - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to decode from - */ - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); - - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/6080a5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/6080a5f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2e9d289..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/6080a5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,502 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityMinotaur; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/60bf6ef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/60bf6ef5c42100141fce95f06aba7e85 deleted file mode 100644 index 76dee54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/60bf6ef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EggableDeclaration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.mobs.entity.EntityMinotaur; -import com.ngb.projectzulu.common.mobs.models.ModelMinotaur; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/615a44a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/615a44a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f2e6415..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/615a44a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/81b2eafec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/81b2eafec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a1b950d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/81b2eafec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; -import projectzulu.common.mobs.renders.RenderMummyPharaoh; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/a0adfa9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/a0adfa9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 798743e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/a0adfa9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIMoveTowardsRestriction extends EntityAIBase { - private EntityCreature theEntity; - private double movePosX; - private double movePosY; - private double movePosZ; - private float movementSpeed; - - public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, float par2) - { - this.theEntity = par1EntityCreature; - this.movementSpeed = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - if (this.theEntity.isWithinHomeDistanceCurrentPosition()) - { - return false; - } - else - { - ChunkCoordinates chunkcoordinates = this.theEntity.getHomePosition(); - Vec3 vec3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, Vec3.createVectorHelper((double) chunkcoordinates.posX, (double) chunkcoordinates.posY, (double) chunkcoordinates.posZ)); - - if (vec3 == null) - { - return false; - } - else - { - this.movePosX = vec3.xCoord; - this.movePosY = vec3.yCoord; - this.movePosZ = vec3.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - return !this.theEntity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/c01e18f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/c01e18f6c42100141fce95f06aba7e85 deleted file mode 100644 index 18e3ee7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/c01e18f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/d0740dfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/d0740dfac42100141fce95f06aba7e85 deleted file mode 100644 index 80bcc79..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/d0740dfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/e1676ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/e1676ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 0b74787..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/e1676ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.models.ModelHornBill; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HornbillDeclaration extends SpawnableDeclaration { - - public HornbillDeclaration() { - super("Horn Bill", 36, EntityHornBill.class, EnumCreatureType.ambient); - setSpawnProperties(10, 25, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (26 << 16) + (19 << 8) + 15; - eggColor2 = (199 << 16) + (33 << 8) + 14; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/e1e4799ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/e1e4799ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 45bcc09..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/e1e4799ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,144 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/f0db00f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/f0db00f8c42100141fce95f06aba7e85 deleted file mode 100644 index 464c70d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/da/f0db00f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,117 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY == cellHeight - 2) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else if (piecePos.posY % 2 == 1) { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (isCorner(piecePos, cellSize)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - private boolean isCorner(ChunkCoordinates piecePos, int cellSize) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) - && (piecePos.posZ == 0 || piecePos.posZ == cellSize - 1)) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "cemeterytomb2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/003032f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/003032f9c42100141fce95f06aba7e85 deleted file mode 100644 index dfa4984..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/003032f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,149 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/019795f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/019795f7c42100141fce95f06aba7e85 deleted file mode 100644 index 5a89b36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/019795f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemFoodProjectZulu; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/210ff8a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/210ff8a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 650c119..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/210ff8a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,15 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelPolarBear extends ModelBear { - - public ModelPolarBear() { - super(12); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 2 * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/30598aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/30598aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b199ab3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/30598aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityRhino extends EntityGenericAnimal implements IAnimals { - - public EntityRhino(World par1World) { - super(par1World); - setSize(2.0f, 2.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.7f * 2.7f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinolivingsound"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rhinohurtsound"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 14), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/70b5d700c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/70b5d700c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b157bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/70b5d700c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,116 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/70ca37f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/70ca37f8c42100141fce95f06aba7e85 deleted file mode 100644 index db71e6b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/70ca37f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreeSapling; - -public class BlockWithPalmTree extends BlockWithMeta { - - public BlockWithPalmTree() { - super(Blocks.air, 0, 1); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (BlockList.palmTreeSapling.isPresent()) { - ((BlockPalmTreeSapling) BlockList.palmTreeSapling.get()).growTree(world, position.posX, position.posY, - position.posZ, random); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/718666f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/718666f9c42100141fce95f06aba7e85 deleted file mode 100644 index 435b94a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/718666f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxSpawnRange extends KeyParserBase { - - public KeyParserMaxSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - if (pieces.length == 2) { - valueCache.put(Key.maxSpawnRange.key, - ParsingHelper.parseFilteredInteger(pieces[1], 0, Key.maxSpawnRange.key)); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/7193dc9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/7193dc9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 999abc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/7193dc9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemAnkh; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AnkhDeclaration extends ItemDeclaration { - - public AnkhDeclaration() { - super("Ankh"); - } - - @Override - protected boolean createItem() { - ItemList.ankh = Optional.of(new ItemAnkh(name)); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.ankh.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/8000fdf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/8000fdf6c42100141fce95f06aba7e85 deleted file mode 100644 index 0770343..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/8000fdf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,419 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/81e4c5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/81e4c5f9c42100141fce95f06aba7e85 deleted file mode 100644 index b9ed54f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/81e4c5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.util.NoSuchElementException; -import java.util.Scanner; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.blocks.util.StringHelper; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnEntry; - -import com.google.common.base.Optional; - -public class ConfigHelper { - - public static SpawnEntry configGetSpawnEntry(Configuration config, String category, BiomeGenBase biome, - boolean shouldSpawn, int spawnRate, int minInChunk, int maxInChunk) { - Property spawnProperty = config.get(category, biome.getClass().getName() + "." + biome.biomeName, - Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" + Integer.toString(minInChunk) - + ":" + Integer.toString(maxInChunk)); - String[] spawnProperties = spawnProperty.getString().split(":"); - if (spawnProperties.length != 4) { - ProjectZuluLog.severe("Error Parseing %s as String %s is does not have the requried number of parameters", - biome.biomeName, spawnProperty.getString()); - return null; - } - Scanner scanner = new Scanner(spawnProperty.getString()); - scanner.useDelimiter(":"); - try { - shouldSpawn = scanner.hasNextBoolean() ? scanner.nextBoolean() : shouldSpawn; - spawnRate = scanner.hasNextInt() ? scanner.nextInt() : spawnRate; - minInChunk = scanner.hasNextInt() ? scanner.nextInt() : minInChunk; - maxInChunk = scanner.hasNextInt() ? scanner.nextInt() : maxInChunk; - } catch (NoSuchElementException e) { - ProjectZuluLog - .severe("Error Parsing %s as the parameters in String %s are not in a parseable format. The Format is shouldSpawn:spawnRate:MinInChunk:MaxInChunk", - biome.biomeName, spawnProperty.getString()); - spawnProperty.set(Boolean.toString(shouldSpawn) + ":" + Integer.toString(spawnRate) + ":" - + Integer.toString(minInChunk) + ":" + Integer.toString(maxInChunk)); - } finally { - scanner.close(); - } - - if (shouldSpawn == true) { - return new SpawnEntry(biome, spawnRate, minInChunk, maxInChunk); - } - return null; - } - - public static EnumCreatureType configGetCreatureType(Configuration config, String category, String key, EnumCreatureType creatureType){ - Property creatureProperty = config.get(category, key, creatureType != null ? creatureType.toString() : "None"); - for (EnumCreatureType enumCreatureType : EnumCreatureType.values()) { - if(enumCreatureType.toString().toLowerCase().equals(creatureProperty.getString().toLowerCase())){ - return enumCreatureType; - } - } - - if(!creatureProperty.getString().toLowerCase().equals("none")){ - ProjectZuluLog.severe("Error Parsing Entity Config entry %s for EnumCreatureType. Entity will be assumed not to have Type.", creatureProperty.getString()); - } - return null; - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Item item, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(item, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Block block, int meta, int weightChance){ - configItemStackToMobData(config, category, customMobData, new ItemStack(block, 1, meta), weightChance); - } - - public static void configDropToMobData(Configuration config, String category, CustomMobData customMobData, Optional itemBlock, int meta, int weightChance){ - if(itemBlock.isPresent()){ - if(itemBlock.get() instanceof Item ){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Item)itemBlock.get(), 1, meta), weightChance); - }else if(itemBlock.get() instanceof Block){ - configItemStackToMobData(config, category, customMobData, new ItemStack((Block)itemBlock.get(), 1, meta), weightChance); - } - } - } - - private static void configItemStackToMobData(Configuration config, String category, CustomMobData customMobData, ItemStack itemStack, int weightChance){ - int stackSize = config.get(category,"Item "+itemStack.getUnlocalizedName()+" Quantity:", 1).getInt(); - itemStack.stackSize = stackSize; - int weight = config.get(category, "Item "+itemStack.getUnlocalizedName()+" Weight:", weightChance).getInt(); - if(weight > 0){ - customMobData.addLootToMob(itemStack, weight); - } - } - - public static void userItemConfigRangeToMobData(Configuration config, String category, CustomMobData customMobData){ - Property property = config.get(category,"Item User Custom Drop", "0-0:0:3:4, 0:0:1:2"); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries){ - String[] entryParts = stringEntry.split(":"); - if(entryParts.length == 4){ - // ::: - int meta = StringHelper.parseInteger(entryParts[1], "0123456789"); - int weight = StringHelper.parseInteger(entryParts[2], "0123456789"); - int quantity = StringHelper.parseInteger(entryParts[3], "0123456789"); - - String itemId = entryParts[0] != null ? entryParts[0].trim() : ""; - customMobData.addLootToMob(itemId, meta, quantity, weight); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/b11a90a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/b11a90a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fbfa0a4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/b11a90a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/b1cc1bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/b1cc1bfac42100141fce95f06aba7e85 deleted file mode 100644 index 2e2c924..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/b1cc1bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockAloeVera; -import com.ngb.projectzulu.common.blocks.ItemAloeVera; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class AloeVeraDeclaration extends BlockDeclaration { - - public AloeVeraDeclaration() { - super("AloeVera"); - } - - @Override - protected boolean createBlock() { - BlockList.aloeVera = Optional.of((new BlockAloeVera()).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - public void registerBlock() { - Block block = BlockList.aloeVera.get(); - GameRegistry.registerBlock(block, ItemAloeVera.class, name.toLowerCase()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/e0c936e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/e0c936e4c42100141fce95f06aba7e85 deleted file mode 100644 index 9536a7d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/e0c936e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockCoconut; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutDeclaration extends BlockDeclaration { - - public CoconutDeclaration() { - super("coconut"); - } - - @Override - protected boolean createBlock() { - BlockList.coconut = Optional.of(new BlockCoconut().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.coconut.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/e11bd5f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/e11bd5f8c42100141fce95f06aba7e85 deleted file mode 100644 index 80dc614..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/db/e11bd5f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/0144fff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/0144fff9c42100141fce95f06aba7e85 deleted file mode 100644 index 5c32e13..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/0144fff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,42 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockZuluStairs; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/029795f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/029795f7c42100141fce95f06aba7e85 deleted file mode 100644 index 714a992..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/029795f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemCoconutItem; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutItem extends ItemDeclaration { - - public CoconutItem() { - super("CoconutItem"); - } - - @Override - protected boolean createItem() { - ItemList.coconutItem = Optional.of(new ItemCoconutItem(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.coconutItem.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/205681e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/205681e6c42100141fce95f06aba7e85 deleted file mode 100644 index 8fcf322..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/205681e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,147 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/2192ecffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/2192ecffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a7b92c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/2192ecffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,60 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class RawFiberCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - /* - * This is Fur Pelt --> Leather + Fiber - * 0-1-2 - * 3-4-5 - * 6-7-8 - * * * * - * 0-1 - * 2-3 - */ - /* Check if Result is leather */ - boolean isResultLeather = item.getItem() == Items.leather; - if (!isResultLeather) - return; - - /* - * Check if Fur Pelt is the Only Thing on the Crafting Table If Anything is not fur, do Not Continue - */ - boolean contsinsFur = false; - int furInSlot = 0; - for (int i = 0; i < craftMatrix.getSizeInventory(); i++) { - if (craftMatrix.getStackInSlot(i) == null) { - continue; - } - if (craftMatrix.getStackInSlot(i).getItem() == ItemList.furPelt.get() && !contsinsFur) { - contsinsFur = true; - furInSlot = i; - continue; - } - return; - } - - if (!contsinsFur) - return; - - ItemStack itemToPlace = new ItemStack(ItemList.genericCraftingItems.get(), 2, - ItemGenerics.Properties.RawFiber.meta()); - - if (furInSlot == 0) { - craftMatrix.setInventorySlotContents(1, itemToPlace); - } else { - craftMatrix.setInventorySlotContents(0, itemToPlace); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/502246f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/502246f8c42100141fce95f06aba7e85 deleted file mode 100644 index e848a4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/502246f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,237 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "com.ngb.projectzulu.common.ClientProxyProjectZulu", serverSide = "com.ngb.projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/81ad6a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/81ad6a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cd68e3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/81ad6a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,200 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.Properties; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityGenericTameable; -import projectzulu.common.mobs.entity.EntityStates; - -public class RenderTameable extends RenderGenericLiving { - - protected float zLevel = 0.1F; - - public final static ResourceLocation TAMING_GUI = new ResourceLocation(DefaultProps.coreKey, "gui/guielements.png"); - - public RenderTameable(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } - - public void renderTameable(EntityGenericAnimal par1EntityFox, double par2, double par4, double par6, float par8, - float par9) { - if (par1EntityFox instanceof EntityGenericTameable) { - EntityGenericAnimal tameable = par1EntityFox; - if (tameable.isTamed()) { - renderLivingNamePlate(tameable, tameable.getUsername(), par2, par4, par6, 64); - } - } - super.doRender(par1EntityFox, par2, par4, par6, par8, par9); - } - - @Override - public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { - this.renderTameable((EntityGenericAnimal) par1EntityLiving, par2, par4, par6, par8, par9); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 0 && i % 16 == 0) { - screenLocationX = -18 - 7; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 8; - screenLocationX += 7; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 7, 7); // 5 - } - } - - /* Draw Health Icon(s) */ - int curHealth = MathHelper.ceiling_float_int(tameableEntity.getHealth()); - zLevel = 0.1f; - screenLocationX = -18 - 3; - screenLocationY = 11; - for (int i = 0; i < curHealth; i++) { - if (i > 0 && i % 16 == 0) { - screenLocationX = -18 - 3; - screenLocationY += 7; - } - if (i % 2 == 0) { - iconXCoord = 83; // 77 - iconYCoord = 0; - screenLocationX += 3; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 4, 7); // 5 - } else { - iconXCoord = 87; // 77 - iconYCoord = 0; - if (i == 1) { - screenLocationX += 0; - } - screenLocationX += 4; - screenLocationY += 0; - this.drawTexturedModalRect(screenLocationX, screenLocationY, iconXCoord, iconYCoord, 3, 7); // 5 - } - } - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - } - } - - private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/a07717f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/a07717f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2d18460..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/a07717f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/b0a481f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/b0a481f8c42100141fce95f06aba7e85 deleted file mode 100644 index d7f55d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/b0a481f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/b11584f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/b11584f8c42100141fce95f06aba7e85 deleted file mode 100644 index 2d18460..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/b11584f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.List; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockBrewingStandBase extends BlockContainer { - - public final int renderID; - public IIcon potionIcon; - - public BlockBrewingStandBase(int renderID) { - super(Material.iron); - this.renderID = renderID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setBlockBoundsForItemRender(); - } - - /** - * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the - * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity - */ - @Override - public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, - List par6List, Entity par7Entity) { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - /** - * Sets the block's bounds for rendering it as an item - */ - @Override - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.25f, 0.0f, 0.25f, 0.75f, 0.60f, 0.75f); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return renderID; - } - - @Override - public abstract TileEntity createNewTileEntity(World world, int var2); - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, - float these, float are) { - TileEntity tileEntity = world.getTileEntity(x, y, z); - if (tileEntity == null || player.isSneaking()) { - return super.onBlockActivated(world, x, y, z, player, idk, what, these, are); - } - - player.openGui(ProjectZulu_Core.modInstance, GuiID.BrewingStand.getID(), world, x, y, z); - return true; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - potionIcon = par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + "potion"); - super.registerBlockIcons(par1IconRegister); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/c102e1f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/c102e1f8c42100141fce95f06aba7e85 deleted file mode 100644 index d4339ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/c102e1f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; -import com.ngb.projectzulu.common.mobs.models.ModelFollower; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class FollowerDeclaration extends CreatureDeclaration { - - public FollowerDeclaration() { - super("Follower", 41, EntityFollower.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelFollower(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/c2a014fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/c2a014fac42100141fce95f06aba7e85 deleted file mode 100644 index 21b5cd3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/c2a014fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CactusArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public CactusArmorDeclaration(int renderIndex) { - super(new String[] { "CactusHelmet", "CactusChest", "CactusLegs", "CactusBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.cactusArmorHead = Optional.of(item); - return true; - case 1: - ItemList.cactusArmorChest = Optional.of(item); - return true; - case 2: - ItemList.cactusArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.cactusArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.cactusArmorHead.get(); - break; - case 1: - item = ItemList.cactusArmorChest.get(); - break; - case 2: - item = ItemList.cactusArmorLeg.get(); - break; - case 3: - item = ItemList.cactusArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d1244e9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d1244e9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1dc8c3e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/d1244e9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,502 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/f0ea36f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/f0ea36f9c42100141fce95f06aba7e85 deleted file mode 100644 index 545bb6d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dc/f0ea36f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,97 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAISmoothSwimming; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityCrocodile extends EntityGenericAnimal { - - public EntityCrocodile(World par1World) { - super(par1World); - setSize(1.7f, 0.9f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISmoothSwimming(this, true)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.chicken, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "crocoodileliving"; - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isInWater() ? baseSpeed * 2.0f : baseSpeed; - } - - @Override - protected void updateAITick() { - if (this.isInWater()) { - this.angerLevel = 400 + this.rand.nextInt(400); - } - super.updateAITick(); - } - - @Override - protected int decreaseAirSupply(int par1) { - return par1; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.chicken) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 1), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/209a3801c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/209a3801c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e8afc3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/209a3801c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPelican; -import projectzulu.common.mobs.models.ModelPelican; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/3016ade5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/3016ade5c42100141fce95f06aba7e85 deleted file mode 100644 index 56ac669..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/3016ade5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,169 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityRabbit; - -public class ModelRabbit extends ModelBase { - ModelRenderer body; - ModelRenderer queue; - ModelRenderer neck; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer LEGRIGROT; - ModelRenderer LEGLEFROT; - ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - - public ModelRabbit() { - textureWidth = 32; - textureHeight = 32; - setTextureOffset("LEGRIGROT.thigh2", 22, 18); - setTextureOffset("LEGRIGROT.leg4", 20, 26); - setTextureOffset("LEGLEFROT.thigh1", 8, 18); - setTextureOffset("LEGLEFROT.leg3", 8, 26); - setTextureOffset("HEADROT.head", 19, 5); - setTextureOffset("HEADROT.nose", 23, 11); - setTextureOffset("EARLEFROT.ear1", 27, 1); - setTextureOffset("EARRIGROT.ear2", 19, 1); - - body = new ModelRenderer(this, 0, 0); - body.addBox(-2F, -2F, -4F, 4, 4, 5); - body.setRotationPoint(0F, 21F, 3F); - body.setTextureSize(32, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - queue = new ModelRenderer(this, 0, 18); - queue.addBox(-1F, -1F, 0F, 2, 2, 1); - queue.setRotationPoint(0F, 22F, 4F); - queue.setTextureSize(32, 32); - queue.mirror = true; - setRotation(queue, 0F, 0F, 0F); - neck = new ModelRenderer(this, 0, 11); - neck.addBox(-2F, -2F, -6F, 4, 2, 2); - neck.setRotationPoint(0F, 21F, 3F); - neck.setTextureSize(32, 32); - neck.mirror = true; - setRotation(neck, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 28); - leg1.addBox(-2F, 0F, -1F, 1, 3, 1); - leg1.setRotationPoint(0F, 21F, -2F); - leg1.setTextureSize(32, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 4, 28); - leg2.addBox(1F, 0F, -1F, 1, 3, 1); - leg2.setRotationPoint(0F, 21F, -2F); - leg2.setTextureSize(32, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(2.5F, 21F, 2.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("thigh2", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGRIGROT.addBox("leg4", -0.5F, 2F, -3.5F, 1, 1, 5); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-2.5F, 21F, 2.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("thigh1", -0.5F, -1F, -2.5F, 1, 3, 4); - LEGLEFROT.addBox("leg3", -0.5F, 2F, -3.5F, 1, 1, 5); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 19F, -2.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -3F, -1F, 3, 3, 3); - HEADROT.addBox("nose", -0.5F, -1F, -1.5F, 1, 1, 1); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARLEFROT, -0.5585054F, -0.4363323F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("ear1", -0.5F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARLEFROT); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(0F, 0F, 0F); - setRotation(EARRIGROT, -0.5585054F, 0.4363323F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("ear2", -0.6F, -6F, -0.5F, 1, 3, 1); - HEADROT.addChild(EARRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_x = 0.0f; - float field_78145_j = 4.0F; - float field_78145_z = 0.0F; - - float var8 = 2.0F; - float head_scale_Render = 0.95f; - - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_x * f5, field_78145_j * f5, field_78145_z * f5); - HEADROT.render(f5 * head_scale_Render); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - GL11.glPopMatrix(); - - } else { - body.render(f5); - queue.render(f5); - neck.render(f5); - leg1.render(f5); - leg2.render(f5); - LEGRIGROT.render(f5); - LEGLEFROT.render(f5); - HEADROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityRabbit var5 = (EntityRabbit) par1EntityLiving; - - if (!var5.onGround) { - - } else { - /* Walking On The Ground */ - leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/60e708f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/60e708f7c42100141fce95f06aba7e85 deleted file mode 100644 index 77cb221..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/60e708f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.spike.BlockSpikes; -import com.ngb.projectzulu.common.blocks.spike.RenderSpike; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class SpikesDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public SpikesDeclaration() { - super("Spikes"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.spike = Optional - .of(new BlockSpikes(renderID).setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.spike.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderSpike()); - ProjectZuluLog.info("Spike Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/616566e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/616566e4c42100141fce95f06aba7e85 deleted file mode 100644 index 1e1c78c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/616566e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.IItemRenderer; - -import org.lwjgl.opengl.GL11; - -import projectzulu.experimental.ModelWarAxe; - -public class ItemRendererWarAxe implements IItemRenderer{ - - ModelWarAxe model = new ModelWarAxe(); - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - boolean answer = type == ItemRenderType.EQUIPPED ? true : false; -// System.out.println(answer); - - return answer; - } - - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, - ItemRendererHelper helper) { -// System.out.println("shouldUseRenderHelper?"); - - return false; - } - - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { -// System.out.println("renderItem?"); - switch (type) - { -// case ENTITY: renderHelmet(-0.5F, 0.5F, -0.5F); break; - case EQUIPPED: renderHelmet(0F, 0.4F, 0F); break; -// case INVENTORY: renderHelmet(1F, 0.65F, 1F); break; - default: break; - } - } - - public void renderHelmet(float x, float y, float z){ - String textureLocation = ""; - GL11.glPushMatrix(); //start -// ForgeHooksClient.bindTexture("/mods/vikinghelmet.png", 0); //TODO: Commented bindTexture - GL11.glTranslatef(x, y, z); //size - float var10 = 0.0625F; - model.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 0.0F, var10); - GL11.glPopMatrix(); //end - - -// bindTextureByName(textureLocation); -// GL11.glPushMatrix(); -// GL11.glDisable(GL11.GL_CULL_FACE); -// -// GL11.glTranslatef(par1 + (float)tranOffset[meta].xCoord, par2 + (float)tranOffset[meta].yCoord, par3 + (float)tranOffset[meta].zCoord); -// switch (meta){ -// case 1: -// break; -// case 2: -// break; -// case 3: -// rotation = 180.0F; -// break; -// case 4: -// rotation = 270.0F; -// break; -// case 5: -// default: -// rotation = 90.0F; -// } -// System.out.println(meta); -// System.out.println("Skull: ".concat(Integer.toString(skullState))); -// -// GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); -// GL11.glScalef(-1.0f, -1.0F, 1.0F); -// ((ModelBase) modelHeads.get(skullType)).render((Entity)null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); -// GL11.glPopMatrix(); - -// model.render((entity)null, f, f1, f2, f3, f4, f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/70e63c9ec62100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/70e63c9ec62100141a6cb1c64d7b6ba1 deleted file mode 100644 index c4ead9e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/70e63c9ec62100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,380 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7163d89fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7163d89fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f1b984a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/7163d89fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; - -public class BPSetHallwaySpawner implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetHallwaySpawner() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "hallway_spawner"; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1 && piecePos.posX == 0 && piecePos.posZ == 0 && random.nextInt(2) == 0) { - PyramidFeature feature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.air); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/805031fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/805031fac42100141fce95f06aba7e85 deleted file mode 100644 index 9b1b456..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/805031fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,57 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBeaverHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBeaverHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 38, 14); - setTextureOffset("HEADROT.nose", 38, 24); - setTextureOffset("HEADROT.teeth2", 46, 24); - setTextureOffset("HEADROT.teeth1", 46, 24); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -3F, -4F, 6, 6, 4); - HEADROT.addBox("nose", -1.5F, 0F, -5F, 3, 2, 1); - HEADROT.addBox("teeth2", 0F, 2F, -5F, 1, 1, 1); - HEADROT.addBox("teeth1", -1F, 2F, -5F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/9086f6f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/9086f6f8c42100141fce95f06aba7e85 deleted file mode 100644 index 217ff50..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/9086f6f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAIBase; - -public class EntityAISmoothSwimming extends EntityAIBase{ - private EntityLiving theEntity; - private boolean smootherSwimming = false; - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving){ - this.theEntity = par1EntityLiving; - this.setMutexBits(4); - par1EntityLiving.getNavigator().setCanSwim(true); - } - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving, boolean smootherSwimming){ - this(par1EntityLiving); - this.smootherSwimming = smootherSwimming; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - - /** - * Updates the task - */ - public void updateTask(){ -// if(smootherSwimming -//// && this.theEntity.getRNG().nextFloat() < 0.8F -//// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ) -// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ)){ -// this.theEntity.getJumpHelper().setJumping(); -// } - - if(this.theEntity.getRNG().nextFloat() < 0.8F){ - this.theEntity.getJumpHelper().setJumping(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/92b327fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/92b327fac42100141fce95f06aba7e85 deleted file mode 100644 index 2094daf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/92b327fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelLizardHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADBASE; - private ModelRenderer FRILL3ROT; - private ModelRenderer FRILL4ROT; - - public ModelLizardHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("FRILL3ROT.Frill3", 37, 22); - setTextureOffset("HEADBASE.head", 0, 0); - setTextureOffset("HEADBASE.Frill1", 29, 22); - setTextureOffset("HEADBASE.Frill2", 29, 22); - setTextureOffset("FRILL4ROT.Frill4", 37, 22); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 0F, 3F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - FRILL3ROT = new ModelRenderer(this, "FRILL3ROT"); - FRILL3ROT.setRotationPoint(1F, -2F, -2.5F); - setRotation(FRILL3ROT, 0F, 0F, 0F); - FRILL3ROT.mirror = true; - FRILL3ROT.addBox("Frill3", 0F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL3ROT); - HEADBASE.addBox("head", -3F, -3F, -8F, 6, 6, 8); - HEADBASE.addBox("Frill1", 3F, -2F, -3F, 3, 5, 1); - HEADBASE.addBox("Frill2", -6F, -2F, -3F, 3, 5, 1); - FRILL4ROT = new ModelRenderer(this, "FRILL4ROT"); - FRILL4ROT.setRotationPoint(-1F, -2F, -2.5F); - setRotation(FRILL4ROT, 0F, 0F, 0F); - FRILL4ROT.mirror = true; - FRILL4ROT.addBox("Frill4", -4F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL4ROT); - CENTERROT.addChild(HEADBASE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - FRILL3ROT.rotateAngleZ = (float)( -45*Math.PI/180 ); - FRILL4ROT.rotateAngleZ = (float)( 45*Math.PI/180 ); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a08f8af6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a08f8af6c42100141fce95f06aba7e85 deleted file mode 100644 index 197bcf3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a08f8af6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.core; - - -/** - * For usage see: {@link Pair} - */ -public class PairFullShortName implements Comparable> { - private final K fullName; - private final V shortName; - - public static PairFullShortName createPair(K fullName, V shortName) { - return new PairFullShortName(fullName, shortName); - } - - public PairFullShortName(K fullName, V shortName) { - this.fullName = fullName; - this.shortName = shortName; - } - - public K getFullName() { - return fullName; - } - - public V getShortName() { - return shortName; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairFullShortName)) { return false; } - PairFullShortName pair = (PairFullShortName)object; - return fullName.equals(pair.fullName) && shortName.equals(pair.shortName); - } - - @Override - public int hashCode(){ - return 7 * fullName.hashCode() + 13 * shortName.hashCode(); - } - - @Override - public int compareTo(PairFullShortName otherPair) { - if(otherPair.equals(this)){ - return 0; - }else{ - return this.getShortName().compareTo(otherPair.getShortName()); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a0befbfdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a0befbfdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 35ca46b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a0befbfdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a17353f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a17353f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5045311..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/a17353f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.IllegalFormatException; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.NBTWriter; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserWriteNBT extends KeyParserBase { - - public KeyParserWriteNBT(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(",", 2); - Operand operand = parseOperand(pieces); - - if (pieces.length > 1) { - TypeValuePair typeValue = new TypeValuePair(key, pieces[1]); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - String nbtOperation = (String) typeValuePair.getValue(); - try { - NBTTagCompound entityNBT = new NBTTagCompound(); - entity.writeToNBT(entityNBT); - new NBTWriter(nbtOperation).writeToNBT(entityNBT); - entity.readFromNBT(entityNBT); - return false; - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping NBT Write due to %s", e.getMessage()); - return true; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d09d9fe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d09d9fe4c42100141fce95f06aba7e85 deleted file mode 100644 index 7cb705d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d09d9fe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.core; - -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.util.MathHelper; - -public class ModelHelper { - - /** - * Absolute Value alternative to {@link MathHelper#abs(float par0)} for Double values - */ - public static double abs(double value) { - if (value < 0) { - return 0f; - } else { - return value; - } - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value may be outside - * the range of values. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max) { - return (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - } - - /** - * Maps the value in one range to a value in a second using linear interpolation. Interpolated value will be clamped - * to the min.max values of the target range. - * - * @param value: The Original Value - * @param set1min, set1max: Min and Max of the First Range - * @param set2min, set2max: Min and Max of the Second Range - * @return The New Value - */ - public static float mapValueWithClamp(float value, float set1min, float set1max, float set2min, float set2max) { - float value2 = (value - set1min) * ((set2max - set2min) / (set1max - set1min)) + set2min; - value2 = MathHelper.clamp_float(value2, set2min, set2max); - return value2; - } - - /** - * Vanilla Function used for Rotations - * - * @param par1 - * @param par2 - * @return - */ - // TODO: Rename To Something Decent, deobfuscate parameters - public static float func_78172_a(float par1, float par2) { - return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); - } - - /** - * Sets the RotationPoint of the provided Model using the value interpolated to the desired ranges foreach direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotationPoint(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotationPointX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotationPointY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotationPointZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } - - /** - * Sets the Rotation of the provided Model using the value interpolated to the desired ranges for each direction - * - * @param modelRenderer Model on which the transformed rotations will be applied - * @param mapValue Original Value Typically used as the 'time' or tempo of the animation - * @param mapMin Min Initial Range - * @param mapMax Max Initial Range - * @param valueSetXMin, valueSetYMin X min and Max Value Range to Map to - * @param valueSetZMin, valueSetXMax Y min and Max Value Range to Map to - * @param valueSetYMax, valueSetZMax Z min and Max Value Range to Map to - */ - public static void mapRotation(ModelRenderer modelRenderer, float mapValue, float mapMin, float mapMax, - float valueSetXMin, float valueSetYMin, float valueSetZMin, float valueSetXMax, float valueSetYMax, - float valueSetZMax) { - modelRenderer.rotateAngleX = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetXMin, valueSetXMax); - modelRenderer.rotateAngleY = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetYMin, valueSetYMax); - modelRenderer.rotateAngleZ = mapValueofSet1ToSet2(mapValue, mapMin, mapMax, valueSetZMin, valueSetZMax); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d1d12fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d1d12fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 804f521..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/d1d12fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/f126a2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/f126a2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8144c51..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/dd/f126a2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/102f9c9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/102f9c9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dffc281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/102f9c9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,380 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/200ff8a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/200ff8a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4fc8215..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/200ff8a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,222 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelPenguin extends ModelBase { - private ModelRenderer BODYROT; - private ModelRenderer TAILROT; - private ModelRenderer HEADROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer WINGLEFROT; - private ModelRenderer LEGLEFROT; - private ModelRenderer FOOTLEFROT; - private ModelRenderer TOELEF2ROT; - private ModelRenderer TOELEF1ROT; - private ModelRenderer TOELEF3ROT; - private ModelRenderer LEGRIGROT; - private ModelRenderer FOOTRIGROT; - private ModelRenderer TOERIG2ROT; - private ModelRenderer TOERIG1ROT; - private ModelRenderer TOERIG3ROT; - - public ModelPenguin() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 13); - setTextureOffset("BODYROT.bodydec", 37, 0); - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - setTextureOffset("TAILROT.tail3", 50, 11); - setTextureOffset("TAILROT.tail2", 40, 11); - setTextureOffset("TAILROT.tail1", 30, 11); - setTextureOffset("WINGRIGROT.wingrig", 44, 15); - setTextureOffset("WINGLEFROT.winglef", 30, 15); - setTextureOffset("LEGLEFROT.leglef", 52, 0); - setTextureOffset("TOELEF2ROT.toelefbase2", 56, 7); - setTextureOffset("TOELEF2ROT.toelefclaw2", 60, 19); - setTextureOffset("TOELEF2ROT.toeleftop2", 58, 16); - setTextureOffset("TOELEF1ROT.toelefbase1", 56, 7); - setTextureOffset("TOELEF1ROT.toelefclaw1", 60, 19); - setTextureOffset("TOELEF1ROT.toeleftop1", 58, 16); - setTextureOffset("TOELEF3ROT.toelefbase3", 56, 7); - setTextureOffset("TOELEF3ROT.toelefclaw3", 60, 19); - setTextureOffset("TOELEF3ROT.toeleftop3", 58, 16); - setTextureOffset("LEGRIGROT.legrig", 52, 0); - setTextureOffset("TOERIG2ROT.toerigbase2", 56, 7); - setTextureOffset("TOERIG2ROT.toerigclaw2", 60, 19); - setTextureOffset("TOERIG2ROT.toerigtop2", 58, 16); - setTextureOffset("TOERIG1ROT.toerigbase1", 56, 7); - setTextureOffset("TOERIG1ROT.toerigclaw1", 60, 19); - setTextureOffset("TOERIG1ROT.toerigtop1", 58, 16); - setTextureOffset("TOERIG3ROT.toerigbase3", 56, 7); - setTextureOffset("TOERIG3ROT.toerigclaw3", 60, 19); - setTextureOffset("TOERIG3ROT.toerigtop3", 58, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -4.5F, -10F, -4F, 9, 13, 6); - BODYROT.addBox("bodydec", -3F, -7.5F, -5F, 6, 9, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -10F, -1.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tail3.mirror = true; - TAILROT.addBox("tail3", -1F, 1F, 2F, 2, 1, 3); - // tail3.mirror = false; - TAILROT.addBox("tail2", -1.5F, 0F, 0F, 3, 2, 2); - TAILROT.addBox("tail1", -2F, -1F, -1F, 4, 3, 1); - BODYROT.addChild(TAILROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(4.5F, -10F, -1F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGRIGROT); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-4.5F, -10F, -1F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGLEFROT); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-3F, 3F, -0.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("leglef", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTLEFROT = new ModelRenderer(this, "FOOTLEFROT"); - FOOTLEFROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTLEFROT, 0F, 0F, 0F); - FOOTLEFROT.mirror = true; - TOELEF2ROT = new ModelRenderer(this, "TOELEF2ROT"); - TOELEF2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOELEF2ROT, 0F, 0F, 0F); - TOELEF2ROT.mirror = true; - TOELEF2ROT.addBox("toelefbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF2ROT.addBox("toelefclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF2ROT.addBox("toeleftop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF2ROT); - TOELEF1ROT = new ModelRenderer(this, "TOELEF1ROT"); - TOELEF1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOELEF1ROT, 0F, 0F, 0F); - TOELEF1ROT.mirror = true; - TOELEF1ROT.addBox("toelefbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF1ROT.addBox("toelefclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF1ROT.addBox("toeleftop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF1ROT); - TOELEF3ROT = new ModelRenderer(this, "TOELEF3ROT"); - TOELEF3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOELEF3ROT, 0F, 0F, 0F); - TOELEF3ROT.mirror = true; - TOELEF3ROT.addBox("toelefbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF3ROT.addBox("toelefclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF3ROT.addBox("toeleftop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF3ROT); - LEGLEFROT.addChild(FOOTLEFROT); - BODYROT.addChild(LEGLEFROT); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(3F, 3F, -0.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("legrig", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTRIGROT = new ModelRenderer(this, "FOOTRIGROT"); - FOOTRIGROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTRIGROT, 0F, 0F, 0F); - FOOTRIGROT.mirror = true; - TOERIG2ROT = new ModelRenderer(this, "TOERIG2ROT"); - TOERIG2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOERIG2ROT, 0F, 0F, 0F); - TOERIG2ROT.mirror = true; - TOERIG2ROT.addBox("toerigbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG2ROT.addBox("toerigclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG2ROT.addBox("toerigtop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG2ROT); - TOERIG1ROT = new ModelRenderer(this, "TOERIG1ROT"); - TOERIG1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOERIG1ROT, 0F, 0F, 0F); - TOERIG1ROT.mirror = true; - TOERIG1ROT.addBox("toerigbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG1ROT.addBox("toerigclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG1ROT.addBox("toerigtop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG1ROT); - TOERIG3ROT = new ModelRenderer(this, "TOERIG3ROT"); - TOERIG3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOERIG3ROT, 0F, 0F, 0F); - TOERIG3ROT.mirror = true; - TOERIG3ROT.addBox("toerigbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG3ROT.addBox("toerigclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG3ROT.addBox("toerigtop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG3ROT); - LEGRIGROT.addChild(FOOTRIGROT); - BODYROT.addChild(LEGRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -20), +20) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGRIGROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODYROT.rotateAngleZ = MathHelper.cos(par2 * 0.6662F * 2f) * 0.1F * par3; - - TAILROT.rotateAngleX = (float) (-20 * Math.PI / 180 + (MathHelper.cos(par2 * 0.6662F * 2f) * 0.5F * par3)); - - WINGRIGROT.rotateAngleZ = -Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - WINGLEFROT.rotateAngleZ = Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - - TOELEF1ROT.rotateAngleY = (float) (10 * Math.PI / 180); - TOERIG3ROT.rotateAngleY = (float) (-10 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/50ec47e18d2100141bd6a937048980ed b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/50ec47e18d2100141bd6a937048980ed deleted file mode 100644 index a622b37..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/50ec47e18d2100141bd6a937048980ed +++ /dev/null @@ -1,357 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - 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(vec3, vec31); - - 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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/60d668e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/60d668e4c42100141fce95f06aba7e85 deleted file mode 100644 index a5e1db0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/60d668e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,19 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/620a0cf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/620a0cf9c42100141fce95f06aba7e85 deleted file mode 100644 index 0647724..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/620a0cf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityPolarBear extends EntityBear { - - public EntityPolarBear(World par1World) { - super(par1World); - setSize(2.0f, 2.7f); - this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 13f)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 5), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/71a7a99ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/71a7a99ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d2825a0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/71a7a99ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,127 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import projectzulu.common.core.ProjectZuluLog; - - -public class ParsingHelper { - - /** - * Attempt to Parse an Integer. Performs no filters. - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static int parseInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Integer. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static int parseFilteredInteger(String value, int fallBack, String fieldName) { - try { - return Integer.parseInt(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an integer. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an integer. The Default value of %s will be used.", value, - fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Long. Filters all non-numeric Characters, excluding the negative (-) sign. - */ - public static Long parseFilteredLong(String value, Long fallBack, String fieldName) { - try { - return Long.parseLong(value.replaceAll("[^\\d-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an long. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an long. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Float. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static float parseFilteredFloat(String value, float fallBack, String fieldName) { - try { - return Float.parseFloat(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Double. Filters all non-numeric Characters, excluding the negative (-) and (.) sign. - */ - public static double parseFilteredDouble(String value, double fallBack, String fieldName) { - try { - return Double.parseDouble(value.replaceAll("[^\\d.-]", "")); - } catch (NumberFormatException e) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for an double. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for an double. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } - } - - /** - * Attempt to Parse an Boolean - * - * @param value String to be Parsed - * @param fallBack Default value if value cannot be parsed - * @param fieldName FieldName that is being parsed for error reporting. Null will omit it. - * @return - */ - public static boolean parseBoolean(String value, boolean fallBack, String fieldName) { - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) { - if (fieldName != null) { - ProjectZuluLog.warning( - "Error Parsing %s for a boolean. %s was unreadable. The Default value of %s will be used.", - value, fieldName, fallBack); - } else { - ProjectZuluLog.warning("Error Parsing %s for a boolean. The Default value of %s will be used.", value, fallBack); - } - return fallBack; - } else { - return Boolean.parseBoolean(value); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/727c38fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/727c38fac42100141fce95f06aba7e85 deleted file mode 100644 index c37a2eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/727c38fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a1075da1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a1075da1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d66a2f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/a1075da1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,108 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/b09feaf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/b09feaf8c42100141fce95f06aba7e85 deleted file mode 100644 index dc1f800..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/b09feaf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,81 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityBrownBear; -import com.ngb.projectzulu.common.mobs.models.ModelBrownBear; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/e0872dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/e0872dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0a66870..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/e0872dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,290 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.EntityPZPotion; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/f26567f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/f26567f8c42100141fce95f06aba7e85 deleted file mode 100644 index 71a9aa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/de/f26567f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -/** - * Helper Classes to Parse Generic Potion properties form damage. - * - * Note the only damage values Guaranteed to work for any given SubItemPotion is subID and Splash. Any other bits are up - * to individual subItem to parse and may not conform to standard. - */ -public class PotionParser { - - public static int readID(int value) { - byte lowByte = (byte) (value & getLeastBitMask(4)); - return lowByte & 0xFF; - } - - public static int setID(int iD, int value) { - if (iD < 0 || iD > 15) { - iD = iD < 0 ? 0 : 15; - } - return setBitRange(value, iD, 0, 4); - } - - public static int readLevel(int value) { - byte lowByte = (byte) ((value >> 4) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setLevel(int level, int value) { - if (level < 0 || level > 3) { - level = level < 0 ? 0 : 3; - } - return setBitRange(value, level, 4, 2); - } - - public static int readPower(int value) { - byte lowByte = (byte) ((value >> 6) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setPower(int power, int value) { - if (power < 0 || power > 3) { - power = power < 0 ? 0 : 3; - } - return setBitRange(value, power, 6, 2); - } - - public static int readDuration(int value) { - byte lowByte = (byte) ((value >> 8) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setDuration(int duration, int value) { - if (duration < 0 || duration > 3) { - duration = duration < 0 ? 0 : 3; - } - return setBitRange(value, duration, 8, 2); - } - - public static int readContainer(int value) { - byte lowByte = (byte) ((value >> 10) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setContainer(int container, int value) { - if (container < 0 || container > 3) { - container = container < 0 ? 0 : 3; - } - return setBitRange(value, container, 10, 2); - } - - public static boolean isSplash(int value) { - return isBitSet(value, 14); - } - - public static int setSplash(int value) { - return setBit(value, 14); - } - - /** - * Sets Range of Bits in origValue to bits in ValueToSet starting from staringBitToSet for bitsToSet number of bits - * - * @param origValue - * @param valueToSet - * @param startingBitToSet - * @param bitsToSet - * @return - */ - private static int setBitRange(int origValue, int valueToSet, int startingBitToSet, int bitsToSet) { - for (int i = 0; i < bitsToSet; i++) { - if (isBitSet(origValue, startingBitToSet + i) == !isBitSet(valueToSet, i)) { - origValue = flipBit(origValue, startingBitToSet + i); - } - } - return origValue; - } - - private static boolean isBitSet(int value, int index) { - return (value & (1L << index)) != 0; - } - - private static int setBit(int value, int index) { - return value | (1 << index); - } - - private static int unSetBit(int value, int index) { - return value & ~(1 << index); - } - - private static int flipBit(int value, int index) { - return value ^ (1 << index); - } - - /** - * Returns a Mask to be & with a value to get the specified number of least significant bits - * - * @param value - * @param numBits Number of Least Significant bits desired - * @return - */ - private static int getLeastBitMask(int numBits) { - return ((1 << numBits) - 1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/20355d9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/20355d9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f66582..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/20355d9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.core; - -import java.io.File; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.minecraftforge.common.config.Configuration; - -public class ProjectZuluLog { - - private static Logger myLog; - public static boolean isSetup; - - public enum LogType { - SPAWNING, DEBUG; - public boolean isEnabled = false; - } - - public static void configureLogging(File configDirectory) { - if (!isSetup) { - isSetup = true; - myLog = Logger.getLogger("ProjectZulu|Core"); - myLog.setParent(Logger.getLogger("ForgeModLoader")); - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - for (LogType type : LogType.values()) { - if (type == LogType.DEBUG) { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", false, - "Master Switch For All Debug Printing (Not Fully Implemented)").getBoolean(false); - } else { - type.isEnabled = config.get("Properties.Logging", type.toString() + " Logging", true, - "Enables " + type + " Logging").getBoolean(true); - } - } - config.save(); - - } - } - - public static void log(Level level, String format, Object... data) { - myLog.log(level, String.format(format, data)); - } - - public static void info(String format, Object... data) { - log(Level.INFO, format, data); - } - - public static void warning(String format, Object... data) { - log(Level.WARNING, format, data); - } - - public static void severe(String format, Object... data) { - log(Level.SEVERE, format, data); - } - - public static void debug(Level level, String format, Object... data) { - if (LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } - - public static void log(LogType type, Level level, String format, Object... data) { - if (type.isEnabled || LogType.DEBUG.isEnabled) { - log(level, format, data); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/50b64fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/50b64fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 262ff54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/50b64fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class FurArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public FurArmorDeclaration(int renderIndex) { - super(new String[] { "FurHelmet", "FurChest", "FurLegs", "FurBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.scaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.furArmorHead = Optional.of(item); - return true; - case 1: - ItemList.furArmorChest = Optional.of(item); - return true; - case 2: - ItemList.furArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.furArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.furArmorHead.get(); - break; - case 1: - item = ItemList.furArmorChest.get(); - break; - case 2: - item = ItemList.furArmorLeg.get(); - break; - case 3: - item = ItemList.furArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/606e18fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/606e18fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d0a628b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/606e18fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/72d2fbe5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/72d2fbe5c42100141fce95f06aba7e85 deleted file mode 100644 index 5466309..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/72d2fbe5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/8007cda1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/8007cda1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4af4a31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/8007cda1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.models.ModelMinotaur; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/a2f822fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/a2f822fac42100141fce95f06aba7e85 deleted file mode 100644 index 011c0fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/a2f822fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - - - -public class ModelTreeEntHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer NOSEROT; - private ModelRenderer BACKTREESTEM5; - private ModelRenderer BACKTREESTEM6; - - public ModelTreeEntHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("BODYROT.mosscb2", 0, 28); - setTextureOffset("BODYROT.mosscb", 0, 20); - setTextureOffset("HEADROT.head", 88, 0); - setTextureOffset("HEADROT.brow5", 98, 18); - setTextureOffset("HEADROT.brow4", 98, 18); - setTextureOffset("HEADROT.brow3", 98, 18); - setTextureOffset("HEADROT.brow2", 106, 17); - setTextureOffset("HEADROT.brow1", 106, 13); - setTextureOffset("NOSEROT.nose1", 90, 16); - setTextureOffset("NOSEROT.nose2", 94, 20); - setTextureOffset("NOSEROT.nose3", 90, 22); - setTextureOffset("BACKTREESTEM5.backtreestem5", 32, 28); - setTextureOffset("BACKTREESTEM5.backtreesleaves5", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreesleaves6", 23, 42); - setTextureOffset("BACKTREESTEM6.backtreestem6", 32, 28); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 24F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 0F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("mosscb2", -3.5F, -3F, 1F, 7, 3, 4); - BODYROT.addBox("mosscb", -4.5F, -3F, -3F, 9, 3, 4); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -3F, -4.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2.5F, -9F, -2.5F, 5, 12, 4); - HEADROT.addBox("brow5", 1.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow4", -0.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow3", -2.5F, -5.5F, -3.5F, 1, 2, 1); - HEADROT.addBox("brow2", -2.5F, -3.5F, -3.5F, 5, 3, 1); - HEADROT.addBox("brow1", -2.5F, -7.5F, -3.5F, 5, 2, 1); - NOSEROT = new ModelRenderer(this, "NOSEROT"); - NOSEROT.setRotationPoint(0F, -3F, -3F); - setRotation(NOSEROT, 0F, 0F, 0F); - NOSEROT.mirror = true; - NOSEROT.addBox("nose1", -0.5F, 0F, -2.5F, 1, 1, 2); - NOSEROT.addBox("nose2", -0.5F, 1F, -2.5F, 1, 1, 1); - NOSEROT.addBox("nose3", -1F, 2F, -3F, 2, 2, 2); - HEADROT.addChild(NOSEROT); - BODYROT.addChild(HEADROT); - BACKTREESTEM5 = new ModelRenderer(this, "BACKTREESTEM5"); - BACKTREESTEM5.setRotationPoint(3F, -3F, 0.5F); - setRotation(BACKTREESTEM5, 0F, 0F, 0F); - BACKTREESTEM5.mirror = true; - BACKTREESTEM5.addBox("backtreestem5", -0.5F, -4F, -0.5F, 1, 4, 1); - BACKTREESTEM5.addBox("backtreesleaves5", -3F, -7F, -3F, 6, 3, 6); - BODYROT.addChild(BACKTREESTEM5); - BACKTREESTEM6 = new ModelRenderer(this, "BACKTREESTEM6"); - BACKTREESTEM6.setRotationPoint(-3F, -3F, 0.5F); - setRotation(BACKTREESTEM6, 0F, 0F, 0F); - BACKTREESTEM6.mirror = true; - BACKTREESTEM6.addBox("backtreesleaves6", -3F, -7F, -3F, 6, 3, 6); - BACKTREESTEM6.addBox("backtreestem6", -0.5F, -4F, -0.5F, 1, 4, 1); - BODYROT.addChild(BACKTREESTEM6); - CENTERROT.addChild(BODYROT); - } - - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BACKTREESTEM5.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM5.rotateAngleZ = (float)(+20*Math.PI/180f); - - BACKTREESTEM6.rotateAngleX = (float)(-10*Math.PI/180f); - BACKTREESTEM6.rotateAngleZ = (float)(-20*Math.PI/180f); - - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/b017c4fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/b017c4fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 09eaa35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/b017c4fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/b0ef22a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/b0ef22a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c7c4e95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/b0ef22a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; - -public class SlotBrewingStandSinglePotion extends Slot { - /** The player that has this container open. */ - private EntityPlayer player; - - public SlotBrewingStandSinglePotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, - int par5) { - super(par2IInventory, par3, par4, par5); - this.player = par1EntityPlayer; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return canHoldPotion(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 1; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack itemStack) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack)) { - this.player.addStat(AchievementList.potion, 1); - } - - super.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - /** - * Returns true if this itemstack can be filled with a potion - */ - public static boolean canHoldPotion(ItemStack itemStack) { - return itemStack != null - && (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack) || itemStack.getItem() == Items.potionitem - && itemStack.getItemDamage() == 0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/d05616a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/d05616a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1dde782..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/d05616a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/e0557c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/e0557c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0dd1ef4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/e0557c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; - -public class NBTTree { - private NBTNode root; - - public NBTTree(NBTBase rootData, String rootName) { - root = new NBTNode(rootData, null, rootName); - } - - public NBTNode getRootNode() { - return root; - } - - public boolean addNode(NBTBase data, NBTNode parent, String tagName) { - return parent.addChild(data, tagName); - } - - public void removeChildNode(NBTNode nodeToRemove, NBTNode parentNode) { - parentNode.removeChild(nodeToRemove); - } - - public NBTTagCompound toNBTTagCompound() { - NBTTagCompound nbtTagCompound = new NBTTagCompound(); - root.writeNodeandChildrenToNBT(nbtTagCompound); - return (NBTTagCompound) nbtTagCompound.getTag("Properties"); - } - - public ArrayList toArrayList() { - ArrayList nodeList = new ArrayList(); - root.writeNodeandChildrenToArrayList(nodeList); - return nodeList; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/f1bf45fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/f1bf45fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index eb9d7af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/df/f1bf45fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.itemblockdeclaration; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.dungeon.BlockLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawnerRenderer; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LimitedMobSpawnerDeclaration extends BlockDeclaration { - - public LimitedMobSpawnerDeclaration() { - super("LimitedMobSpawner"); - } - - @Override - protected boolean createBlock() { - BlockList.limitedMobSpawner = Optional - .of(new BlockLimitedMobSpawner().setHardness(0.5F).setStepSound(Block.soundTypeMetal) - .setBlockName(name.toLowerCase()).setBlockTextureName("mob_spawner")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.limitedMobSpawner.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityLimitedMobSpawner.class, "TileEntityLimitedMobSpawner"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLimitedMobSpawner.class, - new TileEntityLimitedMobSpawnerRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1047dab3042100141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1047dab3042100141769cb1ed0c338cd deleted file mode 100644 index 7d850eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/1047dab3042100141769cb1ed0c338cd +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; -import projectzulu.common.mobs.entityai.RandomPositionGenerator; -//import net.minecraft.entity.ai.RandomPositionGenerator; - -public class EntityAIPanic extends EntityAIBase { - private EntityCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) - { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/10b98df5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/10b98df5c42100141fce95f06aba7e85 deleted file mode 100644 index 7ae3058..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/10b98df5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityElephant; -import com.ngb.projectzulu.common.mobs.models.ModelElephant; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/215860a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/215860a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f53b3e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/215860a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemScale; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScaleItemDeclaration extends ItemDeclaration { - - public ScaleItemDeclaration() { - super("ScaleItem"); - } - - @Override - protected boolean createItem() { - ItemList.scaleItem = Optional.of(new ItemScale(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scaleItem.get(); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/42ad46fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/42ad46fac42100141fce95f06aba7e85 deleted file mode 100644 index 9359599..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/42ad46fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,264 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/50a3cd00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/50a3cd00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f809084..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/50a3cd00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/900454e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/900454e6c42100141fce95f06aba7e85 deleted file mode 100644 index 514a919..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/900454e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,473 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.io.ByteArrayOutputStream; -//import java.io.DataInputStream; -//import java.io.DataOutputStream; -//import java.io.IOException; -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.entity.EntityLiving; -//import net.minecraft.entity.EntityLivingBase; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.entity.player.EntityPlayerMP; -//import net.minecraft.nbt.NBTTagCompound; -//import net.minecraft.network.packet.Packet250CustomPayload; -//import net.minecraft.potion.Potion; -//import net.minecraft.potion.PotionEffect; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -//import cpw.mods.fml.common.network.PacketDispatcher; -//import cpw.mods.fml.common.network.Player; -// -//public class TemperatureTicker implements ITickHandler, IPlayerTracker{ -// -// /* Temperature Used When Changint Dimensions or Loading into a World for the First Time */ -// private static float defaultTemperature = 0; -// /* Player Tempurature, Used to Calculate Effects and Display */ -// private static float playerTemperature = 0; -// private static Map temperatureMap = new HashMap(); -// /* Last World the Player was in, Used to Determine if the player has Switched worlds or Just Loaded Minecraft */ -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// /* Used For Displaying the Environment Temperature around a player, used in DisplayTemperatureTicker to mark the Temp. the Player Trending Towards in */ -// private static Map playerLocTempMap = new HashMap(); -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private short DirtyFlag = 0; -// public TemperatureTicker(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( temperatureMap.containsKey( player.getEntityName() ) ){ -// playerTemperature = temperatureMap.get( player.getEntityName() ); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP ){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// /* Read From File */ -// if ( HasPendingRead() ){ -// readNBTFromFile(player); -// ClearPendingRead(); -// } -// } -// -// /* Get Outside Temperature */ -// float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// float unTouchedPlayerLocationTemperature; -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// unTouchedPlayerLocationTemperature = playerLocTempMap.get(player.getEntityName()); -// }else { -// unTouchedPlayerLocationTemperature = playerLocationTemperature; -// } -// float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -// playerLocationTemperature += item.getLocationTemperatureFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getPlayerTempContributionFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// if(currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 3)); -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 1)); -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Save Temperature To Map*/ -// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -// if(player instanceof EntityPlayerMP){ -// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -// DataOutputStream data = new DataOutputStream(bytes); -//// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -// -// /* Write PacketID into Packet */ -// try { -// data.writeInt(1); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// /* Write Temperature Into Packet*/ -// try { -// data.writeFloat(playerTemperature); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// -// Packet250CustomPayload packet = new Packet250CustomPayload(); -// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -// packet.data = bytes.toByteArray(); -// packet.length = packet.data.length; -// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -//// System.out.println( player.getEntityName().concat("Sent Packet ")); -// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// nbttagcompound.setFloat(player.getEntityName().concat("Player Temperature"), playerTemperature); -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// if (nbttagcompound.hasKey( player.getEntityName().concat("Player Temperature") )){ -// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("Player Temperature") ); -// } -// } -// -// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -// -// /* Get Relevent Data From DataStream */ -// float tempTemp = playerTemperature; -// try { -// tempTemp = data.readFloat(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// /* Make Sure Player Exists, then Assign data to map */ -// if(temperatureMap.containsKey(sender.getEntityName())){ -// temperatureMap.put(sender.getEntityName(), tempTemp); -// } -// -// -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -// temperatureMap.put(player.getEntityName(), 0.0f); -// lastWorldNameMap.put(player.getEntityName(), ""); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// } -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// setPlayerToDefaultTemp(player); -// } -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -// setPlayerToDefaultTemp(player); -// } -// -// public void setPlayerToDefaultTemp(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/909ac3f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/909ac3f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0bdcd32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/909ac3f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.io.File; -import java.util.ArrayList; - -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityDeclaration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public enum CustomEntityManager { - INSTANCE; - private ArrayList entities = new ArrayList(); - - private CustomEntityManager(){} - - public void addEntity(EntityDeclaration... entity) { - for (EntityDeclaration entityDeclaration : entity) { - entities.add(entityDeclaration); - } - } - - public void loadCreaturesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadCreaturesFromConfig(config); - } - config.save(); - } - - public void loadBiomesFromConfig(File configDirectory){ - Configuration config = new Configuration( new File(configDirectory, DefaultProps.configDirectory + DefaultProps.mobBiomeSpawnConfigFile) ); - config.load(); - for (EntityDeclaration entity : entities) { - entity.loadBiomesFromConfig(config); - } - config.save(); - } - - public void registerEntities(File configDirectory){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerEntity(); - entity.registerEgg(); - entity.loadCustomMobData(configDirectory); - } - } - } - - public void addSpawns(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.addSpawn(); - } - } - } - - @SideOnly(Side.CLIENT) - public void registerModelsAndRender(){ - for (EntityDeclaration entity : entities) { - if(entity.shouldExist()){ - entity.registerModelAndRender(); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/91ca2500c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/91ca2500c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index f87c383..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/91ca2500c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/c139b5a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/c139b5a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 864d693..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/c139b5a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGiraffe; -import projectzulu.common.mobs.models.ModelGiraffe; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/d00bea9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/d00bea9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 109e51f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/d00bea9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/e1557c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/e1557c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6048e32..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/e1557c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,161 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import scala.annotation.meta.param; - -public class Node implements Comparable { - private Node parent; - private String name; - private List children = new ArrayList(); - - public Node(Node parent, String data) { - this.parent = parent; - parseDataForNode(data); - parseDataForChild(data); - } - - public Node getParent() { - return parent; - } - - public String getName() { - return name; - } - - /** - * Return Node name Concated after the name of its Parent(s) - * - * @return - */ - public String getFullName() { - return prefixParents(name); - } - - private String prefixParents(String name) { - if (parent != null && parent.parent != null && parent.parent.name.equals("root")) { - return parent.prefixParents(parent.name + ":" + name); - } else if (parent != null && !parent.name.equals("root")) { - return parent.prefixParents(parent.name + "." + name); - } else { - return name; - } - } - - public boolean addChild(String data) { - parseDataForChild(data); - return true; - } - - public Node getChild(int index) { - return children.get(index); - } - - public int numberOfChildren() { - return children.size(); - } - - public void sortNodeTree() { - Collections.sort(children); - for (Node child : children) { - child.sortNodeTree(); - } - } - - /** - * Return true if Name is Parsed from Data - */ - private boolean parseDataForNode(String data) { - String[] stringSplitData = data.split("\\.", 2); - this.name = stringSplitData[0]; - return true; - } - - /** - * Return true if Child is added from Data - */ - private boolean parseDataForChild(String data) { - String[] stringSplitData = data.split("\\.", 2); - if (stringSplitData.length < 2) { - return false; - } - String[] stringSplitChild = stringSplitData[1].split("\\.", 2); - - String childName = stringSplitChild[0]; - for (Node child : children) { - if (child.name.equals(childName)) { - child.addChild(stringSplitData[1]); - return true; - } - } - children.add(new Node(this, stringSplitData[1])); - return true; - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - Node otherNode = (Node) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (name == null) { - if (otherNode.name != null) { - return false; - } - } else if (!name.equals(otherNode.name)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } - - @Override - public int compareTo(Node node) { - if (node != null && node.children.size() > 0) { - if (children.size() > 0) { - return this.name.compareTo(node.name); - } else { - return +1; - } - } else if (this.children.size() > 0) { - return -1; - } - return this.name.compareTo(node.name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0476cf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0476cf8c42100141fce95f06aba7e85 deleted file mode 100644 index e986f3f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e/f0476cf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import com.ngb.projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/106837fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/106837fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 97d61e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/106837fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.core.terrain; - -import java.io.File; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.core.DefaultProps; - -public class FeatureConfiguration extends Configuration { - - public FeatureConfiguration(File configDirectory) { - super(new File(configDirectory, DefaultProps.configDirectory + DefaultProps.structureBiomeConfigFile)); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - int defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - boolean defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - String defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } - - public Property getFeatureProperty(TerrainFeature terrainFeature, String subCategory, String propertyName, - Double defaultValue, String comment) { - return get("Feature." + terrainFeature.getFeatureSize() + "." + terrainFeature.getFeatureName() + "." - + subCategory, propertyName, defaultValue, comment); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/21d3909fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/21d3909fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4d82ea9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/21d3909fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/41ce14f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/41ce14f7c42100141fce95f06aba7e85 deleted file mode 100644 index aa6ea58..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/41ce14f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockPalmTreePlank; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreePlankDeclaration extends BlockDeclaration { - - public PalmTreePlankDeclaration() { - super("PalmTreePlank"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreePlank = Optional - .of(new BlockPalmTreePlank().setStepSound(Block.soundTypeWood).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreePlank.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("plankWood", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/7008df00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/7008df00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 521ca54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/7008df00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityPenguin extends EntityGenericAnimal implements IAnimals { - - public EntityPenguin(World par1World) { - super(par1World); - setSize(0.9f, 1.5f); - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.fish, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.cooked_fished, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "penguinhurt"; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 13), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/823c51ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/823c51ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index ea8d873..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/823c51ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.entity.EntityList; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MobSpawnerWithMeta; -import projectzulu.common.world.terrain.LabyrinthFeature; - -public class BlueprintLabyrinthHiddenWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - String entityName = feature.getEntityEntry(random); - if (EntityList.stringToClassMapping.containsKey(entityName)) { - return new MobSpawnerWithMeta(entityName); - } else { - if (!entityName.equalsIgnoreCase("EMPTY")) { - ProjectZuluLog.severe("Entity with name %s does not seem to exist.", entityName); - } - return new BlockWithMeta(Blocks.stonebrick, 2); - } - } else if (piecePos.posY == 2) { - LabyrinthFeature feature = (LabyrinthFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(LabyrinthFeature.LABYRINTH); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), feature.chestLootChance, - feature.chestMaxLoot); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1 || piecePos.posZ == 0 || piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthhiddenwall"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/909351e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/909351e6c42100141fce95f06aba7e85 deleted file mode 100644 index bce8efc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/909351e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.temperature; - -import net.minecraft.entity.player.EntityPlayer; - -/** - * Interface which marks object as a Temperature Armor - * Methods will automatically be called in TemperatureTicker by every nearby player - */ -public interface ITempBlock { - - /** - * Factor that adds to the current Player Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition - * Design Directive: Should be used for non-environment/short term effects: i.e. eating items that would instantly effect temperature - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise. - */ - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Location Temp for when the Block is Nearby - * Applied in the form TempFinal = TempInitial + TempAddition3 - * Design Directive: Should be used for environment/long term effects: i.e. sitting in a sauna would increase temperature over time - * @param player - * @param playerTemp - * @param playerLocationTemp - * @return Float of 0 if no effect is desired, Float TempAddition otherwise - */ - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, Float playerTemp, float playerLocationTemp); - - /** - * Factor that adds to the current Heat Transfer Rate for when the Block is Nearby - * Applied in the form HeatTransferRate += RateAddition - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return Float of 0 if no effect is desired, Float RateAddition otherwise - */ - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); - - /** - * Boolean that sets whether the "fast" heat transfer is used. If true (or set to true by other item), will override AddToHeatTransfer Effects - * Applied in the form HeatTransferRate += RateAddition - * Design Directive: Should be used to sparingly. Always - * @param player - * @param playerTemp - * @param playerLocationTemp - * @param currentHeatRate - * @return false for normal speed, true for fast - */ - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, float currentHeatRate); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/b04c58a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/b04c58a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 82e5329..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/b04c58a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/b0f2f59ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/b0f2f59ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0e74eb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/b0f2f59ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,114 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathNavigate; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIFollowOwner extends EntityAIBase{ - private EntityGenericAnimal thePet; - private EntityLivingBase theOwner; - World theWorld; - private float moveSpeed; - private PathNavigate petPathfinder; - private int field_75343_h; - float maxDist; - float minDist; - private boolean field_75344_i; - - public EntityAIFollowOwner(EntityGenericAnimal par1EntityTameable, float par2, float par3, float par4){ - this.thePet = par1EntityTameable; - this.theWorld = par1EntityTameable.worldObj; - this.moveSpeed = par2; - this.petPathfinder = par1EntityTameable.getNavigator(); - this.minDist = par3; - this.maxDist = par4; - this.setMutexBits(3); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - EntityLivingBase var1 = this.thePet.getOwner(); - - if (var1 == null){ - return false; - } - else if (this.thePet.getEntityState() != EntityStates.following){ - return false; - } - else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)){ - return false; - } - else{ - this.theOwner = var1; - return true; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting(){ - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) - && !this.thePet.isSitting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask(){ - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - - /** - * Updates the task - */ - public void updateTask(){ - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); - - if (!this.thePet.isSitting() && --this.field_75343_h <= 0){ - this.field_75343_h = 10; - - if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.moveSpeed) && this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D){ - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - - for (int var4 = 0; var4 <= 4; ++var4){ - for (int var5 = 0; var5 <= 4; ++var5){ - if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) - && World.doesBlockHaveSolidTopSurface(theWorld, var1 + var4, var3 - 1, var2 + var5) - && !theWorld.getBlock(var1 + var4, var3, var2 + var5).isNormalCube() - && !theWorld.getBlock(var1 + var4, var3 + 1, var2 + var5).isNormalCube()){ - this.thePet.setLocationAndAngles( - (double)((float)(var1 + var4) + 0.5F), - (double)var3, - (double)((float)(var2 + var5) + 0.5F), - this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } - } - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/d0bd75f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/d0bd75f8c42100141fce95f06aba7e85 deleted file mode 100644 index 7a7f9b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/d0bd75f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.PotionEffect; - -public class PotionCurse extends PotionZulu { - - public PotionCurse(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(2, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - - /* Get Active Potion effect Collection from Entity */ - Collection potionEffects = effectedEntity.getActivePotionEffects(); - - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - /* Check if we Should Try to Get a PotionEffect, proportional to Potion Strength */ - if ((par2 + 1) * 25 + 25 - effectedEntity.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToAct = numOfElemenents > 0 ? effectedEntity.worldObj.rand.nextInt(numOfElemenents) : 0; - Iterator iterator = potionEffects.iterator(); - - /* Get Specific Element and assuming its not the Current Potion ID, mark it for Removal */ - int i = 0; - PotionEffect potionEffectToPerform = null; - while (iterator.hasNext() && i <= elementToAct) { - potionEffectToPerform = (PotionEffect) iterator.next(); - if (i == elementToAct && !effectedEntity.worldObj.isRemote && potionEffectToPerform != null - && potionEffectToPerform.getPotionID() != id) { - potionEffectToPerform.performEffect(effectedEntity); - break; - } - i++; - } - } - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/d19808e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/d19808e5c42100141fce95f06aba7e85 deleted file mode 100644 index 3bb58a3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/d19808e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityBeaver extends EntityGenericAnimal implements IAnimals { - - public EntityBeaver(World par1World) { - super(par1World); - setSize(0.63f, 0.8f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Items.spider_eye, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "beaverliving"; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 6), 1); - } - super.dropRareDrop(par1); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/f142d99ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/f142d99ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1967446..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e0/f142d99ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/40e2e1f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/40e2e1f7c42100141fce95f06aba7e85 deleted file mode 100644 index c4017d9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/40e2e1f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -public enum ItemList { - instance; - /* Items */ - public static Optional ankh = Optional.absent(); - public static Optional scaleItem = Optional.absent(); - public static Optional furPelt = Optional.absent(); - - public static Optional aloeVeraSeeds = Optional.absent(); - public static Optional waterDroplets = Optional.absent(); - - public static Optional coconutItem = Optional.absent(); - public static Optional coconutSeed = Optional.absent(); - public static Optional coconutShell = Optional.absent(); - public static Optional coconutMilkFragment = Optional.absent(); - - public static Optional genericCraftingItems = Optional.absent(); - public static Optional scrapMeat = Optional.absent(); - public static Optional structurePlacer = Optional.absent(); - public static Optional potionIngredients = Optional.absent(); - public static Optional customPotions = Optional.absent(); - public static Optional vanillaPotions = Optional.absent(); - - /* Armor */ - public static Optional scaleArmorHead = Optional.absent(); - public static Optional scaleArmorChest = Optional.absent(); - public static Optional scaleArmorLeg = Optional.absent(); - public static Optional scaleArmorBoots = Optional.absent(); - - public static Optional goldScaleArmorHead = Optional.absent(); - public static Optional goldScaleArmorChest = Optional.absent(); - public static Optional goldScaleArmorLeg = Optional.absent(); - public static Optional goldScaleArmorBoots = Optional.absent(); - - public static Optional ironScaleArmorHead = Optional.absent(); - public static Optional ironScaleArmorChest = Optional.absent(); - public static Optional ironScaleArmorLeg = Optional.absent(); - public static Optional ironScaleArmorBoots = Optional.absent(); - - public static Optional diamondScaleArmorHead = Optional.absent(); - public static Optional diamondScaleArmorChest = Optional.absent(); - public static Optional diamondScaleArmorLeg = Optional.absent(); - public static Optional diamondScaleArmorBoots = Optional.absent(); - - public static Optional whiteClothHead = Optional.absent(); - public static Optional whiteClothChest = Optional.absent(); - public static Optional whiteClothLeg = Optional.absent(); - public static Optional whiteClothBoots = Optional.absent(); - - public static Optional redClothHead = Optional.absent(); - public static Optional redClothChest = Optional.absent(); - public static Optional redClothLeg = Optional.absent(); - public static Optional redClothBoots = Optional.absent(); - - public static Optional greenClothHead = Optional.absent(); - public static Optional greenClothChest = Optional.absent(); - public static Optional greenClothLeg = Optional.absent(); - public static Optional greenClothBoots = Optional.absent(); - - public static Optional blueClothHead = Optional.absent(); - public static Optional blueClothChest = Optional.absent(); - public static Optional blueClothLeg = Optional.absent(); - public static Optional blueClothBoots = Optional.absent(); - - public static Optional cactusArmorHead = Optional.absent(); - public static Optional cactusArmorChest = Optional.absent(); - public static Optional cactusArmorLeg = Optional.absent(); - public static Optional cactusArmorBoots = Optional.absent(); - - public static Optional furArmorHead = Optional.absent(); - public static Optional furArmorChest = Optional.absent(); - public static Optional furArmorLeg = Optional.absent(); - public static Optional furArmorBoots = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/60a83ffac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/60a83ffac42100141fce95f06aba7e85 deleted file mode 100644 index 16345e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/60a83ffac42100141fce95f06aba7e85 +++ /dev/null @@ -1,203 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; - -public class BlockPalmTreeSapling extends BlockBush { - public BlockPalmTreeSapling() { - super(Material.plants); - float var3 = 0.4F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote) { - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { - this.growTree(par1World, par2, par3, par4, par5Random); - } - } - } - - /** - * Attempts to grow a sapling into a tree - */ - public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { - if (!par1World.isRemote && BlockList.palmTreeLeaves.isPresent() && BlockList.palmTreeLog.isPresent()) { - int height = par5Random.nextInt(3) + 4; - - // Check if there is water nearby 9x9 - - // As loop finds water it incremement direction towards it, - // The favored direction at the end of the loop will be towards the side with more water - int favoredDirectionX = 0; - int favoredDirectionZ = 0; - - for (int i = -4; i <= 4; i++) { - for (int k = -4; k <= 4; k++) { - for (int j = -4; j <= 4; j++) { - Block ID = par1World.getBlock(par2 + i, par3 + j, par4 + k); - if (ID == Blocks.flowing_water || ID == Blocks.water) { - // Add +/- 1 to favored Direcion indicating the direction water is in - if (i != 0) { - favoredDirectionX += i / Math.abs(i); - } - if (k != 0) { - favoredDirectionZ += k / Math.abs(k); - } - } - } - } - } - // TBD: If favoredDirectionX and Z are almost the same, greater than 2 and Rare chance, spawn multiple - // trees. - - // Set FavoredDirection that is less to zero, as we don't want to grow a tree in that direction - if (Math.abs(favoredDirectionX) - Math.abs(favoredDirectionZ) >= 0) { - favoredDirectionZ = 0; - } else { - favoredDirectionX = 0; - } - - // Temp variables used in placing log blocks, work wrt global coordinats of block - int localX = 0; - int localY = 0; - int localZ = 0; - - // Adjusts the 'cost' of placing a block horizontally, higher means less horizontal variance - // Does not affect vertical, which is set by height - int horizontalFactor = par5Random.nextInt(10) + 20; - Block palmTreeLogID = BlockList.palmTreeLog.get(); - while (localY <= height) { - // Place Log above by 1 - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - if (favoredDirectionX > 0) { - localX++; - favoredDirectionX = Math.max(favoredDirectionX - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionX < 0) { - localX--; - favoredDirectionX = Math.min(favoredDirectionX + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } - - if (favoredDirectionZ > 0) { - localZ++; - favoredDirectionZ = Math.max(favoredDirectionZ - horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - - } else if (favoredDirectionZ < 0) { - localZ--; - favoredDirectionZ = Math.min(favoredDirectionZ + horizontalFactor, 0); - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - } - - if (localY + 1 == height) { - localY++; - par1World.setBlock(par2 + localX, par3 + localY, par4 + localZ, palmTreeLogID); - localY++; - spawnLeaves(par1World, par2 + localX, par3 + localY, par4 + localZ, par5Random, height); - // Place block at original sapling locations - par1World.setBlock(par2, par3, par4, palmTreeLogID); - } - } - } - } - - public void spawnLeaves(World par1World, int par2, int par3, int par4, Random par5Random, int height) { - Block palmTreeLeavesID = BlockList.palmTreeLeaves.get(); - - // TODO: Add more Leave Spawn Templates - if (height + 1 >= 7) { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 4, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 3, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 3, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 3, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 3, palmTreeLeavesID); - - } else { - par1World.setBlock(par2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 - 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2 + 1, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3, par4, palmTreeLeavesID); - par1World.setBlock(par2 + 2, par3 - 1, par4, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 - 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 - 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 - 2, palmTreeLeavesID); - - par1World.setBlock(par2, par3, par4 + 1, palmTreeLeavesID); - par1World.setBlock(par2, par3, par4 + 2, palmTreeLeavesID); - par1World.setBlock(par2, par3 - 1, par4 + 2, palmTreeLeavesID); - } - - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); - if (itemstack != null && itemstack.getItem() == Items.dye) { - if (itemstack.getItemDamage() == 15) { - growTree(par1World, par2, par3, par4, par1World.rand); - if (!par5EntityPlayer.capabilities.isCreativeMode) { - itemstack.stackSize--; - } - } - } - super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - return true; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.sand || block == Blocks.dirt || block == Blocks.grass; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/800cb32a5f2300141615d74fdd8749f5 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/800cb32a5f2300141615d74fdd8749f5 deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/800cb32a5f2300141615d74fdd8749f5 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/a09ce5e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/a09ce5e3c42100141fce95f06aba7e85 deleted file mode 100644 index c28ec15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/a09ce5e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b093e1e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b093e1e5c42100141fce95f06aba7e85 deleted file mode 100644 index 6c4a496..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b093e1e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,82 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.DamageSource; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import net.minecraftforge.event.entity.living.LivingHurtEvent; -import projectzulu.common.api.PotionList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class PotionEventHookContainerClass { - - @SubscribeEvent - public void EntitySelfCleansingPotion(LivingUpdateEvent event) { - /* If Cleansing is Disabled, do Not Continue. */ - if (!PotionList.cleansing.isPresent()) { - return; - } - PotionEffect cleansingPotionEffect = event.entityLiving.getActivePotionEffect(PotionList.cleansing.get()); - if (cleansingPotionEffect != null - && Potion.potionTypes[cleansingPotionEffect.getPotionID()].isReady(cleansingPotionEffect.getDuration(), - cleansingPotionEffect.getAmplifier())) { - - /* Get Active Potion effect Collection from Entity */ - @SuppressWarnings("unchecked") - Collection potionEffects = event.entityLiving.getActivePotionEffects(); - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - - /* Check if we Should Try to Erase a buff, proportional to Potion Strength */ - if ((cleansingPotionEffect.getAmplifier() + 1) * (100 - 10) / 10 + 10 - - event.entityLiving.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToErase = numOfElemenents > 0 ? event.entityLiving.worldObj.rand.nextInt(numOfElemenents) - : 0; - /** - * Iteratate Through Potioneffects, keeping Track of our index, If Index is equal to Effect (and is NOT - * Cleanse): Remove it - */ - Iterator iterator = potionEffects.iterator(); - PotionEffect potionEffectToRemove = null; - boolean removeEffect = false; - for (int i = 0; iterator.hasNext(); i++) { - potionEffectToRemove = iterator.next(); - if (i == elementToErase && !event.entityLiving.worldObj.isRemote) { - if (potionEffectToRemove != null - && potionEffectToRemove.getPotionID() != cleansingPotionEffect.getPotionID()) { - removeEffect = true; - } - break; - } - } - - if (removeEffect) { - event.entityLiving.removePotionEffect(potionEffectToRemove.getPotionID()); - } - } - } - } - - @SubscribeEvent - public void cactusArmorDamage(LivingHurtEvent event) { - PotionEffect thornsEffect = PotionList.thorn.isPresent() ? event.entityLiving - .getActivePotionEffect(PotionList.thorn.get()) : null; - - if (thornsEffect != null) { - EntityLivingBase hurtEntity = event.entityLiving; - Entity attackingEntity = event.source.getSourceOfDamage(); - if (hurtEntity != null && attackingEntity != null && event.source.getDamageType() != null - && !event.source.getDamageType().equals("thorns")) { - attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), event.ammount - * (thornsEffect.getAmplifier() + 1) / 5); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b0c0b8f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b0c0b8f5c42100141fce95f06aba7e85 deleted file mode 100644 index 44f2163..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/b0c0b8f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/d09f7e9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/d09f7e9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 255c580..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/d09f7e9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/d195509fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/d195509fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f342ebb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e1/d195509fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,326 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; - -public class ModelOstrich extends ModelBase { - ModelRenderer tail1; - ModelRenderer tail3; - ModelRenderer tail2; - ModelRenderer tail4; - ModelRenderer BODYROT; - ModelRenderer WINGLEFROT; - ModelRenderer WINGRIGROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEGTOPROT1; - private ModelRenderer LEGBOTROT1; - private ModelRenderer FOOTROT1; - private ModelRenderer TOE12ROT; - private ModelRenderer TOE13ROT; - private ModelRenderer TOE11ROT; - private ModelRenderer LEGTOPROT2; - private ModelRenderer LEGBOTROT2; - private ModelRenderer FOOTROT2; - private ModelRenderer TOE22ROT; - private ModelRenderer TOE23ROT; - private ModelRenderer TOE21ROT; - - public ModelOstrich() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body1", 12, 38); - setTextureOffset("BODYROT.body2", 12, 30); - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK2ROT.neck2", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - setTextureOffset("LEGTOPROT1.legtop1", 0, 42); - setTextureOffset("LEGBOTROT1.legbot1", 0, 51); - setTextureOffset("TOE12ROT.toe12", 0, 61); - setTextureOffset("TOE13ROT.toe13", 6, 61); - setTextureOffset("TOE11ROT.toe11", 0, 61); - setTextureOffset("LEGTOPROT2.legtop2", 0, 42); - setTextureOffset("LEGBOTROT2.legbot2", 0, 51); - setTextureOffset("TOE22ROT.toe22", 0, 61); - setTextureOffset("TOE23ROT.toe23", 6, 61); - setTextureOffset("TOE21ROT.toe21", 0, 61); - setTextureOffset("WINGLEFROT.winglef", 32, 14); - setTextureOffset("WINGRIGROT.wingrig", 32, 14); - - tail1 = new ModelRenderer(this, 12, 8); - tail1.addBox(-5F, -5F, 0F, 10, 5, 0); - tail1.setRotationPoint(-4F, 2F, 10F); - tail1.setTextureSize(64, 32); - tail1.mirror = true; - setRotation(tail1, -0.1487144F, 1.041001F, 0.4461433F); - tail3 = new ModelRenderer(this, 12, 19); - tail3.addBox(-5F, -5F, 0F, 10, 5, 0); - tail3.setRotationPoint(-3F, 8F, 10F); - tail3.setTextureSize(64, 32); - tail3.mirror = true; - setRotation(tail3, 0.2059489F, 1.343904F, 0.1919862F); - tail2 = new ModelRenderer(this, 12, 3); - tail2.addBox(-5F, -5F, 0F, 10, 5, 0); - tail2.setRotationPoint(4F, 2F, 10F); - tail2.setTextureSize(64, 32); - tail2.mirror = true; - setRotation(tail2, -0.1487144F, -1.041001F, -0.6320364F); - tail4 = new ModelRenderer(this, 12, 14); - tail4.addBox(-5F, -5F, 0F, 10, 5, 0); - tail4.setRotationPoint(3F, 8F, 10F); - tail4.setTextureSize(64, 32); - tail4.mirror = true; - setRotation(tail4, 0.2234021F, -1.343904F, -0.1919862F); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 4F, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body1", -5F, -5F, 0F, 10, 10, 16); - BODYROT.addBox("body2", -3F, -4F, -2F, 6, 6, 2); - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - LEGTOPROT1 = new ModelRenderer(this, "LEGTOPROT1"); - LEGTOPROT1.setRotationPoint(-4F, 5F, 9F); - setRotation(LEGTOPROT1, 0F, 0F, 0F); - LEGTOPROT1.mirror = true; - LEGTOPROT1.addBox("legtop1", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT1 = new ModelRenderer(this, "LEGBOTROT1"); - LEGBOTROT1.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT1, 0F, 0F, 0F); - LEGBOTROT1.mirror = true; - LEGBOTROT1.addBox("legbot1", -1F, 0F, -1F, 2, 8, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - TOE12ROT = new ModelRenderer(this, "TOE12ROT"); - TOE12ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE12ROT, 0F, 0F, 0F); - TOE12ROT.mirror = true; - TOE12ROT.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE12ROT); - TOE13ROT = new ModelRenderer(this, "TOE13ROT"); - TOE13ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE13ROT, 0F, 0F, 0F); - TOE13ROT.mirror = true; - TOE13ROT.addBox("toe13", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT1.addChild(TOE13ROT); - TOE11ROT = new ModelRenderer(this, "TOE11ROT"); - TOE11ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE11ROT, 0F, 0F, 0F); - TOE11ROT.mirror = true; - TOE11ROT.addBox("toe11", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addChild(TOE11ROT); - LEGBOTROT1.addChild(FOOTROT1); - LEGTOPROT1.addChild(LEGBOTROT1); - BODYROT.addChild(LEGTOPROT1); - LEGTOPROT2 = new ModelRenderer(this, "LEGTOPROT2"); - LEGTOPROT2.setRotationPoint(4F, 5F, 9F); - setRotation(LEGTOPROT2, 0F, 0F, 0F); - LEGTOPROT2.mirror = true; - LEGTOPROT2.addBox("legtop2", -1F, 0F, -1F, 2, 7, 2); - LEGBOTROT2 = new ModelRenderer(this, "LEGBOTROT2"); - LEGBOTROT2.setRotationPoint(0F, 7F, 0F); - setRotation(LEGBOTROT2, 0F, 0F, 0F); - LEGBOTROT2.mirror = true; - LEGBOTROT2.addBox("legbot2", -1F, 0F, -1F, 2, 8, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 7.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - TOE22ROT = new ModelRenderer(this, "TOE22ROT"); - TOE22ROT.setRotationPoint(-0.5F, 0F, -1F); - setRotation(TOE22ROT, 0F, 0F, 0F); - TOE22ROT.mirror = true; - TOE22ROT.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE22ROT); - TOE23ROT = new ModelRenderer(this, "TOE23ROT"); - TOE23ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TOE23ROT, 0F, 0F, 0F); - TOE23ROT.mirror = true; - TOE23ROT.addBox("toe23", -0.5F, -0.5F, 0F, 1, 1, 2); - FOOTROT2.addChild(TOE23ROT); - TOE21ROT = new ModelRenderer(this, "TOE21ROT"); - TOE21ROT.setRotationPoint(0.5F, 0F, -1F); - setRotation(TOE21ROT, 0F, 0F, 0F); - TOE21ROT.mirror = true; - TOE21ROT.addBox("toe21", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addChild(TOE21ROT); - LEGBOTROT2.addChild(FOOTROT2); - LEGTOPROT2.addChild(LEGBOTROT2); - BODYROT.addChild(LEGTOPROT2); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-5F, 4.5F, -7F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, -5F, 0F, 1, 9, 15); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(5F, 4.5F, -7F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, -5F, 0F, 1, 9, 15); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - GL11.glPopMatrix(); - } else { - tail1.render(f5); - tail3.render(f5); - tail2.render(f5); - tail4.render(f5); - BODYROT.render(f5); - WINGLEFROT.render(f5); - WINGRIGROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TOE22ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE21ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - TOE12ROT.rotateAngleY = (float) (45 * Math.PI / 180); - TOE11ROT.rotateAngleY = (float) (-45 * Math.PI / 180); - - float angle = par2 * 0.6625F * 2f; - NECK1ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(0)) * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) ((-22.5 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) ((-5.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180 * 1.2 * par3); - NECK8ROT.rotateAngleX = (float) ((-1.0 + MathHelper.cos(angle) + 1) * Math.PI / 180); - - WINGLEFROT.rotateAngleY = (float) (-45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - WINGRIGROT.rotateAngleY = (float) (+45.5 * Math.abs(MathHelper.cos(par2 * 0.6625f * 2f)) * Math.PI / 180); - - LEGTOPROT1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT1.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2 + (float) Math.PI / 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGTOPROT2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F / 2) * 2.4F * ModelHelper.abs(Math - .log(par3 + 1))); - LEGBOTROT2.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 * 2) * 2.4F - * ModelHelper.abs(Math.log(par3 + 1))); - - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - float angle = f1 * 0.6625F * 2f; - HEADROT.rotateAngleX = (float) ((+105 + MathHelper.cos(angle)) * Math.PI / 180) - + Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/1043699ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/1043699ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 86de767..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/1043699ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.dungeon; - -public enum ButtonIDs { - NEWENTRY(-1), SAVENCLOSE(-2), DELENTRY(-6), CANCEL(-3), FORWARD(-4), BACKWARDS(-5); - - int index; - - ButtonIDs(int index) { - this.index = index; - } - - public static ButtonIDs getButtonByIndex(int index) { - for (ButtonIDs buttonID : ButtonIDs.values()) { - if (buttonID.index == index) { - return buttonID; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/105ccd9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/105ccd9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f69063e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/105ccd9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,143 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -/** - * Contains Breeding Specific Code. Toggled on by returning true from isValidBreedingItem() function - */ -public abstract class EntityGenericBreedable extends EntityGenericAgeable{ - - protected int loveTimer = 0; - public boolean isInLove(){return loveTimer > 0 ? true: false;} - public void resetInLove(){ loveTimer = 0; } - - /* How long an Entity should be in Love Mode when Fed */ - protected int loveCooldown = 600; - - public EntityGenericBreedable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - /* Breeding is all Done Server Side, and only while growingAge is 0 - * Thus on Client, we know that if growage is not 0 we are not breeding / in love anymore*/ - if (this.getGrowingAge() != 0) { - this.loveTimer = 0; - } - - /* Decrement loveTimer for the purpose of hearts */ - if(getEntityState() == EntityStates.inLove){ - loveTimer--; - if(loveTimer % 10 == 0){ - String var1 = "heart"; - double var2 = this.rand.nextGaussian() * 0.02D; - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle(var1, - this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, - this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), - this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); - } - } - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding - * This is overriden by each Entity if deviations from default are desired - */ - public boolean isValidBreedingItem(ItemStack itemStack){ - return false; - } - - @Override - public boolean interact(EntityPlayer par1EntityPlayer) { - ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - - if (var2 != null && this.isValidBreedingItem(var2) && this.getGrowingAge() == 0) { - if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - - if (var2.stackSize <= 0) { - par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - - this.loveTimer = loveCooldown; - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = this.rand.nextGaussian() * 0.02D; - double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = this.rand.nextGaussian() * 0.02D; - this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } - - return true; - } - else { - return super.interact(par1EntityPlayer); - } - } - - /** - * Returns true if the mob is currently able to mate with the specified mob. - */ - public boolean canMateWith(EntityGenericBreedable targetEntity){ - /* If Passed Entity is Self or Different Type, return False */ - if(targetEntity == this || targetEntity.getClass() != this.getClass()){ - return false; - } - /* Otherwise, if Target is in Love, and Self is. Then let them mate */ - if(this.isInLove() && targetEntity.isInLove()){ - return true; - } - - return false; - } - - /** - * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal of their Type. - */ - public EntityGenericBreedable getBabyAnimalEntity(Entity par1EntityAnimal) { - Object object = null; - try { - Class thisClass = par1EntityAnimal.getClass(); - Constructor ctor= thisClass.getConstructor(World.class); - try { - object = ctor.newInstance(new Object[] { this.worldObj }); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (IllegalArgumentException e) { - e.printStackTrace(); - } catch (InvocationTargetException e) { - e.printStackTrace(); - } - } catch (NoSuchMethodException e) { - e.printStackTrace(); - } catch (SecurityException e) { - e.printStackTrace(); - } - return (EntityGenericBreedable) object; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/40bd74e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/40bd74e4c42100141fce95f06aba7e85 deleted file mode 100644 index 5a1797e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/40bd74e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,297 +0,0 @@ -package projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/40c4ea9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/40c4ea9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e5acb66..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/40c4ea9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutShell; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/5009718cc6ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/5009718cc6ab00141ee9bf3050c1025b new file mode 100644 index 0000000..59325f7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/5009718cc6ab00141ee9bf3050c1025b @@ -0,0 +1,130 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.Random; + +import net.minecraft.entity.EntityList; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + + +public class EntityBeetleBS extends EntityGenericAnimal implements IAnimals { + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + + public EntityBeetleBS(World par1World) { + super(par1World); + this.setSize(0.35f, 0.35f); + this.setPosition(this.posX, this.posY, this.posZ); + + Random rand1 = new Random(); + this.textureID = rand1.nextInt(3); + + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIWander(this, 1.0f, 120)); + + /* Attack On Collide Declared in SubClass */ + tasks.addTask(5, new EntityAIMate(this, 1.0f)); + tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.potato, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0f)); + + //targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); + //targetTasks.addTask(4, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityPlayer.class, 16.0F, 0, true)); + // targetTasks.addTask(5, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlelivingsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlehurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.potato); + } + + if (this.ticksExisted > 10000){ + //this.despawnEntity(); + this.setDead(); + } + } + + @Override + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 0; + } + + @Override + protected void updateAITick() { + super.updateAITick(); + } + + /** + * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each + * Entity if deviations from default are desired + */ + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null + && (itemStack.getItem() == Items.potato)) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + } else { + return super.isValidBreedingItem(itemStack); + } + } +} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/6049d5f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/6049d5f5c42100141fce95f06aba7e85 deleted file mode 100644 index de05098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/6049d5f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,360 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -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; - -public class EntityLizardSpit extends Entity -{ - private int xTile = -1; - private int yTile = -1; - private int zTile = -1; - private Block inTile; - private boolean inGround = false; - public EntityLivingBase shootingEntity; - private int ticksAlive; - private int ticksInAir = 0; - public double accelerationX; - public double accelerationY; - public double accelerationZ; - - public EntityLizardSpit(World par1World) - { - super(par1World); - this.setSize(1.0F, 1.0F); - } - - protected void entityInit() {} - - /** - * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge - * length * 64 * renderDistanceWeight Args: distance - */ - @Override - public boolean isInRangeToRenderDist(double par1) - { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; - return par1 < var3 * var3; - } - - public EntityLizardSpit(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) - { - super(par1World); - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); - this.setPosition(par2, par4, par6); - double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); - this.accelerationX = par8 / var14 * 0.1D; - this.accelerationY = par10 / var14 * 0.1D; - this.accelerationZ = par12 / var14 * 0.1D; - } - - public EntityLizardSpit(World par1World, EntityLivingBase par2EntityLiving, double par3, double par5, double par7) - { - super(par1World); - this.shootingEntity = par2EntityLiving; - this.setSize(1.0F, 1.0F); - this.setLocationAndAngles(par2EntityLiving.posX, par2EntityLiving.posY, par2EntityLiving.posZ, par2EntityLiving.rotationYaw, par2EntityLiving.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; - par3 += this.rand.nextGaussian() * 0.4D; - par5 += this.rand.nextGaussian() * 0.4D; - par7 += this.rand.nextGaussian() * 0.4D; - double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); - this.accelerationX = par3 / var9 * 0.1D; - this.accelerationY = par5 / var9 * 0.1D; - this.accelerationZ = par7 / var9 * 0.1D; - } - - /** - * Called to update the entity's position/logic. - */ - @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(); -// this.setFire(1); - - if (this.inGround) - { - if (this.worldObj.getBlock(this.xTile, this.yTile, this.zTile) == this.inTile) - { - ++this.ticksAlive; - - if (this.ticksAlive == 600) - { - this.setDead(); - } - - return; - } - - this.inGround = false; - this.motionX *= (double)(this.rand.nextFloat() * 0.2F); - this.motionY *= (double)(this.rand.nextFloat() * 0.2F); - this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } - else - { - ++this.ticksInAir; - } - - //Vec3 vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - //Vec3 vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - Vec3 vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - MovingObjectPosition movingobjectposition = this.worldObj.rayTraceBlocks(vec3, vec31); - - //vec3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - vec3 = Vec3.createVectorHelper((double)this.posX, (double)this.posY, (double)this.posZ); - - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); - vec31 = Vec3.createVectorHelper((double)this.posX + this.motionX, (double)this.posY + this.motionY, (double)this.posZ + this.motionZ); - - if (movingobjectposition != null) - { - //vec31 = this.worldObj.getWorldVec3Pool().getVecFromPool(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord); - vec31 = Vec3.createVectorHelper((double)movingobjectposition.hitVec.xCoord, (double)movingobjectposition.hitVec.yCoord, (double)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 i = 0; i < list.size(); ++i) - { - Entity entity1 = (Entity)list.get(i); - - if (entity1.canBeCollidedWith() && (!entity1.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) - { - float f = 0.3F; - AxisAlignedBB axisalignedbb = entity1.boundingBox.expand((double)f, (double)f, (double)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 f1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - - for (this.rotationPitch = (float)(Math.atan2((double)f1, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) - { - ; - } - - while (this.rotationPitch - this.prevRotationPitch >= 180.0F) - { - this.prevRotationPitch += 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw < -180.0F) - { - this.prevRotationYaw -= 360.0F; - } - - while (this.rotationYaw - this.prevRotationYaw >= 180.0F) - { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float f2 = 0.95f; - - if (this.isInWater()) - { - for (int j = 0; j < 4; ++j) - { - float f3 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); - } - - f2 = 0.8F; - } - - this.motionX += this.accelerationX; - this.motionY += this.accelerationY; - this.motionZ += this.accelerationZ; - this.motionX *= (double)f2; - this.motionY *= (double)f2; - this.motionZ *= (double)f2; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); - } - } - - /** - * Called when this EntityFireball hits a block or entity. - */ - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) - { - if (!this.worldObj.isRemote) - { - if (par1MovingObjectPosition.entityHit != null) - { - //par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), 6); - - if(par1MovingObjectPosition.entityHit instanceof EntityLivingBase){ - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); - } - } - - //this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setShort("xTile", (short)this.xTile); - par1NBTTagCompound.setShort("yTile", (short)this.yTile); - par1NBTTagCompound.setShort("zTile", (short)this.zTile); - par1NBTTagCompound.setByte("inTile", (byte)Block.getIdFromBlock(this.inTile)); - par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - this.xTile = par1NBTTagCompound.getShort("xTile"); - this.yTile = par1NBTTagCompound.getShort("yTile"); - this.zTile = par1NBTTagCompound.getShort("zTile"); - this.inTile = Block.getBlockById(par1NBTTagCompound.getByte("inTile") & 255); - this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - - if (par1NBTTagCompound.hasKey("direction")) - { - NBTTagList var2 = par1NBTTagCompound.getTagList("direction", 6); - this.motionX = var2.func_150309_d(0); - this.motionY = var2.func_150309_d(1); - this.motionZ = var2.func_150309_d(2); - } - else - { - this.setDead(); - } - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() - { - return true; - } - @Override - public float getCollisionBorderSize() - { - return 1.0F; - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) - { - this.setBeenAttacked(); - - if (par1DamageSource.getEntity() != null) - { - Vec3 var3 = par1DamageSource.getEntity().getLookVec(); - - if (var3 != null) - { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; - this.accelerationX = this.motionX * 0.1D; - this.accelerationY = this.motionY * 0.1D; - this.accelerationZ = this.motionZ * 0.1D; - } - - if (par1DamageSource.getEntity() instanceof EntityLivingBase) - { - this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; - } - else - { - return false; - } - } - @Override - public float getShadowSize() - { - return 0.0F; - } - - /** - * Gets how bright this entity is. - */ - @Override - public float getBrightness(float par1) - { - return 1.0F; - } - - @Override - public int getBrightnessForRender(float par1) - { - return 15728880; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/804b9ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/804b9ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ea2c846..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/804b9ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,151 +0,0 @@ -package projectzulu.common.blocks.universalpot; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityUniversalFlowerPot extends TileEntity implements IInventory { - - private ItemStack[] inventory; - - public TileEntityUniversalFlowerPot() { - inventory = new ItemStack[1]; - } - - @Override - public int getSizeInventory() { - return inventory.length; - } - - @Override - public ItemStack getStackInSlot(int slot) { - return inventory[slot]; - } - - @Override - public void setInventorySlotContents(int slot, ItemStack stack) { - inventory[slot] = stack; - if (stack != null && stack.stackSize > getInventoryStackLimit()) { - stack.stackSize = getInventoryStackLimit(); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tagCompound = pkt.func_148857_g(); - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public ItemStack decrStackSize(int slot, int amt) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - if (stack.stackSize <= amt) { - setInventorySlotContents(slot, null); - } else { - stack = stack.splitStack(amt); - if (stack.stackSize == 0) { - setInventorySlotContents(slot, null); - } - } - } - return stack; - } - - @Override - public ItemStack getStackInSlotOnClosing(int slot) { - ItemStack stack = getStackInSlot(slot); - if (stack != null) { - setInventorySlotContents(slot, null); - } - return stack; - } - - @Override - public int getInventoryStackLimit() { - return 1; - } - - @Override - public boolean isUseableByPlayer(EntityPlayer player) { - return worldObj.getTileEntity(xCoord, yCoord, zCoord) == this - && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64; - } - - @Override - public void openInventory() { - } - - @Override - public void closeInventory() { - } - - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - super.readFromNBT(tagCompound); - - NBTTagList tagList = tagCompound.getTagList("Inventory", 10); - for (int i = 0; i < tagList.tagCount(); i++) { - NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); - byte slot = tag.getByte("Slot"); - if (slot >= 0 && slot < inventory.length) { - inventory[slot] = ItemStack.loadItemStackFromNBT(tag); - } - } - } - - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - - NBTTagList itemList = new NBTTagList(); - for (int i = 0; i < inventory.length; i++) { - ItemStack stack = inventory[i]; - if (stack != null) { - NBTTagCompound tag = new NBTTagCompound(); - tag.setByte("Slot", (byte) i); - stack.writeToNBT(tag); - itemList.appendTag(tag); - } - } - tagCompound.setTag("Inventory", itemList); - } - - @Override - public String getInventoryName() { - return null; - } - - @Override - public boolean hasCustomInventoryName() { - return false; - } - - @Override - public boolean isItemValidForSlot(int i, ItemStack itemstack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/8065f6e3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/8065f6e3c42100141fce95f06aba7e85 deleted file mode 100644 index d1a94b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/8065f6e3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,260 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.init.Blocks; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockJasper extends Block { - boolean prepareToSummonBoss = false; - int counter = 0; - int alterIncrement = 0; - - Vec3[] alterBlockLocations = new Vec3[30]; - - public BlockJasper() { - super(Material.rock); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0f); - setResistance(1.0f); - initialiseAlterBlocks(); - } - - public void initialiseAlterBlocks() { - // All Blocks are relative to BlockJasper Location - // Bottom Of Alter - alterBlockLocations[0] = Vec3.createVectorHelper(2, 0, -1); - alterBlockLocations[1] = Vec3.createVectorHelper(2, 0, 0); - alterBlockLocations[2] = Vec3.createVectorHelper(2, 0, 1); - - alterBlockLocations[3] = Vec3.createVectorHelper(1, 0, -2); - alterBlockLocations[4] = Vec3.createVectorHelper(1, 0, -1); - alterBlockLocations[5] = Vec3.createVectorHelper(1, 0, 0); - alterBlockLocations[6] = Vec3.createVectorHelper(1, 0, 1); - alterBlockLocations[7] = Vec3.createVectorHelper(1, 0, 2); - - alterBlockLocations[8] = Vec3.createVectorHelper(0, 0, -2); - alterBlockLocations[9] = Vec3.createVectorHelper(0, 0, -1); - alterBlockLocations[10] = Vec3.createVectorHelper(0, 0, 1); - alterBlockLocations[11] = Vec3.createVectorHelper(0, 0, 2); - - alterBlockLocations[12] = Vec3.createVectorHelper(-1, 0, -2); - alterBlockLocations[13] = Vec3.createVectorHelper(-1, 0, -1); - alterBlockLocations[14] = Vec3.createVectorHelper(-1, 0, 0); - alterBlockLocations[15] = Vec3.createVectorHelper(-1, 0, 1); - alterBlockLocations[16] = Vec3.createVectorHelper(-1, 0, 2); - - alterBlockLocations[17] = Vec3.createVectorHelper(-2, 0, -1); - alterBlockLocations[18] = Vec3.createVectorHelper(-2, 0, 0); - alterBlockLocations[19] = Vec3.createVectorHelper(-2, 0, 1); - - // FirstLevel - alterBlockLocations[20] = Vec3.createVectorHelper(1, 1, -1); - alterBlockLocations[21] = Vec3.createVectorHelper(1, 1, 0); - alterBlockLocations[22] = Vec3.createVectorHelper(1, 1, 1); - - alterBlockLocations[23] = Vec3.createVectorHelper(0, 1, -1); - alterBlockLocations[24] = Vec3.createVectorHelper(0, 1, 0); - alterBlockLocations[25] = Vec3.createVectorHelper(0, 1, 1); - - alterBlockLocations[26] = Vec3.createVectorHelper(-1, 1, -1); - alterBlockLocations[27] = Vec3.createVectorHelper(-1, 1, 0); - alterBlockLocations[28] = Vec3.createVectorHelper(-1, 1, 1); - // Second Level - alterBlockLocations[29] = Vec3.createVectorHelper(0, 2, 0); - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * Called whenever the block is added into the world. Args: world, x, y, z - */ - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - - counter = 0; - super.onBlockAdded(par1World, par2, par3, par4); - Vec3[] blocksToCheck; - blocksToCheck = new Vec3[13]; - int countValidTorches = 0; - - // Check Southern Configuration - blocksToCheck[0] = Vec3.createVectorHelper(par2 + 1, par3, par4); - blocksToCheck[1] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 1); - blocksToCheck[2] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 1); - blocksToCheck[3] = Vec3.createVectorHelper(par2, par3, par4 - 1); - blocksToCheck[4] = Vec3.createVectorHelper(par2, par3, par4 + 1); - blocksToCheck[5] = Vec3.createVectorHelper(par2 - 1, par3, par4); - blocksToCheck[6] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 1); - blocksToCheck[7] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 1); - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 - 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 - 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 - 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 - 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Northern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2 + 2, par3, par4); - blocksToCheck[9] = Vec3.createVectorHelper(par2 + 3, par3, par4); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 3, par3, par4 + 1); - blocksToCheck[11] = Vec3.createVectorHelper(par2 + 3, par3, par4 - 1); - blocksToCheck[12] = Vec3.createVectorHelper(par2 + 4, par3, par4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Western Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 + 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 + 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 + 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 + 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 + 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - // Check Eastern Configuration - blocksToCheck[8] = Vec3.createVectorHelper(par2, par3, par4 - 2); - blocksToCheck[9] = Vec3.createVectorHelper(par2, par3, par4 - 3); - blocksToCheck[10] = Vec3.createVectorHelper(par2 + 1, par3, par4 - 3); - blocksToCheck[11] = Vec3.createVectorHelper(par2 - 1, par3, par4 - 3); - blocksToCheck[12] = Vec3.createVectorHelper(par2, par3, par4 - 4); - - for (int i = 0; i < blocksToCheck.length; i++) { - - if (par1World.getBlock((int) blocksToCheck[i].xCoord, (int) blocksToCheck[i].yCoord, - (int) blocksToCheck[i].zCoord) == Blocks.torch) { - countValidTorches += 1; - } - } - if (countValidTorches < 13) { - countValidTorches = 0; - } - - if (countValidTorches >= 13 && par1World.canBlockSeeTheSky(par2, par3 + 1, par4) - && CustomEntityList.MUMMYPHARAOH.modData.isPresent()) { - - if (!MinecraftServer.getServer().isDedicatedServer()) { - Minecraft.getMinecraft().theWorld.playRecord(DefaultProps.coreDiretory + ":misc.summonwhispers", par2, - par3, par4); - } - - // if( !MinecraftServer.getServer().isDedicatedServer() ){ - // //theMinecraft.theWorld.setWorldTime(13000); - // Minecraft theMinecraft = Minecraft.getMinecraft(); - // theMinecraft.theWorld.playSound(par2, par3, par4, "sounds.summonwhispers", 10.0f, 1.0f); - // } - // Play Summon Sound - // Set Time to Night - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - prepareToSummonBoss = true; - } else { - this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air, 0, 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @SideOnly(Side.CLIENT) - public void playWhispersSound() { - - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (prepareToSummonBoss == false) { - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - if (MathHelper.floor_double(counter / 20) >= 5 && MathHelper.floor_double(counter / 20) < 35) { - buildAlter(par1World, par2, par3, par4, par5Random, MathHelper.floor_double(counter / 20) - 5); - } - - if (counter < 40 * 20 && par1World != null) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 1); - counter++; - } else { - if (!MinecraftServer.getServer().isDedicatedServer()) { - // World worldObj = ModLoader.getMinecraftInstance().theWorld; - Minecraft.getMinecraft().theWorld.playSound(par2, par3, par4, "sounds.mummyroar", 10.0f, 1.0f, false); - } - - EntityMummyPharaoh var17 = new EntityMummyPharaoh(par1World, par2, par3 + 3, par4); - par1World.spawnEntityInWorld(var17); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - public void buildAlter(World par1World, int par2, int par3, int par4, Random par5Random, int iterator) { - int alterX = MathHelper.floor_double(alterBlockLocations[iterator].xCoord); - int alterY = MathHelper.floor_double(alterBlockLocations[iterator].yCoord); - int alterZ = MathHelper.floor_double(alterBlockLocations[iterator].zCoord); - par1World.setBlock(alterX + par2, alterY + par3, alterZ + par4, Blocks.sandstone); - } - - // /** - // * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z - // */ - // public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) - // { - // int var5 = par1World.getBlockId(par2, par3, par4); - // return (var5 == 0 || Block.blocksList[var5].blockMaterial.isGroundCover()) && - // par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - // } - - // /** - // * Called when the block is placed in the world. - // */ - // public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLiving par5EntityLiving) - // { - // int var6 = MathHelper.floor_double((double)(par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; - // par1World.setBlockMetadataWith_Notify(par2, par3, par4, var6); - // } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/c0e20ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/c0e20ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 33368cc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/c0e20ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBlackBear extends EntityBear { - - public EntityBlackBear(World par1World) { - super(par1World); - setSize(1.0f, 1.35f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 2; - } - - @Override - public void onUpdate() { - super.onUpdate(); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 3), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/e05f0400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/e05f0400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 290fe25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/e05f0400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,120 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import java.util.ArrayList; -import java.util.HashSet; - -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.registry.EntityRegistry; - -public abstract class SpawnableDeclaration extends EggableDeclaration { - - protected int spawnRate; - protected boolean useGlobalSpawn = false; - protected int secondarySpawnRate; - protected int minInChunk; - protected int maxInChunk; - protected EnumCreatureType spawnType; - - private ArrayList biomesToSpawn = new ArrayList(); - - protected SpawnableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - spawnType = creatureType; - } - - protected void setSpawnProperties(int spawnRate, int secondarySpawnRate, int minInChunk, int maxInChunk) { - this.spawnRate = spawnRate; - this.secondarySpawnRate = secondarySpawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - spawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SpawnRate", spawnRate).getInt( - spawnRate); - secondarySpawnRate = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " SecondarySpawnRate", - secondarySpawnRate).getInt(secondarySpawnRate); - minInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " minInChunk", minInChunk).getInt( - minInChunk); - maxInChunk = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " maxInChunk", maxInChunk).getInt( - maxInChunk); - maxSpawnInChunk = config.get("MOB CONTROLS." + mobName, "Max Pack Size", maxSpawnInChunk).getInt( - maxSpawnInChunk); - spawnType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, "Spawn List Type", spawnType); - useGlobalSpawn = config.get("MOB CONTROLS." + mobName, "Use Global Spawn Rates", useGlobalSpawn).getBoolean( - useGlobalSpawn); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - HashSet defaultBiomesToSpawn = getDefaultBiomesToSpawn(); - for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) { - if (BiomeGenBase.getBiomeGenArray()[i] == null) { - continue; - } - - boolean defaultShouldSpawn = defaultBiomesToSpawn.contains(BiomeGenBase.getBiomeGenArray()[i].biomeName); - SpawnEntry spawnEntry = ConfigHelper.configGetSpawnEntry(config, "Mob Spawn Biome Controls." + mobName, - BiomeGenBase.getBiomeGenArray()[i], defaultShouldSpawn, spawnRate, minInChunk, maxInChunk); - if (spawnEntry != null) { - biomesToSpawn.add(spawnEntry); - } - } - } - - public abstract HashSet getDefaultBiomesToSpawn(); - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - customMobData.secondarySpawnRate = secondarySpawnRate; - customMobData.spawnType = spawnType; - } - - @Override - public void addSpawn() { - if (spawnType == null) { - return; - } - - for (int i = 0; i < biomesToSpawn.size(); i++) { - if (useGlobalSpawn) { - if (spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, spawnRate, minInChunk, maxInChunk, spawnType, - biomesToSpawn.get(i).biome); - } - } else { - if (biomesToSpawn.get(i).spawnRate > 0) { - EntityRegistry.addSpawn(mobClass, biomesToSpawn.get(i).spawnRate, biomesToSpawn.get(i).minInChunk, - biomesToSpawn.get(i).maxInChunk, spawnType, biomesToSpawn.get(i).biome); - } - } - if (reportSpawningInLog) { - ProjectZuluLog.info("Registering %s to biome %s at rates of %s,%s,%s", mobClass.getSimpleName(), - biomesToSpawn.get(i).biome.biomeName, biomesToSpawn.get(i).spawnRate, - biomesToSpawn.get(i).minInChunk, biomesToSpawn.get(i).maxInChunk); - } - } - } - - protected HashSet typeToArray(BiomeDictionary.Type type) { - BiomeGenBase[] biomes = BiomeDictionary.getBiomesForType(type); - HashSet names = new HashSet(15); - for (BiomeGenBase biome : biomes) { - names.add(biome.biomeName); - } - return names; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f0f737f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f0f737f5c42100141fce95f06aba7e85 deleted file mode 100644 index 6aca324..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f0f737f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,872 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityPelican; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelPelican extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer NECK9ROT; - private ModelRenderer NECK10ROT; - - public ModelPelican() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 20); - setTextureOffset("BODYROT.headfrill", 0, 14); - setTextureOffset("BODYROT.tailfrill", 0, 3); - setTextureOffset("BODYROT.tailfrill2", 0, 8); - setTextureOffset("TAILBASEROT.tailbase2", 8, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 5); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 5); - setTextureOffset("NECK1ROT.neck1", 41, 0); - setTextureOffset("NECK2ROT.neck2", 37, 4); - setTextureOffset("NECK3ROT.neck3", 38, 4); - setTextureOffset("NECK4ROT.neck4", 39, 4); - setTextureOffset("NECK5ROT.neck5", 40, 4); - setTextureOffset("NECK6ROT.neck6", 37, 4); - setTextureOffset("NECK7ROT.neck7", 38, 4); - setTextureOffset("NECK8ROT.neck8", 39, 4); - setTextureOffset("NECK9ROT.neck9", 40, 4); - setTextureOffset("NECK10ROT.neck10", 37, 4); - setTextureOffset("HEADROT.head", 10, 12); - setTextureOffset("HEADROT.beaktop", 46, 8); - setTextureOffset("HEADROT.beakbot3", 56, 26); - setTextureOffset("HEADROT.beakbot1", 48, 15); - setTextureOffset("HEADROT.beakbot2", 52, 21); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 23, 6); - setTextureOffset("WINGLEFROT10.winglef10", 23, 14); - setTextureOffset("WINGLEFROT11.winglef11", 23, 6); - setTextureOffset("WINGLEFROT12.winglef12", 23, 14); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 23, 6); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 14); - setTextureOffset("WINGRIGROT11.wingrig11", 23, 6); - setTextureOffset("WINGRIGROT12.wingrig12", 23, 14); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 18F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -5F, -5.5F, 4, 5, 7); - BODYROT.addBox("headfrill", -2F, -5F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -5F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -5F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -3.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER5ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0.5235988F, 0F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, -0.5235988F, 0F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 6); - TAILBASEROT.addChild(TAILFEATHER4ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -3.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK9ROT = new ModelRenderer(this, "NECK9ROT"); - NECK9ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK9ROT, 0F, 0F, 0F); - NECK9ROT.mirror = true; - NECK9ROT.addBox("neck9", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK10ROT = new ModelRenderer(this, "NECK10ROT"); - NECK10ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK10ROT, 0F, 0F, 0F); - NECK10ROT.mirror = true; - NECK10ROT.addBox("neck10", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -1F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1.5F, -0.5F, -8F, 3, 1, 6); - HEADROT.addBox("beakbot3", -0.5F, 2.5F, -5F, 1, 1, 3); - HEADROT.addBox("beakbot1", -1.5F, 0.5F, -7F, 3, 1, 5); - HEADROT.addBox("beakbot2", -1F, 1.5F, -6F, 2, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HEADROT.addChild(HORN2ROT); - NECK10ROT.addChild(HEADROT); - NECK9ROT.addChild(NECK10ROT); - NECK8ROT.addChild(NECK9ROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -3.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -3.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, -1F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 0F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityPelican var5 = (EntityPelican) par1EntityLiving; - - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - NECK2ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-30 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+10 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+25 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - LEGLEFTOPROT.rotateAngleY = (float) (+0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * 2 * par3 * Math.PI / 180 - * MathHelper.sin(par2 * 0.6662F * 1.0f)); - FOOTLEF1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (+10 * Math.PI / 180 + 20 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (+20 * Math.PI / 180 + 10 * par3 * Math.PI / 180 - * MathHelper.sin((float) (par2 * 0.6662F * 1.0f + Math.PI))); - FOOTRIG1ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (0 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-0 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (+90 * Math.PI / 180); - WINGLEFROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGLEFROT3.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT4.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT5.rotateAngleZ = (float) (-25 * Math.PI / 180); - WINGLEFROT6.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT7.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-60 * Math.PI / 180); - WINGLEFROT8.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT10.rotateAngleZ = (float) (-0 * Math.PI / 180); - WINGLEFROT11.rotateAngleZ = (float) (-00 * Math.PI / 180); - WINGLEFROT12.rotateAngleZ = (float) (-0 * Math.PI / 180); - - WINGLEFROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGLEFROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGLEFROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGLEFROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-90 * Math.PI / 180); - WINGRIGROT2.rotateAngleZ = (float) (0 * Math.PI / 180); - WINGRIGROT3.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT4.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT5.rotateAngleZ = (float) (+25 * Math.PI / 180); - WINGRIGROT6.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT7.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+60 * Math.PI / 180); - WINGRIGROT8.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT10.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleZ = (float) (+0 * Math.PI / 180); - WINGRIGROT12.rotateAngleZ = (float) (+0 * Math.PI / 180); - - WINGRIGROT1.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT2.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT3.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT4.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT5.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT6.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT7.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT8.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT10.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT11.rotateAngleX = (float) (+5 * Math.PI / 180); - WINGRIGROT12.rotateAngleX = (float) (+5 * Math.PI / 180); - - WINGRIGROT1.rotateAngleY = (float) (-0 * Math.PI / 180); - WINGRIGROT5.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT8.rotateAngleY = (float) (+0 * Math.PI / 180); - WINGRIGROT11.rotateAngleY = (float) (+0 * Math.PI / 180); - - TAILFEATHER1ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - - } else { - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (+15 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (-15 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+0 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-20 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - NECK1ROT.rotateAngleX = (float) (-20 * Math.PI / 180); - NECK2ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK3ROT.rotateAngleX = (float) (-50 * Math.PI / 180); - NECK4ROT.rotateAngleX = (float) (-40 * Math.PI / 180); - NECK5ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK6ROT.rotateAngleX = (float) (+20 * Math.PI / 180); - NECK7ROT.rotateAngleX = (float) (+35 * Math.PI / 180); - NECK8ROT.rotateAngleX = (float) (+45 * Math.PI / 180); - NECK9ROT.rotateAngleX = (float) (+55 * Math.PI / 180); - NECK10ROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - /* Left Wing */ - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT2.rotateAngleZ = 0; - WINGLEFROT3.rotateAngleZ = 0; - WINGLEFROT4.rotateAngleZ = 0; - WINGLEFROT5.rotateAngleZ = 0; - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT7.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT8.rotateAngleZ = 0; - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleZ = 0; - WINGLEFROT12.rotateAngleZ = 0; - - WINGLEFROT1.rotateAngleX = 0; - WINGLEFROT2.rotateAngleX = 0; - WINGLEFROT3.rotateAngleX = 0; - WINGLEFROT4.rotateAngleX = 0; - WINGLEFROT5.rotateAngleX = 0; - WINGLEFROT6.rotateAngleX = 0; - WINGLEFROT7.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT8.rotateAngleX = 0; - WINGLEFROT10.rotateAngleX = 0; - WINGLEFROT11.rotateAngleX = 0; - WINGLEFROT12.rotateAngleX = 0; - - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - /* Right Wing */ - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT2.rotateAngleZ = 0; - WINGRIGROT3.rotateAngleZ = 0; - WINGRIGROT4.rotateAngleZ = 0; - WINGRIGROT5.rotateAngleZ = 0; - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT7.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT8.rotateAngleZ = 0; - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleZ = 0; - WINGRIGROT12.rotateAngleZ = 0; - - WINGRIGROT1.rotateAngleX = 0; - WINGRIGROT2.rotateAngleX = 0; - WINGRIGROT3.rotateAngleX = 0; - WINGRIGROT4.rotateAngleX = 0; - WINGRIGROT5.rotateAngleX = 0; - WINGRIGROT6.rotateAngleX = 0; - WINGRIGROT7.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT8.rotateAngleX = 0; - WINGRIGROT10.rotateAngleX = 0; - WINGRIGROT11.rotateAngleX = 0; - WINGRIGROT12.rotateAngleX = 0; - - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityPelican var5 = (EntityPelican) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -30), +30) * (float) (Math.PI / 180f); - if (var5.isEntityGrounded()) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180 - 10 * 2 * f1 * Math.PI / 180 - * MathHelper.sin(f * 0.6662F * 1.0f)) - + lookingDirX; - } else { - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+30 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f0f970a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f0f970a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6f198ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f0f970a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,22 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f12e6600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f12e6600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d369eb2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e2/f12e6600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,109 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserOpaqueBlock extends KeyParserBase { - - public KeyParserOpaqueBlock(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isOpaque = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isOpaqueCube(); - if (!isInverted && isOpaque || isInverted && !isOpaque) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/01f16ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/01f16ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 44c6f23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/01f16ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,160 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/225860a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/225860a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 456469b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/225860a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class ScrapMeatDeclaration extends ItemDeclaration { - - public ScrapMeatDeclaration() { - super("ScrapMeat"); - } - - @Override - protected boolean createItem() { - ItemList.scrapMeat = Optional.of(new ItemFoodProjectZulu(1, 1.0f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.scrapMeat.get(); - GameRegistry.registerItem(item, name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/317879e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/317879e4c42100141fce95f06aba7e85 deleted file mode 100644 index fbfa0a4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/317879e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class PalmTreeFeature extends BiomeFeature { - private int density = 3; - - public PalmTreeFeature() { - super("Palm Tree", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 10; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.beach.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.palmTreeSapling.get()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/40a410e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/40a410e4c42100141fce95f06aba7e85 deleted file mode 100644 index f5e9a65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/40a410e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBearHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBearHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 20F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/504805e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/504805e6c42100141fce95f06aba7e85 deleted file mode 100644 index 33a683a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/504805e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,237 +0,0 @@ -package projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import projectzulu.common.core.CreativePZGeneralTab; -import projectzulu.common.core.CreativePZPotionTab; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.EventHookContainerClass; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.PacketPipeline; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.ZuluGuiHandler; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.commands.CommandPlaceBlock; -import projectzulu.common.dungeon.commands.CommandPlaySound; -import projectzulu.common.dungeon.commands.CommandSpawnEntity; -import projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "projectzulu.common.ClientProxyProjectZulu", serverSide = "projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - packetPipeline = new PacketPipeline("ProjectZulu"); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline.initialise(event); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/6060cfe4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/6060cfe4c42100141fce95f06aba7e85 deleted file mode 100644 index a56da39..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/6060cfe4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short var1 = par0DataInputStream.readShort(); - - if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; - par0DataInputStream.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/60877cfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/60877cfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 24b9e76..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/60877cfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/61add6f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/61add6f9c42100141fce95f06aba7e85 deleted file mode 100644 index 442c918..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/61add6f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockTombstone extends BlockContainer { - - private Class signEntityClass; - - public BlockTombstone(Class par2Class) { - super(Material.rock); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - signEntityClass = par2Class; - - float var4 = 0.4F; - float var5 = 1.0F; - setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return -1; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - */ - @Override - public TileEntity createNewTileEntity(World par1World, int metadata) { - try { - return (TileEntity) this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase livingBase, - ItemStack par6ItemStack) { - int var6 = (Math.round(-livingBase.rotationYaw / 45f) + 4) & 7; - - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - - if (livingBase instanceof EntityPlayer) { - ((EntityPlayer) livingBase).openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - } - - super.onBlockPlacedBy(par1World, par2, par3, par4, livingBase, par6ItemStack); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - if (par5EntityPlayer instanceof EntityPlayer) { - if (par5EntityPlayer.inventory.getCurrentItem() == null) { - TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ((TileEntityTombstone) tileEntity).giveItemsToPlayer(par5EntityPlayer); - } - return true; - } else if (isValidItemForEditing(par5EntityPlayer.inventory.getCurrentItem().getItem())) { - par5EntityPlayer.openGui(ProjectZulu_Core.modInstance, 0, par1World, par2, par3, par4); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private boolean isValidItemForEditing(Item itemID) { - if (itemID == Items.wooden_pickaxe || itemID == Items.stone_pickaxe || itemID == Items.golden_pickaxe - || itemID == Items.iron_pickaxe || itemID == Items.diamond_pickaxe) { - return true; - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/709f3fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/709f3fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4d82ea9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/709f3fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionDamageBoost extends SubItemPotionHalfPower { - - public SubItemPotionDamageBoost(Item itemID, int subID) { - super(itemID, subID, "Strength"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.damageBoost); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.LargeUnhealthyHeart.meta) { - return TYPE.CHEMICAL; - } else if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.WEAKNESS.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.WEAKNESS.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/91ac5bf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/91ac5bf5c42100141fce95f06aba7e85 deleted file mode 100644 index 9c90ca6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/91ac5bf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,182 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityBear; -import com.ngb.projectzulu.common.mobs.entity.EntityBlackBear; -import com.ngb.projectzulu.common.mobs.entity.EntityBrownBear; - -public class ModelBear extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEG1ROT2; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT2; - private ModelRenderer LEG2ROT; - private ModelRenderer LEG3ROT2; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG4ROT2; - private ModelRenderer LEG4ROT; - private ModelRenderer TAILROT; - - public ModelBear(float heightToRaise) { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - setTextureOffset("BODYROT.body", 2, 0); - setTextureOffset("LEG1ROT2.leg1top", 0, 29); - setTextureOffset("LEG1ROT.leg1", 16, 29); - setTextureOffset("LEG2ROT2.leg2top", 0, 29); - setTextureOffset("LEG2ROT.leg2", 16, 29); - setTextureOffset("LEG3ROT2.leg3top", 0, 29); - setTextureOffset("LEG3ROT.leg3", 16, 29); - setTextureOffset("LEG4ROT2.leg4top", 0, 29); - setTextureOffset("LEG4ROT.leg4", 16, 29); - setTextureOffset("TAILROT.tail", 32, 29); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(1F, 9F - heightToRaise, -6F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 9F - heightToRaise, -7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -5F, 1F, 12, 12, 16); - LEG1ROT2 = new ModelRenderer(this, "LEG1ROT2"); - LEG1ROT2.setRotationPoint(-3F, 7F, 15F); - setRotation(LEG1ROT2, 0F, 0F, 0F); - LEG1ROT2.mirror = true; - LEG1ROT2.addBox("leg1top", -2F, 0F, -2F, 4, 3, 4); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("leg1", -2F, 0F, -2F, 4, 5, 4); - LEG1ROT2.addChild(LEG1ROT); - BODYROT.addChild(LEG1ROT2); - LEG2ROT2 = new ModelRenderer(this, "LEG2ROT2"); - LEG2ROT2.setRotationPoint(5F, 7F, 15F); - setRotation(LEG2ROT2, 0F, 0F, 0F); - LEG2ROT2.mirror = true; - LEG2ROT2.addBox("leg2top", -2F, 0F, -2F, 4, 3, 4); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("leg2", -2F, 0F, -2F, 4, 5, 4); - LEG2ROT2.addChild(LEG2ROT); - BODYROT.addChild(LEG2ROT2); - LEG3ROT2 = new ModelRenderer(this, "LEG3ROT2"); - LEG3ROT2.setRotationPoint(-3F, 7F, 3F); - setRotation(LEG3ROT2, 0F, 0F, 0F); - LEG3ROT2.mirror = true; - LEG3ROT2.addBox("leg3top", -2F, 0F, -2F, 4, 3, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 5, 4); - LEG3ROT2.addChild(LEG3ROT); - BODYROT.addChild(LEG3ROT2); - LEG4ROT2 = new ModelRenderer(this, "LEG4ROT2"); - LEG4ROT2.setRotationPoint(5F, 7F, 3F); - setRotation(LEG4ROT2, 0F, 0F, 0F); - LEG4ROT2.mirror = true; - LEG4ROT2.addBox("leg4top", -2F, 0F, -2F, 4, 3, 4); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 5, 4); - LEG4ROT2.addChild(LEG4ROT); - BODYROT.addChild(LEG4ROT2); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(1F, 2F, 17F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -1.5F, -1.5F, 0F, 3, 3, 1); - BODYROT.addChild(TAILROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - if (this.isChild) { - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - float field_78145_j = 0.0f; - float var8 = 2.0F; - float var9 = 1.0f; - - if (entity instanceof EntityBlackBear) { - var8 = 2.0F; - var9 = 1.2f; - field_78145_g = 4.0f; - field_78151_h = 5.0f; - field_78145_j = -0.8f; - } else if (entity instanceof EntityBrownBear) { - var8 = 2.5F; - field_78145_j = -0.55f; - } else { - var8 = 3.0F; - var9 = 0.7f; - field_78145_j = -0.3f; - } - GL11.glPushMatrix(); - GL11.glTranslatef(field_78145_j * f5, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5 * var9); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityBear var5 = (EntityBear) par1EntityLiving; - LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/a01693a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/a01693a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8da9791..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/a01693a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/b04aee00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/b04aee00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 732bdf3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/b04aee00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/b11a1bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/b11a1bf8c42100141fce95f06aba7e85 deleted file mode 100644 index a1970c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/b11a1bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d06040f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d06040f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3060a18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/d06040f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,232 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), - tempE.posZ), worldObj.getWorldVec3Pool() - .getVecFromPool(this.posX, this.posY, this.posZ)) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/e10948fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/e10948fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a1cb94d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e3/e10948fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,144 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTNode { - private NBTBase data; - private NBTNode parent; - private Optional tagName; - private List children; - - public NBTNode(NBTBase data, NBTNode parent, String tagName) { - this.data = data; - this.parent = parent; - this.children = NBTHelper.getByID(data.getId()).getChildTags(data, this); - this.tagName = tagName != null ? Optional.of(tagName) : Optional. absent(); - } - - public String getTagName() { - return tagName.isPresent() ? tagName.get() : ""; - } - - public NBTBase getData() { - return data; - } - - public String getValue() { - return NBTHelper.getByID(data.getId()).getValue(data); - } - - public NBTBase createNBTFromString(String newValue) { - NBTBase nbtBase = null; - try { - nbtBase = NBTHelper.getByID(data.getId()).getNBTFromString(data, newValue); - } catch (NumberFormatException e) { - ProjectZuluLog.warning("Rejecting NBTTag Value %s due to incorrect formatting", newValue); - } - return nbtBase; - } - - public NBTNode getParent() { - return parent; - } - - public boolean replaceChild(NBTNode childNode, NBTNode newChild) { - int index = children.indexOf(childNode); - if (index > -1) { - children.set(index, newChild); - return true; - } - ProjectZuluLog.warning("Could not find Child %s with Parent %s ", childNode.getTagName(), getData()); - return false; - } - - public List getChildren() { - return children; - } - - public int countParents() { - int numParents = 0; - if (parent != null) { - numParents++; - numParents += parent.countParents(); - } - return numParents; - } - - public boolean addChild(NBTBase data, String tagName) { - return children.add(new NBTNode(data, this, tagName)); - } - - public boolean removeChild(NBTNode nodeToRemove) { - return children.remove(nodeToRemove); - } - - public void writeNodeandChildrenToNBT(NBTTagCompound nbtTagCompound) { - NBTHelper helper = NBTHelper.getByID(data.getId()); - helper.writeToNBT(nbtTagCompound, this); - } - - public void writeNodeandChildrenToArrayList(ArrayList nodeList) { - nodeList.add(this); - for (NBTNode child : getChildren()) { - child.writeNodeandChildrenToArrayList(nodeList); - } - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - NBTNode otherNode = (NBTNode) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (data == null) { - if (otherNode.data != null) { - return false; - } - } else if (!data.equals(otherNode.data)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((data == null) ? 0 : data.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/10112cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/10112cf5c42100141fce95f06aba7e85 deleted file mode 100644 index e5aacfc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/10112cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/414e4df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/414e4df8c42100141fce95f06aba7e85 deleted file mode 100644 index 5cac413..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/414e4df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionResistance extends SubItemPotionHalfPower { - - public SubItemPotionResistance(Item itemID, int subID) { - super(itemID, subID, "Resistance"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 13, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.resistance); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/5098dff7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/5098dff7c42100141fce95f06aba7e85 deleted file mode 100644 index d49e6a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/5098dff7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,17 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public enum PotionList { - INSTANCE; - public static Optional bubbling = Optional.absent(); - public static Optional incendiary = Optional.absent(); - public static Optional slowfall = Optional.absent(); - public static Optional cleansing = Optional.absent(); - public static Optional curse = Optional.absent(); - public static Optional thorn = Optional.absent(); - public static Optional heal2 = Optional.absent(); - public static Optional harm2 = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/61a664e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/61a664e6c42100141fce95f06aba7e85 deleted file mode 100644 index a973faf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/61a664e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,23 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/707a5de6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/707a5de6c42100141fce95f06aba7e85 deleted file mode 100644 index ef33a4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/707a5de6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class TileEntityWithMeta extends BlockWithMeta { - - public TileEntity tileEntity; - - public TileEntityWithMeta(Block block, int meta, TileEntity tileEntity) { - super(block, meta); - this.tileEntity = tileEntity; - } - - public TileEntityWithMeta(Block block, TileEntity tileEntity) { - this(block, 0, tileEntity); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/70a71aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/70a71aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e5bc1b6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/70a71aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserGround extends KeyParserBase { - - public KeyParserGround(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - int blockHeight = getTopSolidOrLiquidBlock(world, xCoord, zCoord); - return blockHeight < 0 || blockHeight <= yCoord; - } - - /** - * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z - */ - private int getTopSolidOrLiquidBlock(World world, int par1, int par2) { - Chunk chunk = world.getChunkFromBlockCoords(par1, par2); - int k = chunk.getTopFilledSegment() + 15; - par1 &= 15; - - for (par2 &= 15; k > 0; --k) { - Block l = chunk.getBlock(par1, k, par2); - - if (l != null && l.getMaterial().blocksMovement() && l.getMaterial() != Material.leaves - && l.getMaterial() != Material.wood && l.getMaterial() != Material.glass - && !l.isFoliage(world, par1, k, par2)) { - return k + 1; - } - } - return -1; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/7134c8e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/7134c8e4c42100141fce95f06aba7e85 deleted file mode 100644 index a01ee05..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/7134c8e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,5 +0,0 @@ -package projectzulu.common.dungeon; - -public enum ListType { - NONE, Creature, Sound; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/904dbce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/904dbce4c42100141fce95f06aba7e85 deleted file mode 100644 index 6ff9375..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/904dbce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.packets.PacketPlaySound; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -public class CommandPlaySound extends CommandBase { - - @Override - public String getCommandName() { - return "playsound"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel() { - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - - /** - * Command stringArgs == 2: /playsound [targetPlayer] [fileName] Command stringArgs == 2: - * /playsound @p sounds.fileName Command stringArgs == 3: /playsound @p sounds.fileName Command stringArgs - * == 5: /playsound @p sounds.fileName Command stringArgs == 6: /playsound @p - * sounds.fileName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.playsound.usage", new Object[0]); - } else { - int soundTargetX = 0; - int soundTargetY = 0; - int soundTargetZ = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - soundTargetX = (int) targetPlayer.posX; - soundTargetY = (int) targetPlayer.posY; - soundTargetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - soundTargetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - soundTargetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, - stringArgs[indexOfPos++], 0, 0); - soundTargetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - int soundRange = stringArgs.length == 3 || stringArgs.length == 6 ? parseIntBounded(commandSender, - stringArgs[2], 0, 120) : 60; - - PZPacket packet = new PacketPlaySound().setPacketData(soundTargetX, soundTargetY, soundTargetZ, - stringArgs[1]); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(targetPlayer.dimension, soundTargetX, soundTargetY, soundTargetZ, soundRange)); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < (double) lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > (double) upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/c1c9a6e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/c1c9a6e4c42100141fce95f06aba7e85 deleted file mode 100644 index eb54ce0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/c1c9a6e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle implements PZPacket { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/d1b8def8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/d1b8def8c42100141fce95f06aba7e85 deleted file mode 100644 index 67f8f65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e4/d1b8def8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityGiraffe; -import com.ngb.projectzulu.common.mobs.models.ModelGiraffe; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/00d8b1f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/00d8b1f4c42100141fce95f06aba7e85 deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/00d8b1f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/0186f5e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/0186f5e4c42100141fce95f06aba7e85 deleted file mode 100644 index 53e4882..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/0186f5e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,206 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import java.util.HashMap; -import java.util.logging.Level; - -import net.minecraft.block.Block; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.keys.Key; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.ListMultimap; - -//TODO: most MEthods in this Class should be refactored the appropriate KeyParser -public class OptionalParser { - - public static Integer parseSingleInteger(String[] values, Integer defaultInt, String parameter) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], defaultInt, parameter); - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - public static int[] parseDoubleInteger(String[] values, int[] defaultInts, String parameter) { - if (values.length == 3) { - int[] integers = new int[2]; - integers[0] = ParsingHelper.parseFilteredInteger(values[1], defaultInts[0], "1st " + parameter); - integers[1] = ParsingHelper.parseFilteredInteger(values[2], defaultInts[1], "2nd " + parameter); - return integers; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", parameter); - return null; - } - } - - /** - * Parses the Light Tag. - * - * Format [0] Tag, [1] MinLightLevel, [2] MaxLightLevel. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static int[] parseLight(String[] values) { - if (values.length == 3) { - int[] lights = new int[2]; - lights[0] = ParsingHelper.parseFilteredInteger(values[1], 16, "Min " + Key.light.key); - lights[1] = ParsingHelper.parseFilteredInteger(values[2], 16, "Max " + Key.light.key); - return lights; - } else { - ProjectZuluLog.severe("Error Parsing deSpawn Light Parameter. Invalid Argument Length."); - return null; - } - } - - /** - * Parses the Block Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - * @return Returns a ArrayListMultimap mapping BlockID to Meta values - */ - public static ListMultimap parseBlock(String[] values) { - ListMultimap blockMeta = ArrayListMultimap.create(); - - for (int j = 1; j < values.length; j++) { - int minMeta = 0; - int maxMeta = 0; - /* Parse Scenario: NAME-1>2 ADDS (Block,Meta)(NAME, 1)(NAME, 2) */ - /* Parse Scenario: 2>4-1>2 ADDS (Block,Meta)(2,1)(2,2)(3,1)(3,2)(4,1)(4,2) */ - String[] idMetaParts = values[j].split("-"); - String blockID = idMetaParts[0]; - for (int k = 0; k < idMetaParts.length; k++) { - if (k == 0) { - } else if (k == 1) { - String[] rangeParts = idMetaParts[k].split(">"); - for (int l = 0; l < rangeParts.length; l++) { - if (l == 0) { - minMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], minMeta, "parseMinMetaID"); - } else if (l == 1) { - maxMeta = ParsingHelper.parseFilteredInteger(rangeParts[l], maxMeta, "parseMaxMetaID"); - } else { - ProjectZuluLog.warning("Block entry %s contains too many > elements.", values[j]); - } - } - } else { - ProjectZuluLog.warning("Block entry %s contains too many - elements.", values[j]); - } - } - - /* Gaurantee Max > Min. Auxillary Purpose: Gaurantees max is not -1 if only min is Set */ - maxMeta = minMeta > maxMeta ? minMeta : maxMeta; - - for (int meta = minMeta; meta <= maxMeta; meta++) { - ProjectZuluLog.debug(Level.INFO, "Would be adding (%s,%s)", blockID, meta); - blockMeta.put(blockID, meta); - } - } - return !blockMeta.isEmpty() ? blockMeta : null; - } - - /** - * Parses the BlockRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseBlockRange(String[] values, HashMap valueCache) { - if (values.length == 4) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[2], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[3], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else if (values.length == 2) { - valueCache.put(Key.blockRangeX.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeX")); - valueCache.put(Key.blockRangeY.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeY")); - valueCache.put(Key.blockRangeZ.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultBlockRange, "blockRangeZ")); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn block search range Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRate Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRate(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRate.key, ParsingHelper.parseFilteredInteger(values[1], - OptionalSettingsBase.defaultSpawnRate, Key.spawnRate.key)); - } else { - ProjectZuluLog.severe("Error Parsing deSpawn spawn rate Parameter. Invalid Argument Length."); - } - } - - /** - * Parses the SpawnRange Tag. - * - * @param values Values to be Used for Parsing - * @param valueCache Cache used by OptionalSettings to hold values - */ - public static void parseSpawnRange(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.spawnRange.key, ParsingHelper.parseFilteredInteger(values[1], 32, Key.spawnRange.key)); - } else { - ProjectZuluLog.severe("Error Parsing spawnRange parameter. Invalid Argument Length."); - } - } - - @Deprecated - public static Boolean parseSky(String[] values) { - if (values.length == 1) { - if (Key.sky.key.equalsIgnoreCase(values[0])) { - return Boolean.TRUE; - } else { - return Boolean.FALSE; - } - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return null; - } - } - - public static void parseEntityCap(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.entityCap.key, ParsingHelper.parseFilteredInteger(values[1], 0, Key.entityCap.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static void parseDespawnAge(String[] values, HashMap valueCache) { - if (values.length == 2) { - valueCache.put(Key.despawnAge.key, ParsingHelper.parseFilteredInteger(values[1], 600, Key.despawnAge.key)); - } else { - ProjectZuluLog.severe("Error Parsing Needs EntityCap parameter. Invalid Argument Length."); - } - } - - public static Integer parseMinSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], 256, Key.minSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Min Spawn Height parameter. Invalid Argument Length."); - return null; - } - } - - public static Integer parseMaxSpawnHeight(String[] values) { - if (values.length == 2) { - return ParsingHelper.parseFilteredInteger(values[1], -1, Key.maxSpawnHeight.key); - } else { - ProjectZuluLog.severe("Error Parsing Max Spawn Height parameter. Invalid Argument Length."); - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/01bf4df4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/01bf4df4c42100141fce95f06aba7e85 deleted file mode 100644 index 01ad152..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/01bf4df4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,137 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; - -public class BPSetCathedral implements BlueprintSet { - boolean isAssigned = false; - - Blueprint dome = new BPCathedralDome(); - Blueprint hallway = new BPCathedralHallway(); - Blueprint hallwayEnd = new BPCathedralHallwayEnd(); - Blueprint hallwayEnt = new BPCathedralHallwayEntrance(); - Blueprint entrance = new BPCathedralEntrance(); - Blueprint west_tower = new BPCathedralWestTower(); - Blueprint east_tower = new BPCathedralEastTower(); - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return !isAssigned; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.EastWall); - - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthWall); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 5, entrance.getIdentifier(),// entrance - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 5, entrance.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 5, west_tower.getIdentifier(), // west_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 5, west_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 6].getHeight()); - - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 5, east_tower.getIdentifier(), // east_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 5, east_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 6].getHeight()); - isAssigned = true; - return true; - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection) { - applyBlueprintToCell(cellList, xCell, zCell, subBuildingID, cellDirection, 0); - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection, int heightIncrease) { - cellList[xCell][zCell].setBuildingProperties(getIdentifier().concat("-").concat(subBuildingID), cellDirection); - cellList[xCell][zCell].rawState = -1; - cellList[xCell][zCell].setHeight(cellList[xCell][zCell].getHeight() + heightIncrease); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String childBuildingID = buildingID.split("-")[1]; - if (childBuildingID != null) { - if (childBuildingID.equals(dome.getIdentifier())) { - return dome.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallway.getIdentifier())) { - return hallway.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnd.getIdentifier())) { - return hallwayEnd.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnt.getIdentifier())) { - return hallwayEnt.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(entrance.getIdentifier())) { - return entrance.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(west_tower.getIdentifier())) { - return west_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(east_tower.getIdentifier())) { - return east_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - } - return null; - } - - @Override - public String getIdentifier() { - return "Cathedral"; - } - - @Override - public int getWeight() { - return 20; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/1109c2f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/1109c2f8c42100141fce95f06aba7e85 deleted file mode 100644 index 6822b57..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/1109c2f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityTreeEnt; -import com.ngb.projectzulu.common.mobs.models.ModelTreeEnt; -import com.ngb.projectzulu.common.mobs.renders.RenderSnow; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/20d3909fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/20d3909fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 60edb43..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/20d3909fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/30b6bfa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/30b6bfa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4ded76e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/30b6bfa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.core; - -import java.util.List; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.potion.brewingstands.PotionIngredients.IngredientProperty; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemGenerics extends Item implements IngredientProperty { - - public enum Properties { - /* Generic Items */ - PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - - /* Potion Effect Ingredients */ - BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( - "Antennae", 23, true), ShinyBauble("Shiny Bauble", 24, true), Talon("Talon", 25, true), Bark("Bark", - 27, true), SmallHeart("Small Heart", 28, true), LargeHeart("Large Heart", 29, true), Gill("Gill", 30, - true), Ectoplasm("Ectoplasm", 31), FrogLegs("Frog Legs", 32, true), RabbitsFoot("Rabbits Feet", 33, - true), PricklyPowder("Prickly Powder", 34, true), PowderSlush("Powder Slush", 35, true), GlowingGoo( - "Glowing Goo", 36, true), SmallUnhealthyHeart("Small Unhealthy Heart", 37, true), LargeUnhealthyHeart( - "Large Unhealthy Heart", 38, true); - - public final String displayName; - public final boolean isIngredient; - public final int meta; - - public int meta() { - return meta; - } - - @SideOnly(Side.CLIENT) - private IIcon icon; - - Properties(String name, int meta, boolean isIngredient) { - this.displayName = name; - this.meta = meta; - this.isIngredient = isIngredient; - } - - Properties(String name, int iconIndex) { - this(name, iconIndex, false); - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Properties getPropertyByMeta(int meta) { - for (Properties property : Properties.values()) { - if (property.meta == meta) { - return property; - } - } - return null; - } - } - - public ItemGenerics() { - super(); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHasSubtypes(true); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Properties.getPropertyByMeta(par1).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister par1IconRegister) { - for (Properties type : Properties.values()) { - type.setIcon(par1IconRegister.registerIcon(DefaultProps.blockKey + ":" + type.toString().toLowerCase())); - } - } - - @Override - public boolean isIngredient(ItemStack ingredient) { - Properties.getPropertyByMeta(ingredient.getItemDamage()); - return true; - } - - @Override - public String getUnlocalizedName(ItemStack itemStack) { - for (final Properties property : Properties.values()) { - if (property.meta == itemStack.getItemDamage()) { - return "item.".concat(property.displayName.toLowerCase().replaceAll("\\s", "")); - } - } - return ""; - } - - @Override - @SuppressWarnings("unchecked") - public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) { - for (final Properties property : Properties.values()) { - par3List.add(new ItemStack(item, 1, property.meta)); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/516344fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/516344fac42100141fce95f06aba7e85 deleted file mode 100644 index 3e5de5b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/516344fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/521549a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/521549a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c91fc31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/521549a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/702ee6f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/702ee6f4c42100141fce95f06aba7e85 deleted file mode 100644 index f81160c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/702ee6f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.HashMap; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.api.SubItemPotionList; - -public class PotionRecipies { - /* - * Ingredient String Format is ItemID.Meta Star ("*") should be used in place of Meta if Damage Shouldn't Matter A - * Meta Result Is Found Before a WildCard Result is found - */ - private static HashMap ingredientToPotionResult = new HashMap(); - - public void addResultPotion(Item item, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + ".*", resultPotion.get()); - } - } - - public void addResultPotion(Item item, int meta, SubItemPotionList resultPotion) { - if (resultPotion.isPresent()) { - String name = Item.itemRegistry.getNameForObject(item); - ingredientToPotionResult.put(name + "." + Integer.toString(meta), resultPotion.get()); - } - } - - public SubItemPotion getResulingPotion(Item item, int meta) { - String name = Item.itemRegistry.getNameForObject(item); - SubItemPotion result = ingredientToPotionResult.get(name + "." + Integer.toString(meta)); - if (result == null) { - result = ingredientToPotionResult.get(name + ".*"); - } - return result; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/716d02f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/716d02f9c42100141fce95f06aba7e85 deleted file mode 100644 index 5404f4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/716d02f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import net.minecraft.entity.ai.RandomPositionGenerator; -import net.minecraft.util.MathHelper; - -public class EntityAIFlyingWander extends EntityAIBase{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - public EntityAIFlyingWander(EntityGenericCreature par1EntityCreature, float speed) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - } - - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && entity.isEntityGrounded()) { - return false; - } - else { - Vec3 var1 = flyRandomlyTowardHeightLevel(this.entity, 10, 7, entity.getMaxFlightHeight()); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return entity.isTargetPositionValid(new ChunkCoordinates( (int)xPosition, (int)yPosition, (int)zPosition)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - /* Continue if I'm not at Target Position or if its invalid block */ - /* If Target Position is not an Air Block, Target Position = null (i.e. Don't try to go there) */ - return entity.getRNG().nextInt(100) != 0 && !entity.atTargetPosition() && entity.isTargetPositionValid(); -// return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - /* Set Target Postion */ - entity.setTargetPosition(new ChunkCoordinates((int)xPosition, (int)yPosition, (int)zPosition)); -// this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/71e8a7a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/71e8a7a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1fdf612..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/71e8a7a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,145 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import java.io.File; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.EntityRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class CreatureDeclaration implements EntityDeclaration { - public final String mobName; - public final int entityID; - - protected Class mobClass; - protected EnumCreatureType enumCreatureType; - protected boolean shouldExist = true; - protected boolean reportSpawningInLog = false; - protected int maxSpawnInChunk = 4; - - protected int trackingRange; - protected int updateFrequency; - protected boolean sendsVelocityUpdates; - protected boolean shouldDespawn; - - protected int minDropNum = 0; - protected int maxDropNum = 0; - - protected CreatureDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - this.mobName = mobName; - this.entityID = entityID; - this.mobClass = mobClass; - this.enumCreatureType = creatureType; - shouldDespawn = enumCreatureType == EnumCreatureType.creature ? false : true; - } - - @Override - public String getIdentifier() { - return mobName; - } - - protected void setDropAmount(int minDropNum, int maxDropNum) { - this.minDropNum = minDropNum; - this.maxDropNum = maxDropNum; - } - - protected void setRegistrationProperties(int trackingRange, int updateFrequency, boolean sendsVelocityUpdates) { - this.trackingRange = trackingRange; - this.updateFrequency = updateFrequency; - this.sendsVelocityUpdates = sendsVelocityUpdates; - } - - @Override - public boolean shouldExist() { - return shouldExist; - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - shouldExist = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " shouldExist", shouldExist) - .getBoolean(shouldExist); - reportSpawningInLog = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " reportSpawningInLog", - reportSpawningInLog).getBoolean(reportSpawningInLog); - updateFrequency = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " UpdateFrequency", - updateFrequency).getInt(updateFrequency); - } - - @Override - public void loadBiomesFromConfig(Configuration config) { - } - - @Override - public void registerEntity() { - EntityRegistry.registerModEntity(mobClass, mobName, entityID, ProjectZulu_Core.modInstance, trackingRange, - updateFrequency, true); - } - - @Override - public void loadCustomMobData(File configDirectory) { - Configuration config = new Configuration(new File(configDirectory, DefaultProps.configDirectory - + DefaultProps.mobBiomeSpawnConfigFile)); - config.load(); - CustomMobData customMobData = new CustomMobData(mobName); - outputDataToList(config, customMobData); - CustomEntityList customEntity = CustomEntityList.getByName(mobName); - if (customEntity != null) - customEntity.modData = Optional.of(customMobData); - else - ProjectZuluLog.severe("Entity %s does not have an Entry in the CustomEntityList", mobName); - - config.save(); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.reportSpawningInLog = reportSpawningInLog; - customMobData.creatureType = ConfigHelper.configGetCreatureType(config, "MOB CONTROLS." + mobName, - "Creature Type", enumCreatureType); - customMobData.shouldDespawn = config.get("MOB CONTROLS." + mobName, mobName + " Should Despawn", shouldDespawn) - .getBoolean(true); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.maxSpawnInChunk = maxSpawnInChunk; - customMobData.minDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Min", minDropNum).getInt( - minDropNum); - customMobData.maxDropNum = config.get("MOB CONTROLS." + mobName, "Items to Drop Max", maxDropNum).getInt( - maxDropNum); - } - - @Override - public void registerEgg() { - } - - @Override - public void addSpawn() { - } - - @SideOnly(Side.CLIENT) - public abstract RenderWrapper getEntityrender(Class entityClass); - - @Override - @SideOnly(Side.CLIENT) - public void registerModelAndRender() { - RenderWrapper wrapper = getEntityrender(mobClass); - if (wrapper != null && wrapper.getRender() != null) { - RenderingRegistry.registerEntityRenderingHandler(mobClass, wrapper.getRender()); - } else { - throw new IllegalStateException("Entity Renderer for " + mobClass.getSimpleName() + " cannot be null"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/808d90e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/808d90e5c42100141fce95f06aba7e85 deleted file mode 100644 index a8131d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/808d90e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,556 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/81e9d1a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/81e9d1a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2795ab9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/81e9d1a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import projectzulu.common.mobs.models.ModelMummyPharaoh; -import projectzulu.common.mobs.renders.RenderMummyPharaoh; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PharaohDeclaration extends CreatureDeclaration { - - public PharaohDeclaration() { - super("Mummy Pharaoh", 4, EntityMummyPharaoh.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.iron_ingot, 0, 40); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, BlockList.jasper, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.ankh, 0, 10); - customMobData.entityProperties = new EntityProperties(200f, 3.0f, 0.35f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderMummyPharaoh(new ModelMummyPharaoh(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "mummy_pharaoh.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/a0494fe6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/a0494fe6c42100141fce95f06aba7e85 deleted file mode 100644 index 697fbaf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/a0494fe6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,245 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.util.EnumSet; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.client.renderer.Tessellator; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.src.ModLoader; -//import net.minecraft.util.MathHelper; -// -//import org.lwjgl.opengl.GL11; -// -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class DisplayTemperatureTicker implements ITickHandler{ -// -// protected float zLevel = 10.0F; -// public static long inGameTicks = 0; -// private float playerTemp = 0; -// private float enviroTemp = 0; -// @Override -// public void tickStart(EnumSet type, Object... tickData) {} -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// -// /* Handle Display of Temperature on Client, TickType = Render*/ -// if(ModLoader.getMinecraftInstance().thePlayer != null){ -// -// Minecraft mc = ModLoader.getMinecraftInstance(); -// EntityPlayer player = ModLoader.getMinecraftInstance().thePlayer; -// -// FontRenderer var2 = mc.fontRenderer; -// ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); -// String textureLocation = "/mods/icons/temperature_icon.png"; -// int scalewidth = var3.getScaledWidth(); -// int scaleHeight = var3.getScaledHeight(); -// -// if( TemperatureTicker.getPlayerTemperature(player) != null && inGameTicks % 80 == 0){ -// playerTemp = TemperatureTicker.getPlayerTemperature(player); -// } -// if(TemperatureTicker.getPlayerLocTemperature(player) != null && inGameTicks % 80 == 0){ -// enviroTemp = TemperatureTicker.getPlayerLocTemperature(player); -// } -// int playerTempIconValue = (int) mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120); -// int playerTempHumanReadable = 80 - playerTempIconValue; -// int verticalOffsetFromTopY = 120; -// int horizontalOffsetFromRightX = 0; -// int iconXCoord = 0; -// int iconYCoord = 0; -// -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture( textureLocation )); -// -// scalewidth = 0; -// scaleHeight = scaleHeight/2; -// horizontalOffsetFromRightX = -(26+10); -// verticalOffsetFromTopY -= 50; -// if( (120 - playerTempIconValue) < 20){ -// /* Draw Very Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 150; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// -// }else if( (120 - playerTempIconValue) < 30 ){ -// /* Draw Medium Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 125; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur2.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// }else if ( (120 - playerTempIconValue) < 40 ){ -// /* Draw Little Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 100; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 100 ){ -// /* Draw High Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 50; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 90 ){ -// /* Draw Medium Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 25; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 80 ){ -// /* Draw Little Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 0; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else{ -// /* Draw Frame */ -// iconXCoord = 0; -// iconYCoord = 0; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-12), iconXCoord, iconYCoord, 15, 105); -// -// /* Draw Red Inside */ -// iconXCoord = 200; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// } -// -// /* Draw Marker */ -// iconXCoord = 30; -// iconYCoord = 94; -// int playerLocTemp = MathHelper.floor_float((mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120)) ); -// playerLocTemp = playerLocTemp > 116 ? 116 : playerLocTemp < 14 ? 14 : playerLocTemp; -// -// this.drawTexturedModalRect(scalewidth-(14+horizontalOffsetFromRightX+0), scaleHeight-(8+verticalOffsetFromTopY-playerLocTemp+4), iconXCoord, iconYCoord, 4, 8); -// scalewidth = var3.getScaledWidth(); -// horizontalOffsetFromRightX = 0; -// -// -// -// -// /* Write Temp String TO Top Of Screen, Mostly For Debugging For Now*/ -// byte var8 = 12; -// String var9 = "Current Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120))); -// String var10 = "Max Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120))); -// -//// var2.drawStringWithShadow(var10, scalewidth / 2 - var2.getStringWidth(var10) / 2, var8 - 10, 16711935); -//// var2.drawStringWithShadow(var9, scalewidth / 2 - var2.getStringWidth(var9) / 2, var8 + 10, 16711935); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// -// inGameTicks++; -// } -// -// } -// -// private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6){ -// float var7 = 0.00390625F; -// float var8 = 0.00390625F; -// -// Tessellator var9 = Tessellator.instance; -// var9.startDrawingQuads(); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); -// var9.draw(); -// } -// -// private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of( TickType.RENDER); } -// -// @Override -// public String getLabel() { -// return null; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/a06259f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/a06259f5c42100141fce95f06aba7e85 deleted file mode 100644 index 69f849c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/a06259f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,132 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelBoar extends ModelBase { - ModelRenderer HEADROT; - ModelRenderer BODYROT; - private ModelRenderer LEGROT1; - private ModelRenderer LEGROT2; - private ModelRenderer LEGROT3; - private ModelRenderer LEGROT4; - - public ModelBoar() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - setTextureOffset("BODYROT.body", 12, 8); - setTextureOffset("LEGROT1.leg1", 0, 13); - setTextureOffset("LEGROT2.leg2", 0, 13); - setTextureOffset("LEGROT3.leg3", 0, 13); - setTextureOffset("LEGROT4.leg4", 0, 13); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 14F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 14.5F, -4F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -5F, -4.5F, 0F, 10, 8, 16); - LEGROT1 = new ModelRenderer(this, "LEGROT1"); - LEGROT1.setRotationPoint(-3F, 3.5F, 14F); - setRotation(LEGROT1, 0F, 0F, 0F); - LEGROT1.mirror = true; - LEGROT1.addBox("leg1", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT1); - LEGROT2 = new ModelRenderer(this, "LEGROT2"); - LEGROT2.setRotationPoint(3F, 3.5F, 14F); - setRotation(LEGROT2, 0F, 0F, 0F); - LEGROT2.mirror = true; - LEGROT2.addBox("leg2", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT2); - LEGROT3 = new ModelRenderer(this, "LEGROT3"); - LEGROT3.setRotationPoint(-3F, 3.5F, 2F); - setRotation(LEGROT3, 0F, 0F, 0F); - LEGROT3.mirror = true; - LEGROT3.addBox("leg3", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT3); - LEGROT4 = new ModelRenderer(this, "LEGROT4"); - LEGROT4.setRotationPoint(3F, 3.5F, 2F); - setRotation(LEGROT4, 0F, 0F, 0F); - LEGROT4.mirror = true; - LEGROT4.addBox("leg4", -2F, 0F, -2F, 4, 6, 4); - BODYROT.addChild(LEGROT4); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_x = 0.0f; - float field_78145_g = 2.2F; - float field_78151_h = 3.4F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGROT1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -30), +30) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/b1476af4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/b1476af4c42100141fce95f06aba7e85 deleted file mode 100644 index fc4b802..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/b1476af4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/b1868a9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/b1868a9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 262ce65..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e5/b1868a9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDifficulty extends KeyParserBase { - - public KeyParserDifficulty(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - int difficulty = ParsingHelper.parseFilteredInteger(pieces[1], 0, key.key); - if (difficulty < 0 || difficulty > 3) { - ProjectZuluLog.info("Difficulty must be between 0 (Peaceful) and 3 (Hard)"); - return false; - } - - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted, difficulty }); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - Boolean isInverted = (Boolean) values[0]; - Integer difficulty = (Integer) values[1]; - if ((!isInverted && difficulty.equals(world.difficultySetting)) - || (isInverted && !difficulty.equals(world.difficultySetting))) { - return false; - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/5110b2a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/5110b2a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c8a3230..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/5110b2a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.world2.randomizer; - -import projectzulu.common.world2.MazeCell; - -/** - * The Randomizer is responsible for splitting the various cells between 0 and 1 (typically wall and hallway) - */ -public abstract class Randomizer { - - public abstract void randomize(MazeCell[][] cells); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/51983d00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/51983d00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2a2f4f1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/51983d00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/70a4d6a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/70a4d6a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 832a5c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/70a4d6a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityRhino; -import projectzulu.common.mobs.models.ModelRhino; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class RhinoDeclaration extends SpawnableDeclaration { - - public RhinoDeclaration() { - super("Rhino", 20, EntityRhino.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (95 << 16) + (93 << 8) + 94; - eggColor2 = (173 << 16) + (170 << 8) + 172; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Tusk.meta(), 8); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.2f, 100f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelRhino(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "rhino.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/81f6d29dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/81f6d29dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5ed96ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/81f6d29dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/90105df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/90105df9c42100141fce95f06aba7e85 deleted file mode 100644 index 5b695b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/90105df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/e0d0ac9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/e0d0ac9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 52bd77a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/e0d0ac9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f029759ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f029759ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1e6243d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e6/f029759ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,367 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public abstract class GuiScrollingList { - private final Minecraft client; - protected final int listWidth; - protected final int listHeight; - protected final int top; - protected final int bottom; - private final int right; - protected final int left; - protected final int slotHeight; - private int scrollUpActionId; - private int scrollDownActionId; - protected int mouseX; - protected int mouseY; - private float initialMouseClickY = -2.0F; - private float scrollFactor; - private float scrollDistance; - private int selectedIndex = -1; - private long lastClickTime = 0L; - private boolean field_25123_p = true; - private boolean field_27262_q; - private int field_27261_r; - public static ResourceLocation background = new ResourceLocation(DefaultProps.dungeonKey, "customspawnerbackground.png"); - - public GuiScrollingList(Minecraft client, int width, int height, int top, int bottom, int left, int entryHeight) { - this.client = client; - this.listWidth = width; - this.listHeight = height; - this.top = top; - this.bottom = bottom; - this.slotHeight = entryHeight; - this.left = left; - this.right = width + this.left; - } - - public void func_27258_a(boolean p_27258_1_) { - this.field_25123_p = p_27258_1_; - } - - protected void func_27259_a(boolean p_27259_1_, int p_27259_2_) { - this.field_27262_q = p_27259_1_; - this.field_27261_r = p_27259_2_; - - if (!p_27259_1_) { - this.field_27261_r = 0; - } - } - - protected abstract int getSize(); - - protected abstract void elementClicked(int index, boolean doubleClick); - - protected abstract boolean isSelected(int index); - - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_27261_r; - } - - protected abstract void drawBackground(); - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - - protected void func_27260_a(int p_27260_1_, int p_27260_2_, Tessellator p_27260_3_) { - } - - protected void func_27255_a(int p_27255_1_, int p_27255_2_) { - } - - protected void func_27257_b(int p_27257_1_, int p_27257_2_) { - } - - public int func_27256_c(int p_27256_1_, int p_27256_2_) { - int var3 = this.left + 1; - int var4 = this.left + this.listWidth - 7; - int var5 = p_27256_2_ - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - int var6 = var5 / this.slotHeight; - return p_27256_1_ >= var3 && p_27256_1_ <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; - } - - public void registerScrollButtons(List p_22240_1_, int p_22240_2_, int p_22240_3_) { - this.scrollUpActionId = p_22240_2_; - this.scrollDownActionId = p_22240_3_; - } - - private void applyScrollLimits() { - int var1 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var1 < 0) { - var1 /= 2; - } - - if (this.scrollDistance < 0.0F) { - this.scrollDistance = 0.0F; - } - - if (this.scrollDistance > var1) { - this.scrollDistance = var1; - } - } - - public void actionPerformed(GuiButton button) { - if (button.enabled) { - if (button.id == this.scrollUpActionId) { - this.scrollDistance -= this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } else if (button.id == this.scrollDownActionId) { - this.scrollDistance += this.slotHeight * 2 / 3; - this.initialMouseClickY = -2.0F; - this.applyScrollLimits(); - } - } - } - - public void drawScreen(int mouseX, int mouseY, float p_22243_3_) { - this.mouseX = mouseX; - this.mouseY = mouseY; - this.drawBackground(); - int listLength = this.getSize(); - int scrollBarXStart = this.left + this.listWidth - 6; - int scrollBarXEnd = scrollBarXStart + 6; - int boxLeft = this.left; - int boxRight = scrollBarXStart - 1; - int var10; - int var11; - int var13; - int var19; - - if (Mouse.isButtonDown(0)) { - if (this.initialMouseClickY == -1.0F) { - boolean var7 = true; - - if (mouseY >= this.top && mouseY <= this.bottom) { - var10 = mouseY - this.top - this.field_27261_r + (int) this.scrollDistance - 4; - var11 = var10 / this.slotHeight; - - if (mouseX >= boxLeft && mouseX <= boxRight && var11 >= 0 && var10 >= 0 && var11 < listLength) { - boolean var12 = var11 == this.selectedIndex - && System.currentTimeMillis() - this.lastClickTime < 250L; - this.elementClicked(var11, var12); - this.selectedIndex = var11; - this.lastClickTime = System.currentTimeMillis(); - } else if (mouseX >= boxLeft && mouseX <= boxRight && var10 < 0) { - this.func_27255_a(mouseX - boxLeft, mouseY - this.top + (int) this.scrollDistance - 4); - var7 = false; - } - - if (mouseX >= scrollBarXStart && mouseX <= scrollBarXEnd) { - this.scrollFactor = -1.0F; - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 < 1) { - var19 = 1; - } - - var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this - .getContentHeight()); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - this.scrollFactor /= (float) (this.bottom - this.top - var13) / (float) var19; - } else { - this.scrollFactor = 1.0F; - } - - if (var7) { - this.initialMouseClickY = mouseY; - } else { - this.initialMouseClickY = -2.0F; - } - } else { - this.initialMouseClickY = -2.0F; - } - } else if (this.initialMouseClickY >= 0.0F) { - this.scrollDistance -= (mouseY - this.initialMouseClickY) * this.scrollFactor; - this.initialMouseClickY = mouseY; - } - } else { - while (Mouse.next()) { - int var16 = Mouse.getEventDWheel(); - - if (var16 != 0) { - if (var16 > 0) { - var16 = -1; - } else if (var16 < 0) { - var16 = 1; - } - - this.scrollDistance += var16 * this.slotHeight / 2; - } - } - - this.initialMouseClickY = -1.0F; - } - - this.applyScrollLimits(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var18 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var17 = 32.0F; - var18.startDrawingQuads(); - var18.setColorOpaque_I((160 << 16) + (145 << 8) + 114); // 2105376 // //Inv SLot Grey: (139 << 16) + (139 << 8) - // + 139 - var18.addVertexWithUV(this.left, this.bottom, 0.0D, this.left / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, this.right / var17, - (this.bottom + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.right, this.top, 0.0D, this.right / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.addVertexWithUV(this.left, this.top, 0.0D, this.left / var17, - (this.top + (int) this.scrollDistance) / var17); - var18.draw(); - // boxRight = this.listWidth / 2 - 92 - 16; - var10 = this.top + 4 - (int) this.scrollDistance; - - if (this.field_27262_q) { - this.func_27260_a(boxRight, var10, var18); - } - - int var14; - - for (var11 = 0; var11 < listLength; ++var11) { - var19 = var10 + var11 * this.slotHeight + this.field_27261_r; - var13 = this.slotHeight - 4; - - if (var19 <= this.bottom && var19 + var13 >= this.top) { - if (this.field_25123_p && this.isSelected(var11)) { - var14 = boxLeft; - int var15 = boxRight; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); - var18.addVertexWithUV(var14, var19 + var13 + 2, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15, var19 + var13 + 2, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15, var19 - 2, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14, var19 - 2, 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); - var18.addVertexWithUV(var14 + 1, var19 + var13 + 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 + var13 + 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(var15 - 1, var19 - 1, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(var14 + 1, var19 - 1, 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - this.drawSlot(var11, boxRight, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); - byte var20 = 4; - // this.overlayBackground(0, this.top, 255, 255); - // this.overlayBackground(this.bottom, this.listHeight, 255, 255); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.left, this.top + var20, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.top + var20, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.right, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(this.left, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(this.right, this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV(this.right, this.bottom - var20, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(this.left, this.bottom - var20, 0.0D, 0.0D, 0.0D); - var18.draw(); - var19 = this.getContentHeight() - (this.bottom - this.top - 4); - - if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - - if (var13 < 32) { - var13 = 32; - } - - if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - - var14 = (int) this.scrollDistance * (this.bottom - this.top - var13) / var19 + this.top; - - if (var14 < this.top) { - var14 = this.top; - } - - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV(scrollBarXStart, this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, this.top, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14 + var13, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - var18.startDrawingQuads(); - var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV(scrollBarXStart, var14 + var13 - 1, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14 + var13 - 1, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV(scrollBarXEnd - 1, var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV(scrollBarXStart, var14, 0.0D, 0.0D, 0.0D); - var18.draw(); - } - - this.func_27257_b(mouseX, mouseY); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - } - - protected ResourceLocation getBackgroundTexture() { - return background; - } - - private void overlayBackground(int p_22239_1_, int p_22239_2_, int p_22239_3_, int p_22239_4_) { - Tessellator var5 = Tessellator.instance; - client.renderEngine.bindTexture(getBackgroundTexture()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - int leftOffset = 300; - var5.startDrawingQuads(); - var5.setColorRGBA_I(4210752, p_22239_4_); - var5.addVertexWithUV(0D + leftOffset, p_22239_2_, 0.0D, 0.0D, p_22239_2_ / var6); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_2_, 0.0D, - (this.listWidth + 30) / var6, p_22239_2_ / var6); - var5.setColorRGBA_I(4210752, p_22239_3_); - var5.addVertexWithUV((double) this.listWidth + 30 + leftOffset, p_22239_1_, 0.0D, - (this.listWidth + 30) / var6, p_22239_1_ / var6); - var5.addVertexWithUV(0.0D + leftOffset, p_22239_1_, 0.0D, 0.0D, p_22239_1_ / var6); - var5.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/00e90901c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/00e90901c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6b1cbf0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/00e90901c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCrocodile; -import projectzulu.common.mobs.models.ModelCrocodile; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class AlligatorDeclaration extends SpawnableDeclaration { - - public AlligatorDeclaration() { - super("Alligator", 12, EntityCrocodile.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (32 << 16) + (39 << 8) + 33; - eggColor2 = (52 << 16) + (65 << 8) + 54; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 5); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Gill.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCrocodile(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "crocodile.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add("Green Swamplands"); - defaultBiomesToSpawn.add("Marsh"); - defaultBiomesToSpawn.addAll(typeToArray(Type.SWAMP)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/10709a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/10709a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f2e6415..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/10709a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionHarm extends SubItemPotionGeneric { - - public SubItemPotionHarm(Item itemID, int subID) { - super(itemID, subID, "potion.harm2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.harm2; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/22d810ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/22d810ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4be9047..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/22d810ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/311d1ff9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/311d1ff9c42100141fce95f06aba7e85 deleted file mode 100644 index 18bff11..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/311d1ff9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBlack extends EntityHorseBase{ - - public EntityHorseDarkBlack(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/408033f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/408033f4c42100141fce95f06aba7e85 deleted file mode 100644 index 47b57d3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/408033f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,62 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.architect.ArchitectOasis; -import com.ngb.projectzulu.common.world2.randomizer.EdgeRandomizer; -import com.ngb.projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/40887ff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/40887ff5c42100141fce95f06aba7e85 deleted file mode 100644 index e476d3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/40887ff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,84 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseBlack; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBlackDeclaration extends SpawnableDeclaration { - - public HorseBlackDeclaration() { - super("Horse Black", 29, EntityHorseBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (186 << 16) + (186 << 8) + 186; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_black.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/40d8b79ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/40d8b79ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3250ae2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/40d8b79ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs; - -import java.util.EnumSet; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityLiving; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityGenericAnimal; -import projectzulu.common.mobs.entity.EntityMummyPharaoh; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent; - -public class BossHealthDisplayTicker { - - public static EntityMummyPharaoh targetBoss; - protected float zLevel = 0.0F; - - public static void registerEntityMummyPharaoh(EntityMummyPharaoh newTicker) { - targetBoss = newTicker; - } - - public static boolean validTargetPresent(EntityLiving targetBoss) { - return targetBoss != null && !targetBoss.isDead; - } - - @SubscribeEvent - public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { - if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { - renderBossHealthBar(targetBoss, "Pharaoh Health"); - } - } - } - - public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); - FontRenderer fontRenderer = mc.fontRenderer; - - /* Draw Title */ - ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); - int screenWidth = var3.getScaledWidth(); - byte healthBarHeight = 12; - fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) - / 2, healthBarHeight - 10, 16711935); - - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); - short fullHealthBarWidth = 182; - int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; - int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); - - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 74, fullHealthBarWidth, 5); - if (currHealthBarWidth > 0) { - this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, this.zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, this.zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, this.zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, this.zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/41c20be4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/41c20be4c42100141fce95f06aba7e85 deleted file mode 100644 index 346e715..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/41c20be4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,201 +0,0 @@ -package projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/501db39ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/501db39ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5e1cb7b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/501db39ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/60b26df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/60b26df9c42100141fce95f06aba7e85 deleted file mode 100644 index 89b649b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/60b26df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserFill extends KeyParserBase { - - public KeyParserFill(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs %s parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean isFillerBlock = world.getBiomeGenForCoords(xCoord, zCoord).fillerBlock == world.getBlock(xCoord, - yCoord - 1, zCoord); - return isInverted ? isFillerBlock : !isFillerBlock; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/70f786f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/70f786f4c42100141fce95f06aba7e85 deleted file mode 100644 index 0e25c9d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/70f786f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; -import com.ngb.projectzulu.common.world2.blueprint.cathedral.BPSetCathedral; - -public class ArchitectCathedral extends ArchitectBase { - - public ArchitectCathedral(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetCathedral()); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - set = stockpile.getRandomApplicable(cells, buildCoords); - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/90242afac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/90242afac42100141fce95f06aba7e85 deleted file mode 100644 index e818227..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/90242afac42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGorillaHead extends ModelBase{ - - ModelRenderer HEADROT; - - public ModelGorillaHead() - { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 23F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/910633a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/910633a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fa832ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/910633a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,195 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelMammothHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer TUSKLEFROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer NOSEROT1; - private ModelRenderer NOSEROT2; - private ModelRenderer NOSEROT3; - private ModelRenderer NOSEROT4; - private ModelRenderer NOSEROT5; - private ModelRenderer NOSEROT6; - private ModelRenderer NOSEROT7; - private ModelRenderer NOSEROT8; - private ModelRenderer NOSEROT9; - private ModelRenderer EARRIGROT; - private ModelRenderer EARLEFROT; - - public ModelMammothHead() - { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 16F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5) - { - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NOSEROT1.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (00.0*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (0.0*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - default: - NOSEROT1.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT2.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT3.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT4.rotateAngleX = (float) (22.5*Math.PI/180); - NOSEROT5.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT6.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT7.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT8.rotateAngleX = (float) (0*Math.PI/180); - NOSEROT9.rotateAngleX = (float) (0*Math.PI/180); - break; - } - - TUSKRIGROT.rotateAngleY = (float) (-22.5*Math.PI/180); - TUSKLEFROT.rotateAngleY = (float) (22.5*Math.PI/180); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/916bb7e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/916bb7e4c42100141fce95f06aba7e85 deleted file mode 100644 index 528bf77..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/916bb7e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,56 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.Random; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.GuiID; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockLimitedMobSpawner extends BlockContainer { - - public BlockLimitedMobSpawner() { - super(Material.rock); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); - this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, - float par7, float par8, float par9) { - if (player instanceof EntityPlayer && ((EntityPlayer) player).capabilities.isCreativeMode) { - ((EntityPlayer) player).openGui(ProjectZulu_Core.modInstance, GuiID.MobSpawner.getID(), par1World, par2, - par3, par4); - return true; - } - return super.onBlockActivated(par1World, par2, par3, par4, player, par6, par7, par8, par9); - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityLimitedMobSpawner(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/a0c46501c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/a0c46501c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 66baf99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/a0c46501c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericLiving(new ModelHornBill(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "hornbill.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); - defaultBiomesToSpawn.add("Mini Jungle"); - defaultBiomesToSpawn.add("Extreme Jungle"); - defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d00380a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d00380a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 777aab8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/d00380a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/e16c01e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/e16c01e5c42100141fce95f06aba7e85 deleted file mode 100644 index 72c2cc9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/e16c01e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/f0595ee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/f0595ee5c42100141fce95f06aba7e85 deleted file mode 100644 index 77f61c5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e7/f0595ee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBeaver; -import projectzulu.common.mobs.models.ModelBeaver; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BeaverDeclaration extends SpawnableDeclaration { - - public BeaverDeclaration() { - super("Beaver", 15, EntityBeaver.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (54 << 16) + (36 << 8) + 9; - eggColor2 = (67 << 16) + (45 << 8) + 11; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(10f, 2.0f, 0.2f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBeaver(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "beaver.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00eea000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00eea000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c8ffaec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/00eea000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import cpw.mods.fml.common.Loader; - -public class EntityBrownBear extends EntityBear { - - public EntityBrownBear(World par1World) { - super(par1World); - setSize(1.5f, 2.1f); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - } - - @Override - public int getTotalArmorValue() { - return 4; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 4), 1); - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/0108f6ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/0108f6ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e9228d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/0108f6ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,132 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; -import net.minecraft.util.ChatAllowedCharacters; - -import org.lwjgl.input.Keyboard; -import org.lwjgl.opengl.GL11; - -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class GuiTombstone extends GuiScreen { - /** - * This String is just a local copy of the characters allowed in text rendering of minecraft. - */ -// private static final char[] allowedCharacters = ChatAllowedCharacters.allowedCharacters; - - /** The title string that is displayed in the top-center of the screen. */ - protected String screenTitle = "Edit sign message:"; - - /** Reference to the sign object. */ - private TileEntityTombstone entitySign; - - /** Counts the number of screen updates. */ - private int updateCounter; - - /** The number of the line that is being edited. */ - private int editLine = 0; - - public GuiTombstone(TileEntityTombstone par1TileEntitySign) { - this.entitySign = par1TileEntitySign; - } - - /** - * Adds the buttons (and other controls) to the screen in question. - */ - @Override - public void initGui() { - this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - - /** - * Called when the screen is unloaded. Used to disable keyboard repeat events - */ - @Override - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - PacketTileText packet = new PacketTileText().setPacketData(entitySign.xCoord, entitySign.yCoord, - entitySign.zCoord, entitySign.signText); - ProjectZulu_Core.getPipeline().sendToServer(packet); - entitySign.setEditable(true); - } - - /** - * Called from the main game loop to update the screen. - */ - @Override - public void updateScreen() { - ++this.updateCounter; - } - - /** - * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). - */ - @Override - protected void actionPerformed(GuiButton par1GuiButton) { - if (par1GuiButton.enabled) { - if (par1GuiButton.id == 0) { - entitySign.markDirty(); - mc.displayGuiScreen((GuiScreen) null); - } - } - } - - /** - * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). - */ - @Override - protected void keyTyped(char keyChar, int keyID) { - if (keyID == Keyboard.KEY_UP) { - editLine = editLine - 1 >= 0 ? editLine - 1 : entitySign.signText.length - 1; - } - - if (keyID == Keyboard.KEY_DOWN || keyID == Keyboard.KEY_RETURN) { - editLine = editLine + 1 < entitySign.signText.length ? editLine + 1 : 0; - } - - if (keyID == Keyboard.KEY_BACK && entitySign.signText[editLine].length() > 0) { - entitySign.signText[editLine] = entitySign.signText[editLine].substring(0, - entitySign.signText[editLine].length() - 1); - } - - if (ChatAllowedCharacters.isAllowedCharacter(keyChar) && entitySign.signText[editLine].length() < entitySign.maxcharPerLine) { - entitySign.signText[editLine] = entitySign.signText[editLine] + keyChar; - } - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - - drawCenteredString(fontRendererObj, screenTitle, width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef(width / 2, 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - - float var7 = 0.0F; - GL11.glRotatef(var7, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - - if (updateCounter / 6 % 2 == 0) { - entitySign.lineBeingEdited = editLine; - } - - TileEntityRendererDispatcher.instance.renderTileEntityAt(entitySign, -0.5D, -0.75D, -0.5D, -1f); - entitySign.lineBeingEdited = -1; - GL11.glPopMatrix(); - super.drawScreen(par1, par2, par3); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/204e32a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/204e32a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4cdeb40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/204e32a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/211a1ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/211a1ae4c42100141fce95f06aba7e85 deleted file mode 100644 index a160c8e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/211a1ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelLizardHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADBASE; - private ModelRenderer FRILL3ROT; - private ModelRenderer FRILL4ROT; - - public ModelLizardHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("FRILL3ROT.Frill3", 37, 22); - setTextureOffset("HEADBASE.head", 0, 0); - setTextureOffset("HEADBASE.Frill1", 29, 22); - setTextureOffset("HEADBASE.Frill2", 29, 22); - setTextureOffset("FRILL4ROT.Frill4", 37, 22); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 0F, 3F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - FRILL3ROT = new ModelRenderer(this, "FRILL3ROT"); - FRILL3ROT.setRotationPoint(1F, -2F, -2.5F); - setRotation(FRILL3ROT, 0F, 0F, 0F); - FRILL3ROT.mirror = true; - FRILL3ROT.addBox("Frill3", 0F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL3ROT); - HEADBASE.addBox("head", -3F, -3F, -8F, 6, 6, 8); - HEADBASE.addBox("Frill1", 3F, -2F, -3F, 3, 5, 1); - HEADBASE.addBox("Frill2", -6F, -2F, -3F, 3, 5, 1); - FRILL4ROT = new ModelRenderer(this, "FRILL4ROT"); - FRILL4ROT.setRotationPoint(-1F, -2F, -2.5F); - setRotation(FRILL4ROT, 0F, 0F, 0F); - FRILL4ROT.mirror = true; - FRILL4ROT.addBox("Frill4", -4F, -2F, -0.5F, 4, 4, 1); - HEADBASE.addChild(FRILL4ROT); - CENTERROT.addChild(HEADBASE); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - FRILL3ROT.rotateAngleZ = (float)( -45*Math.PI/180 ); - FRILL4ROT.rotateAngleZ = (float)( 45*Math.PI/180 ); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/51a53ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/51a53ae5c42100141fce95f06aba7e85 deleted file mode 100644 index e235fe4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/51a53ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityRedFinch extends EntityFinch{ - - public EntityRedFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/603cf2f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/603cf2f4c42100141fce95f06aba7e85 deleted file mode 100644 index f8f60fd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/603cf2f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,122 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class EntityPZPotion extends EntityPotion { - - private ItemStack potionStack; - - public EntityPZPotion(World par1World) { - super(par1World); - } - - public EntityPZPotion(World world, EntityLivingBase living, ItemStack itemStack) { - super(world, living, itemStack); - potionStack = itemStack; - } - - public EntityPZPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { - super(par1World, par2, par4, par6, par8ItemStack); - potionStack = par8ItemStack; - } - - @Override - public int getPotionDamage() { - return potionStack != null ? potionStack.getItemDamage() : 0; - } - - @Override - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { - if (!this.worldObj.isRemote && potionStack.getItem() != null && potionStack.getItem() instanceof ItemPotion) { - @SuppressWarnings("unchecked") - List effectList = ((ItemPotion) potionStack.getItem()).getEffects(potionStack); - - if (effectList != null && !effectList.isEmpty()) { - AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - @SuppressWarnings("unchecked") - List entityList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, - axisalignedbb); - - if (entityList != null && !entityList.isEmpty()) { - Iterator iterator = entityList.iterator(); - - while (iterator.hasNext()) { - EntityLivingBase entityliving = iterator.next(); - double squareDistance = this.getDistanceSqToEntity(entityliving); - - if (squareDistance < 16.0D) { - double distanceFactor = 1.0D - Math.sqrt(squareDistance) / 4.0D; - - if (entityliving == par1MovingObjectPosition.entityHit) { - distanceFactor = 1.0D; - } - - Iterator iterator1 = effectList.iterator(); - - while (iterator1.hasNext()) { - PotionEffect potioneffect = iterator1.next(); - int potionID = potioneffect.getPotionID(); - - if (Potion.potionTypes[potionID].isInstant()) { - Potion.potionTypes[potionID].affectEntity(this.getThrower(), entityliving, - potioneffect.getAmplifier(), distanceFactor); - } else { - int potionDuration = (int) (distanceFactor * potioneffect.getDuration() + 0.5D); - - if (potionDuration > 20) { - entityliving.addPotionEffect(new PotionEffect(potionID, potionDuration, - potioneffect.getAmplifier())); - } - } - } - } - } - } - } - - this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), - (int) Math.round(this.posZ), potionStack.getItemDamage()); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - if (par1NBTTagCompound.hasKey("Potion")) { - potionStack = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); - } - - if (potionStack == null) { - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - if (potionStack != null) { - par1NBTTagCompound.setTag("Potion", potionStack.writeToNBT(new NBTTagCompound())); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/60e2cfffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/60e2cfffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 857c34b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/60e2cfffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,42 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluStairs; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeStairsDeclaration extends BlockDeclaration { - - public PalmTreeStairsDeclaration() { - super("PalmTreeStairs", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeStairs = Optional.of(new BlockZuluStairs(BlockList.palmTreePlank.get(), 0).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeStairs.isPresent()) { - Block block = BlockList.palmTreeStairs.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("stairsWood", new ItemStack(block)); - OreDictionary.registerOre("stairsPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/721d439ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/721d439ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0c06600..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/721d439ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraftforge.common.config.Configuration; - -public class EntityProperties { - public final float maxHealth; - public final float attackDamage; - public final float moveSpeed; - public final float followRange; - public final float knockbackResistance; - public final float flightChance; - - public EntityProperties(float health, float strength, float moveSpeed) { - this(health, strength, moveSpeed, 0); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance) { - this(health, strength, moveSpeed, flightChance, 0.0f, 32.0f); - } - - public EntityProperties(float health, float strength, float moveSpeed, float flightChance, float knockback, float followRange) { - this.maxHealth = health; - this.attackDamage = strength; - this.moveSpeed = moveSpeed; - this.flightChance = flightChance; - this.knockbackResistance = knockback; - this.followRange = followRange; - } - - public EntityProperties createFromConfig(Configuration config, String entityName) { - float maxHealth = (float) config.get("MOB CONTROLS." + entityName, "maxHealth", this.maxHealth).getDouble( - this.maxHealth); - float attackDamage = (float) config.get("MOB CONTROLS." + entityName, "attackDamage", this.attackDamage) - .getDouble(this.attackDamage); - float moveSpeed = (float) config.get("MOB CONTROLS." + entityName, "moveSpeed", this.moveSpeed).getDouble( - this.moveSpeed); - float flightChance = (float) config.get("MOB CONTROLS." + entityName, "flightChance", this.flightChance) - .getDouble(this.flightChance); - float knockbackResistance = (float) config.get("MOB CONTROLS." + entityName, "knockbackResistance", - this.knockbackResistance).getDouble(this.knockbackResistance); - float followRange = (float) config.get("MOB CONTROLS." + entityName, "followRange", this.followRange) - .getDouble(this.followRange); - return new EntityProperties(maxHealth, attackDamage, moveSpeed, flightChance, knockbackResistance, followRange); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/80b2eafec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/80b2eafec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index b9083bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/80b2eafec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityPenguin; -import projectzulu.common.mobs.models.ModelPenguin; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PenguinDeclaration extends SpawnableDeclaration { - - public PenguinDeclaration() { - super("Penguin", 14, EntityPenguin.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (22 << 16) + (16 << 8) + 13; - eggColor2 = (235 << 16) + (235 << 8) + 235; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPenguin(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "penguin.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.icePlains.biomeName); - defaultBiomesToSpawn.add("Ice Wasteland"); - defaultBiomesToSpawn.add("Glacier"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FROZEN)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/91edce9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/91edce9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 673132a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/91edce9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public interface BlueprintSet { - ArrayList blueprints = new ArrayList(); - - /** - * Determined if the BlueprintSet should be applied {@link#assignCellsWithBlueprints} to the cell. It is not used to - * determine if {@link#getBlockFromBlueprint} should function. - */ - public abstract boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random); - - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID); - - public abstract String getIdentifier(); - - public abstract int getWeight(); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/a07b8c00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/a07b8c00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4d8445b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/a07b8c00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,563 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getAABBPool() - .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/b21c5bfec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/b21c5bfec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa6ed0e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/b21c5bfec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserLiquid extends KeyParserBase { - - public KeyParserLiquid(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isLiquid = world - .getBlock(xCoord + offsetX + i, yCoord + offsetY + j, zCoord + offsetZ + k) - .getMaterial().isLiquid(); - if (!isInverted && isLiquid || isInverted && !isLiquid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/d0381ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/d0381ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 805dae7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/d0381ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,39 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockQuickSand extends Block { - public BlockQuickSand() { - super(Material.sand); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.2F); - setStepSound(Block.soundTypeSand); - } - - @Override - public boolean isOpaqueCube() { - return true; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - /** - * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - par5Entity.setInWeb(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/e104b1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/e104b1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a8da8c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/e104b1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,103 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityRabbit extends EntityGenericAnimal implements IAnimals { - - public EntityRabbit(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - getNavigator().setAvoidsWater(true); - - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.carrot, false, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.apple, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbithurt"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "rabbitdead"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && (itemStack.getItem() == Items.apple || itemStack.getItem() == Items.carrot)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/e13ca3f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/e13ca3f5c42100141fce95f06aba7e85 deleted file mode 100644 index e6d0ca7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/e13ca3f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIStayStill extends EntityAIBase { - private EntityGenericAnimal theEntity; - EntityStates triggeringState; - public EntityAIStayStill(EntityGenericAnimal par1EntityTameable, EntityStates triggeringState) { - this.theEntity = par1EntityTameable; - this.setMutexBits(5); - this.triggeringState = triggeringState; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntity.isInWater()){ - return false; - } - else if (!this.theEntity.onGround){ - return false; - } - else{ - return theEntity.getEntityState() == triggeringState; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.theEntity.getNavigator().clearPathEntity(); - } - - /** - * Resets the task - */ - public void resetTask(){ - - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f15b26ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f15b26ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c1cd6e4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f15b26ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.Collections; -import java.util.List; - -import com.google.common.base.Optional; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ItemGenerics.Properties; -import projectzulu.common.potion.PotionParser; - -public class SubItemPotionBubbling extends SubItemPotion { - - PotionRecipies recipies = new PotionRecipies(); - - public SubItemPotionBubbling(Item item, int subID) { - super(item, subID, "potion.shining"); - } - - @Override - public void register() { - recipies.addResultPotion(Items.golden_carrot, SubItemPotionList.NIGHT_VISION); - recipies.addResultPotion(Items.magma_cream, SubItemPotionList.FIRE_RESISTANCE); - recipies.addResultPotion(Items.sugar, SubItemPotionList.MOVE_SPEED); - recipies.addResultPotion(Items.speckled_melon, SubItemPotionList.HEAL); - recipies.addResultPotion(Items.spider_eye, SubItemPotionList.POISON); - recipies.addResultPotion(Items.ghast_tear, SubItemPotionList.REGENERATION); - recipies.addResultPotion(Items.fermented_spider_eye, SubItemPotionList.WEAKNESS); - if (ItemList.genericCraftingItems.isPresent()) { - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Talon.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.LargeHeart.meta, - SubItemPotionList.STRENGTH); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.RabbitsFoot.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.FrogLegs.meta, - SubItemPotionList.JUMP); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.SmallHeart.meta, - SubItemPotionList.DIG_SPEED); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PowderSlush.meta, - SubItemPotionList.CLEANSING); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.PricklyPowder.meta, - SubItemPotionList.THORNS); - recipies.addResultPotion(ItemList.genericCraftingItems.get(), Properties.Gill.meta, - SubItemPotionList.WATER_BREATHING); - } - } - - @Override - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion resultingPotion = recipies.getResulingPotion(ingredient.getItem(), ingredient.getItemDamage()); - if (resultingPotion != null) { - return new ItemStack(resultingPotion.item, 1, PotionParser.setID(resultingPotion.subID, 0)); - } - return null; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return false; - } - - @Override - public List getPotionEffects(int damageMeta) { - return Collections.emptyList(); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - list.add(new ItemStack(itemID, 1, subID)); - } - - @Override - public boolean isEffectInstant(int damageMeta) { - return false; - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f160d0f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f160d0f8c42100141fce95f06aba7e85 deleted file mode 100644 index 143096e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e8/f160d0f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityLizard; -import com.ngb.projectzulu.common.mobs.models.ModelLizard; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/0029c0e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/0029c0e5c42100141fce95f06aba7e85 deleted file mode 100644 index 2b8f553..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/0029c0e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class RenderSnow extends RenderGenericLiving { - public final ResourceLocation snowTexture; - - public RenderSnow(ModelBase modelBase, float shadowSize, ResourceLocation livingLocation, - ResourceLocation snowTexture) { - super(modelBase, shadowSize, livingLocation); - this.snowTexture = snowTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (BiomeDictionary.isBiomeOfType(entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ), - Type.FROZEN)) { - return snowTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/010f68a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/010f68a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ef33a4b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/010f68a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,28 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class TileEntityWithMeta extends BlockWithMeta { - - public TileEntity tileEntity; - - public TileEntityWithMeta(Block block, int meta, TileEntity tileEntity) { - super(block, meta); - this.tileEntity = tileEntity; - } - - public TileEntityWithMeta(Block block, TileEntity tileEntity) { - this(block, 0, tileEntity); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/1067b701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/1067b701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2bb03ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/1067b701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,147 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetStairs implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetStairs() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "stairs"; - } - - @Override - public int getWeight() { - return 0; - } - - public boolean attemptAssignBlueprint(MazeCell[][] bottomFloor, MazeCell[][] topFloor, Point buildCoords, - Random rand) { - if (topFloor[buildCoords.x][buildCoords.y].rawState == 0 - && topFloor[buildCoords.x][buildCoords.y + 1].rawState >= 0 - ) { - Point botCoords = convertCellCoords(buildCoords.x, buildCoords.y, topFloor, bottomFloor); - if (bottomFloor[botCoords.x][botCoords.y - 1].rawState == 0 - && bottomFloor[botCoords.x][botCoords.y].rawState == 1 - && bottomFloor[botCoords.x][botCoords.y + 1].rawState == 1) { - if (rand.nextInt(1) == 0) { - topFloor[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier() + "-top_1", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y].rawState = -1; - topFloor[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier() + "-top_2", - CellIndexDirection.Middle); - topFloor[buildCoords.x][buildCoords.y + 1].rawState = -1; - - bottomFloor[botCoords.x][botCoords.y].setBuildingProperties(getIdentifier() + "-bottom_1", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y].rawState = -1; - bottomFloor[botCoords.x][botCoords.y + 1].setBuildingProperties(getIdentifier() + "-bottom_2", - CellIndexDirection.Middle); - bottomFloor[botCoords.x][botCoords.y + 1].rawState = -1; - return true; - } - } - } - return false; - } - - /** - * Gets the Cell coords in the DestinationCells that coorspond to the same physical location as the in the origin - * cell. Only considers XZ Plane. - * - * @param coords - * @param originCells - * @param destinCells - * @return - */ - private Point convertCellCoords(int originX, int originY, MazeCell[][] originCells, MazeCell[][] destinCells) { - ChunkCoordinates chunkCoords = originCells[originX][originY].initialPos; - for (int i = 0; i < destinCells.length; i++) { - for (int j = 0; j < destinCells[0].length; j++) { - if (chunkCoords.posX == destinCells[i][j].initialPos.posX - && chunkCoords.posZ == destinCells[i][j].initialPos.posZ) { - return new Point(i, j); - } - } - } - return new Point(-1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String[] subIndex = buildingID.split("-")[1].split("_"); - - if (subIndex[0].equalsIgnoreCase("bottom")) { - return getBottomStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } else if (subIndex[0].equalsIgnoreCase("top")) { - return getTopStairBlock(piecePos, cellSize, cellHeight, cellIndexDirection, random, - Integer.parseInt(subIndex[1])); - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getBottomStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - index = index - 1; - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } - - if (piecePos.posX == 0) { - if (piecePos.posY > (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == (piecePos.posZ + 1) + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - public BlockWithMeta getTopStairBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, int index) { - boolean requiresStairs = index != 1; - index = index + (cellSize - cellHeight - 2); - if (piecePos.posY == 0) { - if (piecePos.posX != 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (requiresStairs && piecePos.posY == (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone_stairs, 2); - } else if (requiresStairs && piecePos.posY < (piecePos.posZ + 1) + index) { - return new BlockWithMeta(Blocks.sandstone); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - throw new UnsupportedOperationException(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/21e524f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/21e524f5c42100141fce95f06aba7e85 deleted file mode 100644 index 7f4da1a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/21e524f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; - -public class RenderGenericHorse extends RenderGenericLiving { - - public final ResourceLocation saddledTexture; - - public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, - ResourceLocation saddledTexture) { - super(modelBase, shadowSize, wildTexture); - this.saddledTexture = saddledTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (entity instanceof EntityGenericAnimal) { - EntityGenericAnimal animal = (EntityGenericAnimal) entity; - if (animal.getSaddled()) { - return saddledTexture; - } - } - return livingTexture; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/30b977e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/30b977e6c42100141fce95f06aba7e85 deleted file mode 100644 index f64996f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/30b977e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/314d81ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/314d81ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3061b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/314d81ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.world2.randomizer; - -import java.util.EnumSet; -import java.util.Random; - -import net.minecraft.world.World; -import projectzulu.common.world2.Direction; -import projectzulu.common.world2.MazeCell; - -public class WalledMazeRandomizer extends Randomizer { - - Random random; - - public WalledMazeRandomizer(World world) { - this.random = world.rand; - } - - @Override - public void randomize(MazeCell[][] allCells) { - /* Mark Outer Cells As Walls (X axis) */ - for (int i = 0; i < allCells.length; i++) { - int k = 0; - allCells[i][k].rawState = 1; - k = allCells[0].length - 1; - allCells[i][k].rawState = 1; - } - - /* Mark Outer Cells As Walls (Z axis) */ - for (int k = 0; k < allCells[0].length; k++) { - int i = 0; - allCells[i][k].rawState = 1; - i = allCells.length - 1; - allCells[i][k].rawState = 1; - } - - /* Perform X wall placement attempts, then Assume that the maze is sufficiently random/complete */ - int attemptsSinceLastPlaced = 0; - while (attemptsSinceLastPlaced < 800) { - - /* Decide Random Length, Random Direction to try Placing Walls */ - int randLength = random.nextInt(6) + 1; - Direction direction = Direction.getCardinal(random); - - /* Select Wall to Try to Place at */ - int selectedX = random.nextInt(allCells.length); - int selectedZ = random.nextInt(allCells[0].length); - while (allCells[selectedX][selectedZ].rawState != 1) { - selectedX = random.nextInt(allCells.length); - selectedZ = random.nextInt(allCells[0].length); - } - - if (isCellWallValid(allCells, selectedX, selectedZ, direction, randLength)) { - for (int i = 1; i <= randLength; i++) { - int tempX = selectedX + direction.x * i; - int tempZ = selectedZ + direction.z * i; - allCells[tempX][tempZ].rawState = 1; - } - attemptsSinceLastPlaced = 0; - } else { - attemptsSinceLastPlaced++; - } - } - } - - /** - * Evaluates if a wall of cells (of length randLength in direction) without touching another wall cell - * - * @param allCells - * @param selectedX,Z Starting Wall Cell that Wall is Placed off of - * @param direction Direction to generate wall of cells - * @param randLength Length of wall of cells to place - * @return - */ - protected boolean isCellWallValid(MazeCell[][] allCells, int selectedX, int selectedZ, Direction direction, - int randLength) { - - for (int i = 1; i <= randLength; i++) { - int cellToPlaceX = selectedX + direction.x * i; - int cellToPlaceZ = selectedZ + direction.z * i; - - if (isCellOutOfBounds(allCells, cellToPlaceX, cellToPlaceZ) - || allCells[cellToPlaceX][cellToPlaceZ].rawState == 1) { - return false; - } - - /* - * Never check previous cell, it should be a wall. Ignore maze edge by only check the 'Forward Hemisphere' - * (+- 90o from Direction) on edge cells. - */ - EnumSet neighbourDirections = Direction.getOrdinals(); - neighbourDirections.remove(direction.invert()); - neighbourDirections.remove(direction.invert().rotateOrdinal(true)); - neighbourDirections.remove(direction.invert().rotateOrdinal(false)); - - for (Direction cellDirection : neighbourDirections) { - int neighbourCellX = cellToPlaceX + cellDirection.x; - int neighbourCellZ = cellToPlaceZ + cellDirection.z; - - if (isCellOutOfBounds(allCells, neighbourCellX, neighbourCellZ)) { - continue; - } - - if (allCells[neighbourCellX][neighbourCellZ].rawState == 1) { - return false; - } - - if (isCellSurrounded(allCells, neighbourCellX, neighbourCellZ)) { - return false; - } - - } - } - return true; - } - - /** - * Evaluates if the Provided Cells X,Z is surrounded by other walls - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - protected boolean isCellSurrounded(MazeCell[][] allCells, int currentX, int currentZ) { - int numberOfSidesOccupied = 0; - - for (Direction direction : Direction.getCardinals()) { - int neighbourX = currentX + direction.x; - int neighbourZ = currentZ + direction.z; - - if (isCellOutOfBounds(allCells, neighbourX, neighbourZ)) { - continue; - } - - if (allCells[neighbourX][neighbourZ].rawState == 1) { - numberOfSidesOccupied++; - } - } - - return numberOfSidesOccupied < 4 ? false : true; - } - - /** - * Evaluates if the Cell is Out of Bounds - * - * @param allCells - * @param currentX - * @param currentZ - * @return - */ - private boolean isCellOutOfBounds(MazeCell[][] allCells, int currentX, int currentZ) { - return currentX < 0 || currentX >= allCells.length || currentZ < 0 || currentZ >= allCells[0].length; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/50acacf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/50acacf8c42100141fce95f06aba7e85 deleted file mode 100644 index f87ea35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/50acacf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,262 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityHauntedArmor; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/50eb75f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/50eb75f5c42100141fce95f06aba7e85 deleted file mode 100644 index 19fe516..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/50eb75f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseRandom; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/60b25affc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/60b25affc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cc7ea5f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/60b25affc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericLimited implements BlueprintSet { - - Blueprint blueprint; - int validState; - final int maxToAssign; - private int assigned = 0; - public BPSetGenericLimited(Blueprint blueprint, int validState, int maxToAssign) { - this.blueprint = blueprint; - this.validState = validState; - this.maxToAssign = maxToAssign; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - assigned++; - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validState && assigned < maxToAssign; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/61039ae5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/61039ae5c42100141fce95f06aba7e85 deleted file mode 100644 index 6dbc811..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/61039ae5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,262 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/70f755ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/70f755ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8a28ab9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/70f755ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/80c6caf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/80c6caf9c42100141fce95f06aba7e85 deleted file mode 100644 index bd38950..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/80c6caf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks.util; - -import com.google.common.base.CharMatcher; - -public class StringHelper { - - public static String simplifyStringNameForDisplay(String string, int characterLimit, String splitString){ - /* Remove Surpluous Creature Data (ProjectZulu.Armadillo) */ - String[] stringParts = string.split(splitString); - String displayName; - /* Shorten Name to Declared Number of Character */ - if(stringParts.length > 0){ - displayName = stringParts[stringParts.length-1]; - }else{ - displayName = string; - } - - if(displayName.length() > characterLimit){ - displayName = displayName.substring(0, characterLimit); - } - return displayName; - } - - public static String toTitleCase(String string){ - return string.toUpperCase().replace(string.toUpperCase().substring(1), string.substring(1).toLowerCase()); - } - - public static int parseInteger(String integer, String regexRetain){ - return Integer.parseInt(CharMatcher.anyOf(regexRetain).retainFrom(integer)); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/80e4c5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/80e4c5f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3749e28..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/80e4c5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/8100fdf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/8100fdf6c42100141fce95f06aba7e85 deleted file mode 100644 index 5897a55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/8100fdf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemZuluArmor; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a01e88f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a01e88f6c42100141fce95f06aba7e85 deleted file mode 100644 index 5dd3700..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/a01e88f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import net.minecraft.entity.player.EntityPlayer; - -public interface PZPacket { - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to encode into - */ - public abstract void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * - * @param ctx channel context - * @param buffer the buffer to decode from - */ - public abstract void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer); - - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); - - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/b142b5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/b142b5f9c42100141fce95f06aba7e85 deleted file mode 100644 index f4a83ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/b142b5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraft.item.Item; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; - -import com.google.common.base.Optional; - -import cpw.mods.fml.relauncher.Side; - -public abstract class ItemDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public ItemDeclaration(String name) { - this(name, 0); - } - - public ItemDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Item; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("item", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createItem(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createItem(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerItem(); - if (!side.isServer()) { - clientRegisterItem(); - } - } - } - - protected abstract void registerItem(); - - protected void clientRegisterItem() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d01aabf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d01aabf7c42100141fce95f06aba7e85 deleted file mode 100644 index d50a2a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d01aabf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,93 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelVultureHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer HEADROT; - - - public ModelVultureHead(){ - textureWidth = 64; - textureHeight = 32; - setTextureOffset("NECKROT1.neck1", 8, 10); - setTextureOffset("NECKROT2.neck2", 8, 10); - setTextureOffset("NECKROT3.neck3", 8, 10); - setTextureOffset("HEADROT.mouthbot", 0, 25); - setTextureOffset("HEADROT.mouthtal", 6, 25); - setTextureOffset("HEADROT.mouthtop", 0, 21); - setTextureOffset("HEADROT.head", 0, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0.5F, 24.5F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, 0F, 1F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -0.5F, -2F, -0.5F, 1, 2, 1); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -2F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -0.5F, -2F, -0.5F, 1, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -2F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("mouthbot", -0.5F, 0.5F, -4F, 1, 1, 2); - HEADROT.addBox("mouthtal", -1F, 0.5F, -5F, 2, 2, 1); - HEADROT.addBox("mouthtop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - NECKROT3.addChild(HEADROT); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - BODYROT.addChild(NECKROT1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - switch ((int)skullState) { - case 1: - NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); - break; - - default: - NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); - NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); - NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); - HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d05612fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d05612fac42100141fce95f06aba7e85 deleted file mode 100644 index 5a89b36..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/d05612fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemFoodProjectZulu; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutMilkFragmentDeclaration extends ItemDeclaration { - - public CoconutMilkFragmentDeclaration() { - super("CoconutMilkFragment"); - } - - @Override - protected boolean createItem() { - ItemList.coconutMilkFragment = Optional.of(new ItemFoodProjectZulu(2, 2.4f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutMilkFragment.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/e079ca01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/e079ca01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b7d51e0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/e079ca01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisGrass implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - return air; - } - - @Override - public int getWeight() { - return 100; - } - - @Override - public String getIdentifier() { - return "OasisGrass"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/e1ada5f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/e1ada5f5c42100141fce95f06aba7e85 deleted file mode 100644 index 887f2aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/e1ada5f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,94 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAIPanic extends EntityAIBase { - private EntityGenericCreature theEntityCreature; - private float speed; - private double randPosX; - private double randPosY; - private double randPosZ; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2) { - this.theEntityCreature = par1EntityCreature; - this.speed = par2; - this.setMutexBits(1); - } - - public EntityAIPanic(EntityGenericCreature par1EntityCreature, float par2, boolean shouldHop) { - this(par1EntityCreature, par2); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.theEntityCreature.getEntityState() != EntityStates.fleeing) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); - - if (var1 == null) { - return false; - } - else { - this.randPosX = var1.xCoord; - this.randPosY = var1.yCoord; - this.randPosZ = var1.zCoord; - return true; - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.theEntityCreature.getNavigator().noPath(); - } - - @Override - public void resetTask() { - super.resetTask(); - } - - public void tryToHop(){ - if (theEntityCreature.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theEntityCreature.getJumpHelper().setJumping(); - theEntityCreature.getNavigator().setSpeed(speed); - } - else{ - theEntityCreature.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/f0109cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/f0109cf5c42100141fce95f06aba7e85 deleted file mode 100644 index 5974289..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/e9/f0109cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Random; - -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/003f6ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/003f6ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4346f18..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/003f6ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCampFire extends ItemBlock { - - public ItemCampFire(Block block) { - super(block); - setHasSubtypes(true); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return Block.getBlockFromItem(this).getIcon(2, par1); - } - - @Override - public String getUnlocalizedName(ItemStack itemstack) { - return "tile." - + BlockCampfire.Type.getTypeByMeta(itemstack.getItemDamage()).displayName().toLowerCase() - .replaceAll("\\s", ""); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/0088d49ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/0088d49ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d67559e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/0088d49ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityHauntedArmor extends EntityGenericAnimal implements IMob { - - protected int wakeUpTimer = 0; - - public int getWakeUpTimer() { - return wakeUpTimer; - } - - protected int randomDirection = 0; - boolean shouldHover = false; - - public EntityHauntedArmor(World par1World) { - super(par1World); - randomDirection = rand.nextInt(16); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - public EntityHauntedArmor(World par1World, double parx, double pary, double parz, boolean shouldHover) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - this.shouldHover = shouldHover; - } - - public void setPersistenceRequired(boolean persistenceRequired) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_82179_bU", EntityLiving.class, this, true, false, - true); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("persistenceRequired", EntityLiving.class, this, true, true); - } - } - - public void setRandomArmor(World world) { - int number = world.rand.nextInt(2); - switch (number) { - case 0: - setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.iron_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.iron_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.iron_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.iron_boots)); - break; - case 1: - setCurrentItemOrArmor(0, new ItemStack(Items.golden_sword)); - setCurrentItemOrArmor(1, new ItemStack(Items.golden_helmet)); - setCurrentItemOrArmor(2, new ItemStack(Items.golden_chestplate)); - setCurrentItemOrArmor(3, new ItemStack(Items.golden_leggings)); - setCurrentItemOrArmor(4, new ItemStack(Items.golden_boots)); - } - } - - @Override - public IEntityLivingData onSpawnWithEgg(IEntityLivingData par1EntityLivingData) { - IEntityLivingData entityLivingData = super.onSpawnWithEgg(par1EntityLivingData); - setRandomArmor(worldObj); - return entityLivingData; - } - - @Override - protected String getHurtSound() { - return "random.break"; - } - - @Override - protected String getDeathSound() { - return "random.break"; - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; - if (var1 > 20) { - var1 = 20; - } - return var1; - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - public void onLivingUpdate() { - if (shouldHover == true) { - this.motionY = 0; - if (ticksExisted > (20 * 10)) { - shouldHover = false; - } - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 5D) != null) { - angerLevel = 400; - wakeUpTimer = 30; - } - - wakeUpTimer = Math.max(wakeUpTimer - 1, 0); - } - - @Override - protected void dropEquipment(boolean par1, int par2) { - if (worldObj.rand.nextInt(4) == 0) { - super.dropEquipment(par1, par2); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/008ce011eeac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/008ce011eeac0014196dc3517d78505a new file mode 100644 index 0000000..a5c3bd8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/008ce011eeac0014196dc3517d78505a @@ -0,0 +1,288 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelDeer extends ModelBase + { + float heightToRaise = 5f; + float renderScale = 1.3f; + + //fields + ModelRenderer top4hornRight; + ModelRenderer top4hornLeft; + ModelRenderer top3hornRight; + ModelRenderer top3hornLeft; + ModelRenderer top1hornRight; + ModelRenderer top1hornLeft; + ModelRenderer HEADROT; + ModelRenderer hornLeft; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer neck; + ModelRenderer BODYROT; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer tail; + ModelRenderer top2hornLeft; + ModelRenderer hornRight; + ModelRenderer top2hornRight; + + public ModelDeer() + { + textureWidth = 64; + textureHeight = 64; + + HEADROT = new ModelRenderer(this, 1, 19); + HEADROT.addBox(-1.5F, -6F, -7F, 5, 4, 7); + HEADROT.setRotationPoint(-2F, 4F - heightToRaise , -6F); + HEADROT.setTextureSize(64, 64); + HEADROT.mirror = true; + setRotation(HEADROT, 0.5230717F, 0F, 0F); + + earLeft = new ModelRenderer(this, 43, 33); + earLeft.addBox(0F, 1F, 0F, 1, 3, 1); + //earLeft.setRotationPoint(0F, 0.5F, -9F); + earLeft.setRotationPoint(2F, -3.5F, -2.0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, -2.199115F); + HEADROT.addChild(earLeft); + + earRight = new ModelRenderer(this, 50, 33); + earRight.addBox(-1F, 1F, 0F, 1, 3, 1); + //earRight.setRotationPoint(-2F, 0.5F, -9F); + earRight.setRotationPoint(-0.5F, -3.5F, -2.0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, 2.199115F); + HEADROT.addChild(earRight); + + hornLeft = new ModelRenderer(this, 8, 5); + hornLeft.addBox(0F, -3F, 0F, 1, 5, 1); + //hornLeft.setRotationPoint(0F, -3F, -9F); + hornLeft.setRotationPoint(2F, -8F, -2F); + hornLeft.setTextureSize(64, 64); + hornLeft.mirror = true; + setRotation(hornLeft, -0.5410521F, 0.1396263F, 0F); + HEADROT.addChild(hornLeft); + + hornRight = new ModelRenderer(this, 2, 5); + hornRight.addBox(-1F, -3F, 0F, 1, 5, 1); + //hornRight.setRotationPoint(-2F, -3F, -9F); + hornRight.setRotationPoint(0F, -8F, -2F); + hornRight.setTextureSize(64, 64); + hornRight.mirror = true; + setRotation(hornRight, -0.5410521F, -0.1396263F, 0F); + HEADROT.addChild(hornRight); + + top2hornLeft = new ModelRenderer(this, 21, 5); + top2hornLeft.addBox(0F, -3F, 0F, 1, 4, 1); + //top2hornLeft.setRotationPoint(0.3F, -5.5F, -8F); + top2hornLeft.setRotationPoint(0.3F, -3.5F, 0F); + top2hornLeft.setTextureSize(64, 64); + top2hornLeft.mirror = true; + setRotation(top2hornLeft, 0.6372665F, 0.0349066F, 0.0523599F); + hornLeft.addChild(top2hornLeft); + + top2hornRight = new ModelRenderer(this, 15, 5); + top2hornRight.addBox(-1F, -3F, 0F, 1, 4, 1); + //top2hornRight.setRotationPoint(-2.3F, -5.5F, -8F); + top2hornRight.setRotationPoint(0F, -3.5F, 0F); + top2hornRight.setTextureSize(64, 64); + top2hornRight.mirror = true; + setRotation(top2hornRight, 0.6372665F, -0.0349066F, -0.0523599F); + hornRight.addChild(top2hornRight); + + top1hornRight = new ModelRenderer(this, 41, 5); + top1hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top1hornRight.setRotationPoint(-2.4F, -7.5F, -8F); + top1hornRight.setRotationPoint(-0.4F, -2.0F, -0F); + top1hornRight.setTextureSize(64, 64); + top1hornRight.mirror = true; + setRotation(top1hornRight, 1.047198F, 0.1047198F, 0F); + top2hornRight.addChild(top1hornRight); + + top1hornLeft = new ModelRenderer(this, 41, 10); + top1hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top1hornLeft.setRotationPoint(0.5F, -7.5F, -8F); + top1hornLeft.setRotationPoint(0.5F, -2.0F, -0F); + top1hornLeft.setTextureSize(64, 64); + top1hornLeft.mirror = true; + setRotation(top1hornLeft, 1.047198F, -0.1047198F, 0F); + top2hornLeft.addChild(top1hornLeft); + + top3hornRight = new ModelRenderer(this, 34, 5); + top3hornRight.addBox(-1F, -3F, 0F, 1, 3, 1); + //top3hornRight.setRotationPoint(-2.2F, -5F, -8F); + top3hornRight.setRotationPoint(-0.2F, -2.0F, 0F); + top3hornRight.setTextureSize(64, 64); + top3hornRight.mirror = true; + setRotation(top3hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top3hornRight); + + top3hornLeft = new ModelRenderer(this, 34, 10); + top3hornLeft.addBox(0F, -3F, 0F, 1, 3, 1); + //top3hornLeft.setRotationPoint(0.2F, -5F, -8F); + top3hornLeft.setRotationPoint(0.2F, -2.0F, 0F); + top3hornLeft.setTextureSize(64, 64); + top3hornLeft.mirror = true; + setRotation(top3hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top3hornLeft); + + top4hornRight = new ModelRenderer(this, 28, 5); + top4hornRight.addBox(-1F, -3F, 0F, 1, 2, 1); + //top4hornRight.setRotationPoint(-2F, -2F, -8F); + top4hornRight.setRotationPoint(-0F, 1.5F, 1.5F); + top4hornRight.setTextureSize(64, 64); + top4hornRight.mirror = true; + setRotation(top4hornRight, 1.747198F, 0.1047198F, 0F); + hornRight.addChild(top4hornRight); + + top4hornLeft = new ModelRenderer(this, 28, 9); + top4hornLeft.addBox(0F, -3F, 0F, 1, 2, 1); + //top4hornLeft.setRotationPoint(0F, -2F, -8F); + top4hornLeft.setRotationPoint(0F, 1.5F, 1.5F); + top4hornLeft.setTextureSize(64, 64); + top4hornLeft.mirror = true; + setRotation(top4hornLeft, 1.72173F, -0.1047198F, 0F); + hornLeft.addChild(top4hornLeft); + + neck = new ModelRenderer(this, 28, 21); + neck.addBox(0F, -2F, -2F, 4, 3, 8); + neck.setRotationPoint(-3F, 2F - heightToRaise, -8F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, -0.9294653F, 0F, 0F); + BODYROT = new ModelRenderer(this, 28, 41); + BODYROT.addBox(-4F, -8F, -5F, 8, 15, 6); + BODYROT.setRotationPoint(-1F, 6F - heightToRaise, 1F); + BODYROT.setTextureSize(64, 64); + BODYROT.mirror = true; + setRotation(BODYROT, 1.570796F, 0F, 0F); + leg1 = new ModelRenderer(this, 0, 32); + leg1.addBox(-1F, 0F, -1F, 3, 10, 3); + leg1.setRotationPoint(-4F, 11F - heightToRaise, 6F); + leg1.setTextureSize(64, 64); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 13, 32); + leg2.addBox(-1F, 0F, -1F, 3, 10, 3); + leg2.setRotationPoint(1F, 11F - heightToRaise, 6F); + leg2.setTextureSize(64, 64); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 13, 49); + leg3.addBox(-2F, 0F, -1F, 3, 10, 3); + leg3.setRotationPoint(-3F, 11F - heightToRaise, -6F); + leg3.setTextureSize(64, 64); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 0, 49); + leg4.addBox(-1F, 0F, -1F, 3, 10, 3); + leg4.setRotationPoint(1F, 11F - heightToRaise, -6F); + leg4.setTextureSize(64, 64); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + tail = new ModelRenderer(this, 28, 34); + tail.addBox(-1F, 0F, 0F, 2, 1, 3); + tail.setRotationPoint(-1F, 5.5F - heightToRaise, 7F); + tail.setTextureSize(64, 64); + tail.mirror = true; + setRotation(tail, -0.4506874F, 0F, 0F); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //top4hornRight.render(f5); + //top4hornLeft.render(f5); + //top3hornRight.render(f5); + //top3hornLeft.render(f5); + //top2hornLeft.render(f5); + //top2hornRight.render(f5); + //top1hornRight.render(f5); + //top1hornLeft.render(f5); + //hornLeft.render(f5); + //hornRight.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + HEADROT.render(renderScale * f5); + neck.render(renderScale * f5); + BODYROT.render(renderScale * f5); + leg1.render(renderScale * f5); + leg2.render(renderScale * f5); + leg3.render(renderScale * f5); + leg4.render(renderScale * f5); + tail.render(renderScale * f5); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Constant Animation Rotations */ + leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + + /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math + .log(par3 + 1))); + + earLeft.rotateAngleY = (float) (70 * Math.PI / 180 + MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1))); + earRight.rotateAngleY = (float) (-70 * Math.PI / 180 - MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.2F + * ModelHelper.abs(Math.log(par3 + 1)));*/ + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + //HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); + //HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); + HEAD.rotateAngleX = f3 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + } + + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/2153c9a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/2153c9a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 91d1bb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/2153c9a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package projectzulu.common.core; - -/** - * For usage see: {@link Pair} - */ -public class PairDirectoryFile { - private final K directory; - private final V file; - - public static PairDirectoryFile createPair(K directory, V file) { - return new PairDirectoryFile(directory, file); - } - - public PairDirectoryFile(K directory, V file) { - this.file = file; - this.directory = directory; - } - - public K getDirectory() { - return directory; - } - - public V getFile() { - return file; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairDirectoryFile)) { return false; } - PairDirectoryFile pair = (PairDirectoryFile)object; - return directory.equals(pair.directory) && file.equals(pair.file); - } - - @Override - public int hashCode(){ - return 7 * directory.hashCode() + 13 * file.hashCode(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/303683f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/303683f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3d5fc59..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/303683f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; - -public class NBTTree { - private NBTNode root; - - public NBTTree(NBTBase rootData, String rootName) { - root = new NBTNode(rootData, null, rootName); - } - - public NBTNode getRootNode() { - return root; - } - - public boolean addNode(NBTBase data, NBTNode parent, String tagName) { - return parent.addChild(data, tagName); - } - - public void removeChildNode(NBTNode nodeToRemove, NBTNode parentNode) { - parentNode.removeChild(nodeToRemove); - } - - public NBTTagCompound toNBTTagCompound() { - NBTTagCompound nbtTagCompound = new NBTTagCompound(); - root.writeNodeandChildrenToNBT(nbtTagCompound); - return (NBTTagCompound) nbtTagCompound.getTag("Properties"); - } - - public ArrayList toArrayList() { - ArrayList nodeList = new ArrayList(); - root.writeNodeandChildrenToArrayList(nodeList); - return nodeList; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/51c510f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/51c510f9c42100141fce95f06aba7e85 deleted file mode 100644 index 6824def..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/51c510f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,404 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/900bca9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/900bca9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5e7b1fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/900bca9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public interface Blueprint { - - /** - * - * @param pieceLoc X,Y,Z Coordinate of Piece within Cell - * @param cellSize - * @param maxHeight - * @param xIndex - * @param zIndex - * @param random - * @param cellIndexDirection - * @return - */ - public abstract BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection); - - /** - * Used to Search Architect list for a specific Building Type - * - * Type insensitive. Should be unique. - */ - public abstract String getIdentifier(); - - public abstract int getWeight(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/909530a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/909530a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2a7d9b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/909530a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,127 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGiraffeHead extends ModelBase{ - - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - - public ModelGiraffeHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, 24F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - NECKROT2.render(f5); - } -// null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - // NECKROT1.rotateAngleX = (float) (75*Math.PI/180); - switch ((int)skullState) { - case 0: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - case 1: - NECKROT2.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) ( 5*Math.PI/180); - break; - default: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - } - NECKROT2.rotateAngleY = f3 / (180F / (float)Math.PI); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a07371f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a07371f4c42100141fce95f06aba7e85 deleted file mode 100644 index 1bc607d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/a07371f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetGenericCardinal implements BlueprintSet { - Blueprint blueprint; - int validRawState; - - public BPSetGenericCardinal(Blueprint blueprint, int validRawState) { - this.blueprint = blueprint; - this.validRawState = validRawState; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.randomCardinalDirection(random)); - return true; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == validRawState ? true : false; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/b29a579fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/b29a579fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 068d4dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/b29a579fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,439 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntitySandWorm; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelSandWorm extends ModelBase { - ModelRenderer HEADBASE; - ModelRenderer head; - - ModelRenderer REARROT; - ModelRenderer LEFMOROT; - ModelRenderer lefmo8; - ModelRenderer lefmo6; - ModelRenderer lefmo4; - ModelRenderer lefmo2; - ModelRenderer lefmot1; - ModelRenderer lefmot2; - - ModelRenderer RIGMOROT; - ModelRenderer rigmo8; - ModelRenderer rigmo6; - ModelRenderer rigmo4; - ModelRenderer rigmo2; - ModelRenderer rigmot1; - ModelRenderer rigmot2; - - ModelRenderer TOPMOROT; - ModelRenderer topmo8; - ModelRenderer topmo6; - ModelRenderer topmo4; - ModelRenderer topmo2; - ModelRenderer topmot1; - ModelRenderer topmot2; - - ModelRenderer BOTMOROT; - ModelRenderer botmo8; - ModelRenderer botmo6; - ModelRenderer botmo4; - ModelRenderer botmo2; - ModelRenderer botmot1; - ModelRenderer botmot2; - - ModelRenderer body1; - - ModelRenderer REARROT2; - ModelRenderer body2; - ModelRenderer REARROT3; - ModelRenderer body3; - ModelRenderer REARROT4; - ModelRenderer body4; - ModelRenderer REARROT5; - ModelRenderer body5; - ModelRenderer REARROT6; - ModelRenderer body6; - ModelRenderer REARROT7; - ModelRenderer body7; - - public ModelSandWorm() { - textureWidth = 64; - textureHeight = 32; - float heightToRaise = 12.0f; - // setTextureOffset("HEADBASE.dltfold5", 0, 0); - // setTextureOffset("REARROT.dltfold6", 0, 0); - - HEADBASE = new ModelRenderer(this, "HEADBASE"); - HEADBASE.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - head = new ModelRenderer(this, 18, 0); - head.addBox(-4F, -4F, -4F, 8, 8, 4); - HEADBASE.addChild(head); - head.setRotationPoint(0F, 0F, 0F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - LEFMOROT = new ModelRenderer(this, "LEFMOROT"); - HEADBASE.addChild(LEFMOROT); - LEFMOROT.setRotationPoint(-3F, 0F, -4F); - setRotation(LEFMOROT, 0F, 0F, 0F); - LEFMOROT.mirror = true; - lefmo8 = new ModelRenderer(this, 0, 10); - lefmo8.addBox(0F, 0F, 0F, 1, 8, 1); - LEFMOROT.addChild(lefmo8); - lefmo8.setRotationPoint(-1F, -4F, -1F); - lefmo8.setTextureSize(64, 32); - lefmo8.mirror = true; - setRotation(lefmo8, 0F, 0F, 0F); - lefmo6 = new ModelRenderer(this, 4, 10); - lefmo6.addBox(0F, 0F, 0F, 1, 6, 1); - LEFMOROT.addChild(lefmo6); - lefmo6.setRotationPoint(0F, -3F, -1F); - lefmo6.setTextureSize(64, 32); - lefmo6.mirror = true; - setRotation(lefmo6, 0F, 0F, 0F); - lefmo4 = new ModelRenderer(this, 8, 10); - lefmo4.addBox(0F, 0F, 0F, 1, 4, 1); - LEFMOROT.addChild(lefmo4); - lefmo4.setRotationPoint(1F, -2F, -1F); - lefmo4.setTextureSize(64, 32); - lefmo4.mirror = true; - setRotation(lefmo4, 0F, 0F, 0F); - lefmo2 = new ModelRenderer(this, 12, 10); - lefmo2.addBox(0F, 0F, 0F, 1, 2, 1); - LEFMOROT.addChild(lefmo2); - lefmo2.setRotationPoint(2F, -1F, 0F); - lefmo2.setTextureSize(64, 32); - lefmo2.mirror = true; - setRotation(lefmo2, 0F, 0F, 0F); - lefmot2 = new ModelRenderer(this, 12, 13); - lefmot2.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot2); - lefmot2.setRotationPoint(1F, -2F, 0F); - lefmot2.setTextureSize(64, 32); - lefmot2.mirror = true; - setRotation(lefmot2, 0F, 0F, 0F); - lefmot1 = new ModelRenderer(this, 12, 13); - lefmot1.addBox(0F, 0F, 0F, 1, 1, 1); - LEFMOROT.addChild(lefmot1); - lefmot1.setRotationPoint(1F, 1F, 0F); - lefmot1.setTextureSize(64, 32); - lefmot1.mirror = true; - setRotation(lefmot1, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(LEFMOROT); - RIGMOROT = new ModelRenderer(this, "RIGMOROT"); - HEADBASE.addChild(RIGMOROT); - RIGMOROT.setRotationPoint(3F, 0F, -4F); - setRotation(RIGMOROT, 0F, 0F, 0F); - RIGMOROT.mirror = true; - rigmo8 = new ModelRenderer(this, 0, 10); - rigmo8.addBox(0F, 0F, 0F, 1, 8, 1); - RIGMOROT.addChild(rigmo8); - rigmo8.setRotationPoint(0F, -4F, -1F); - rigmo8.setTextureSize(64, 32); - rigmo8.mirror = true; - setRotation(rigmo8, 0F, 0F, 0F); - rigmo6 = new ModelRenderer(this, 4, 10); - rigmo6.addBox(0F, 0F, 0F, 1, 6, 1); - rigmo6.setRotationPoint(-1F, -3F, -1F); - RIGMOROT.addChild(rigmo6); - rigmo6.setTextureSize(64, 32); - rigmo6.mirror = true; - setRotation(rigmo6, 0F, 0F, 0F); - rigmo4 = new ModelRenderer(this, 8, 10); - rigmo4.addBox(0F, 0F, 0F, 1, 4, 1); - rigmo4.setRotationPoint(-2F, -2F, -1F); - RIGMOROT.addChild(rigmo4); - rigmo4.setTextureSize(64, 32); - rigmo4.mirror = true; - setRotation(rigmo4, 0F, 0F, 0F); - rigmo2 = new ModelRenderer(this, 12, 10); - rigmo2.addBox(0F, 0F, 0F, 1, 2, 1); - RIGMOROT.addChild(rigmo2); - rigmo2.setRotationPoint(-3F, -1F, -1F); - rigmo2.setTextureSize(64, 32); - rigmo2.mirror = true; - setRotation(rigmo2, 0F, 0F, 0F); - rigmot1 = new ModelRenderer(this, 12, 13); - rigmot1.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot1); - rigmot1.setRotationPoint(-2F, -2F, 0F); - rigmot1.setTextureSize(64, 32); - rigmot1.mirror = true; - setRotation(rigmot1, 0F, 0F, 0F); - rigmot2 = new ModelRenderer(this, 12, 13); - rigmot2.addBox(0F, 0F, 0F, 1, 1, 1); - RIGMOROT.addChild(rigmot2); - rigmot2.setRotationPoint(-2F, 1F, 0F); - rigmot2.setTextureSize(64, 32); - rigmot2.mirror = true; - setRotation(rigmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(RIGMOROT); - TOPMOROT = new ModelRenderer(this, "TOPMOROT"); - HEADBASE.addChild(TOPMOROT); - TOPMOROT.setRotationPoint(0F, -3F, -4F); - setRotation(TOPMOROT, 0F, 0F, 0F); - TOPMOROT.mirror = true; - topmo8 = new ModelRenderer(this, 0, 19); - topmo8.addBox(0F, -1F, 0F, 8, 1, 1); - TOPMOROT.addChild(topmo8); - topmo8.setRotationPoint(-4F, 0F, -1F); - topmo8.setTextureSize(64, 32); - topmo8.mirror = true; - setRotation(topmo8, 0F, 0F, 0F); - topmo6 = new ModelRenderer(this, 0, 21); - topmo6.addBox(0F, 0F, 0F, 6, 1, 1); - TOPMOROT.addChild(topmo6); - topmo6.setRotationPoint(-3F, 0F, -1F); - topmo6.setTextureSize(64, 32); - topmo6.mirror = true; - setRotation(topmo6, 0F, 0F, 0F); - topmo4 = new ModelRenderer(this, 0, 23); - topmo4.addBox(0F, 0F, 0F, 4, 1, 1); - TOPMOROT.addChild(topmo4); - topmo4.setRotationPoint(-2F, 1F, -1F); - topmo4.setTextureSize(64, 32); - topmo4.mirror = true; - setRotation(topmo4, 0F, 0F, 0F); - topmo2 = new ModelRenderer(this, 0, 25); - topmo2.addBox(0F, 0F, 0F, 2, 1, 1); - TOPMOROT.addChild(topmo2); - topmo2.setRotationPoint(-1F, 2F, -1F); - topmo2.setTextureSize(64, 32); - topmo2.mirror = true; - setRotation(topmo2, 0F, 0F, 0F); - topmot1 = new ModelRenderer(this, 7, 25); - topmot1.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot1); - topmot1.setRotationPoint(-2F, 1F, 0F); - topmot1.setTextureSize(64, 32); - topmot1.mirror = true; - setRotation(topmot1, 0F, 0F, 0F); - topmot2 = new ModelRenderer(this, 7, 25); - topmot2.addBox(0F, 0F, 0F, 1, 1, 1); - TOPMOROT.addChild(topmot2); - topmot2.setRotationPoint(1F, 1F, 0F); - topmot2.setTextureSize(64, 32); - topmot2.mirror = true; - setRotation(topmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(TOPMOROT); - BOTMOROT = new ModelRenderer(this, "BOTMOROT"); - HEADBASE.addChild(BOTMOROT); - BOTMOROT.setRotationPoint(0F, 3F, -4F); - setRotation(BOTMOROT, 0F, 0F, 0F); - BOTMOROT.mirror = true; - botmo4 = new ModelRenderer(this, 0, 23); - botmo4.addBox(0F, 0F, 0F, 4, 1, 1); - BOTMOROT.addChild(botmo4); - botmo4.setRotationPoint(-2F, -2F, -1F); - botmo4.setTextureSize(64, 32); - botmo4.mirror = true; - setRotation(botmo4, 0F, 0F, 0F); - botmo6 = new ModelRenderer(this, 0, 21); - botmo6.addBox(0F, 0F, 0F, 6, 1, 1); - BOTMOROT.addChild(botmo6); - botmo6.setRotationPoint(-3F, -1F, -1F); - botmo6.setTextureSize(64, 32); - botmo6.mirror = true; - setRotation(botmo6, 0F, 0F, 0F); - botmo2 = new ModelRenderer(this, 0, 25); - botmo2.addBox(0F, 0F, 0F, 2, 1, 1); - BOTMOROT.addChild(botmo2); - botmo2.setRotationPoint(-1F, -3F, -1F); - botmo2.setTextureSize(64, 32); - botmo2.mirror = true; - setRotation(botmo2, 0F, 0F, 0F); - botmo8 = new ModelRenderer(this, 0, 19); - botmo8.addBox(0F, 0F, 0F, 8, 1, 1); - BOTMOROT.addChild(botmo8); - botmo8.setRotationPoint(-4F, 0F, -1F); - botmo8.setTextureSize(64, 32); - botmo8.mirror = true; - setRotation(botmo8, 0F, 0F, 0F); - botmot1 = new ModelRenderer(this, 7, 25); - botmot1.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot1); - botmot1.setRotationPoint(-2F, -2F, 0F); - botmot1.setTextureSize(64, 32); - botmot1.mirror = true; - setRotation(botmot1, 0F, 0F, 0F); - botmot2 = new ModelRenderer(this, 7, 25); - botmot2.addBox(0F, 0F, 0F, 1, 1, 1); - BOTMOROT.addChild(botmot2); - botmot2.setRotationPoint(1F, -2F, 0F); - botmot2.setTextureSize(64, 32); - botmot2.mirror = true; - setRotation(botmot2, 0F, 0F, 0F); - // dltfold5.addChildModelRenderer(BOTMOROT); - - REARROT = new ModelRenderer(this, "REARROT"); - REARROT.setRotationPoint(0F, 20F - heightToRaise, -6F); - setRotation(REARROT, 0F, 0F, 0F); - REARROT.mirror = true; - body1 = new ModelRenderer(this, 14, 20); - body1.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT.addChild(body1); - body1.setRotationPoint(0F, 0F, 2F); - body1.setTextureSize(64, 32); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - - REARROT2 = new ModelRenderer(this, "REARROT2"); - REARROT.addChild(REARROT2); - REARROT2.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT2, 0F, 0F, 0F); - REARROT2.mirror = true; - body2 = new ModelRenderer(this, 14, 20); - body2.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT2.addChild(body2); - body2.setRotationPoint(0F, 0F, 2F); - body2.setTextureSize(64, 32); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - - REARROT3 = new ModelRenderer(this, "REARROT3"); - REARROT2.addChild(REARROT3); - REARROT3.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT3, 0F, 0F, 0F); - REARROT3.mirror = true; - body3 = new ModelRenderer(this, 14, 20); - body3.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT3.addChild(body3); - body3.setRotationPoint(0F, 0F, 2F); - body3.setTextureSize(64, 32); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - - REARROT4 = new ModelRenderer(this, "REARROT4"); - REARROT3.addChild(REARROT4); - REARROT4.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT4, 0F, 0F, 0F); - REARROT4.mirror = true; - body4 = new ModelRenderer(this, 14, 20); - body4.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT4.addChild(body4); - body4.setRotationPoint(0F, 0F, 2F); - body4.setTextureSize(64, 32); - body4.mirror = true; - setRotation(body4, 0F, 0F, 0F); - - REARROT5 = new ModelRenderer(this, "REARROT5"); - REARROT4.addChild(REARROT5); - REARROT5.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT5, 0F, 0F, 0F); - REARROT5.mirror = true; - body5 = new ModelRenderer(this, 39, 20); - body5.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT5.addChild(body5); - body5.setRotationPoint(0F, 0F, 2F); - body5.setTextureSize(64, 32); - body5.mirror = true; - setRotation(body5, 0F, 0F, 0F); - - REARROT6 = new ModelRenderer(this, "REARROT6"); - REARROT5.addChild(REARROT6); - REARROT6.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT6, 0F, 0F, 0F); - REARROT6.mirror = true; - body6 = new ModelRenderer(this, 39, 20); - body6.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT6.addChild(body6); - body6.setRotationPoint(0F, 0F, 2F); - body6.setTextureSize(64, 32); - body6.mirror = true; - setRotation(body6, 0F, 0F, 0F); - - REARROT7 = new ModelRenderer(this, "REARROT7"); - REARROT6.addChild(REARROT7); - REARROT7.setRotationPoint(0F, 0F, 4F); - setRotation(REARROT7, 0F, 0F, 0F); - REARROT7.mirror = true; - body7 = new ModelRenderer(this, 39, 20); - body7.addBox(-4F, -4F, -2F, 8, 8, 4); - REARROT7.addChild(body7); - body7.setRotationPoint(0F, 0F, 2F); - body7.setTextureSize(64, 32); - body7.mirror = true; - setRotation(body7, 0F, 0F, 0F); - - } - - @Override - public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6) { - super.render(entity, f1, f2, f3, f4, f5, f6); - setRotationAngles(f1, f2, f3, f4, f5, f6, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADBASE.render(2 * f6); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - REARROT.render(2 * f6); - GL11.glPopMatrix(); - } else { - HEADBASE.render(2 * f6); - REARROT.render(2 * f6); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntitySandWorm var5 = (EntitySandWorm) par1EntityLiving; - if (var5.getEntityState() == EntityStates.idle) { - /* Mandables are at Position 0 when Hiding */ - TOPMOROT.rotateAngleX = 0.0f; - LEFMOROT.rotateAngleY = 0.0f; - RIGMOROT.rotateAngleY = 0.0f; - BOTMOROT.rotateAngleX = 0.0f; - - REARROT.rotateAngleY = 0.0f; - REARROT2.rotateAngleY = 0.0f; - REARROT3.rotateAngleY = 0.0f; - REARROT4.rotateAngleY = 0.0f; - REARROT5.rotateAngleY = 0.0f; - REARROT6.rotateAngleY = 0.0f; - REARROT7.rotateAngleY = 0.0f; - } else { - float animSpeed = 1.0f; - TOPMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 - Math.PI / 2f); - LEFMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 2.0F * par3 + Math.PI / 2f); - RIGMOROT.rotateAngleY = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 - Math.PI / 2f); - BOTMOROT.rotateAngleX = (float) (MathHelper.cos(animSpeed * par2 * 0.6662F) * 2.0F * par3 + Math.PI / 2f); - - REARROT.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F) * 0.5F * par3; - REARROT2.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI / 3) * 0.5F * par3; - REARROT3.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 2 / 3) * 0.5F * par3; - REARROT4.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - REARROT5.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 4 / 3) * 0.5F * par3; - REARROT6.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 5 / 3) * 0.5F * par3; - REARROT7.rotateAngleY = MathHelper.cos(animSpeed * par2 * 0.6662F - (float) Math.PI * 6 / 3) * 0.5F * par3; - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/e00b23a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/e00b23a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5fa2c4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/e00b23a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,110 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserNormalCube extends KeyParserBase { - - public KeyParserNormalCube(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 2 || pieces.length == 3) { - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[1].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 3) { - String[] offsetPieces = pieces[2].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ, offsetX, offsetY, - offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - if (values.length == 4 || values.length == 7) { - int rangeX = (Integer) values[1]; - int rangeY = (Integer) values[2]; - int rangeZ = (Integer) values[3]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 7) { - offsetX = (Integer) values[4]; - offsetY = (Integer) values[5]; - offsetZ = (Integer) values[6]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isNormal = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isNormalCube(); - if (!isInverted && isNormal || isInverted && !isNormal) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/e22a0bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/e22a0bfac42100141fce95f06aba7e85 deleted file mode 100644 index fa7524a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/e22a0bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import com.ngb.projectzulu.common.potion.brewingstands.PotionIngredients; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class GenericCraftingItemsDeclaration extends ItemDeclaration { - - public GenericCraftingItemsDeclaration() { - super("GenericCraftingItems1"); - } - - @Override - protected boolean createItem() { - ItemGenerics itemGenerics = (ItemGenerics) new ItemGenerics(); - ItemList.genericCraftingItems = Optional.of(itemGenerics); - PotionIngredients.addIngredientProperties(itemGenerics, itemGenerics); - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.genericCraftingItems.get(); - OreDictionary.registerOre("foodSalt", new ItemStack(item, 1, ItemGenerics.Properties.Salt.meta())); - GameRegistry.registerItem(item, name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/f1d8a9fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/f1d8a9fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b157bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ea/f1d8a9fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,116 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMinotaur extends EntityGenericAnimal implements IMob { - - /* General Ability Variables */ - int ticksToCheckAbilities = 3; - - /* Charge Variables */ - protected boolean isCharging = false; - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityMinotaur(World par1World) { - super(par1World); - myEntitySize = EnumEntitySize.SIZE_6; - setSize(1.0f, 2.4f); - experienceValue = 7; - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.3f * 2.3f)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, - // EntityStates.looking), EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - @Override - protected String getLivingSound() { - return "mob.cow.say"; - } - - @Override - public int getTalkInterval() { - return 160; - } - - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.cow.step", 0.15F, 1.0F); - } - - @Override - protected void updateAITick() { - this.angerLevel = 100; - super.updateAITick(); - } - - @Override - public void onLivingUpdate() { - this.isInWeb = false; - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) {// && targetedEntity != null && - // this.getDistanceToEntity(targetedEntity) - // < 20.0f){ - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/1075319fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/1075319fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 468931c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/1075319fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Blocks; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityTreeEnt; -import projectzulu.common.mobs.models.ModelTreeEnt; -import projectzulu.common.mobs.renders.RenderSnow; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TreeEntDeclaration extends SpawnableDeclaration { - - public TreeEntDeclaration() { - super("TreeEnt", 7, EntityTreeEnt.class, EnumCreatureType.creature); - setSpawnProperties(1, 7, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (17 << 16) + (6 << 8) + 3; - eggColor2 = (83 << 16) + (56 << 8) + 29; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Blocks.log, 1, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Bark.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderSnow(new ModelTreeEnt(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "treeent.png"), - new ResourceLocation(DefaultProps.mobKey, "treeent_snow.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add("Alpine"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Snowy Rainforest"); - - HashSet nonFrozenForest = new HashSet(); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.retainAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/1166f7f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/1166f7f7c42100141fce95f06aba7e85 deleted file mode 100644 index a84e914..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/1166f7f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisSandCorner implements Blueprint { - - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1 || piecePos.posY == 2) { - return sand; - } - return null; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "SandCorer"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20c696fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20c696fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5fd2b60..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/20c696fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,340 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.Properties; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/31b91df5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/31b91df5c42100141fce95f06aba7e85 deleted file mode 100644 index 6ef024c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/31b91df5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,12 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.util.ResourceLocation; - -public class RenderMimic extends RenderGenericLiving { - public static final ResourceLocation normalChest = new ResourceLocation("textures/entity/chest/normal.png"); - - public RenderMimic(ModelBase modelBase, float shadowSize, ResourceLocation textureLocation) { - super(modelBase, shadowSize, textureLocation); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/507a73f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/507a73f5c42100141fce95f06aba7e85 deleted file mode 100644 index 143096e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/507a73f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityLizard; -import com.ngb.projectzulu.common.mobs.models.ModelLizard; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/60cea4f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/60cea4f6c42100141fce95f06aba7e85 deleted file mode 100644 index 239891b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/60cea4f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package com.ngb.projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public abstract class BlockDeclaration implements ItemBlockDeclaration { - - private int registerPass; - public final String name; - private boolean isEnabled = true; - private boolean isCreated = false; - - public BlockDeclaration(String name) { - this(name, 0); - } - - public BlockDeclaration(String name, int registerPass) { - this.name = name; - this.registerPass = registerPass; - } - - @Override - public Type getType() { - return Type.Block; - } - - @Override - public int getRegisterPass() { - return registerPass; - } - - @Override - public final void createWithConfig(Configuration config, boolean readOnly) { - if (!readOnly) { - Property property = config.get("block", name + " isEnabled", isEnabled); - isEnabled = property.getBoolean(isEnabled); - if (isEnabled) { - preCreateLoadConfig(config); - isCreated = createBlock(); - postCreateLoadConfig(config); - } - } - } - - protected void preCreateLoadConfig(Configuration config) { - - } - - protected void postCreateLoadConfig(Configuration config) { - - } - - protected abstract boolean createBlock(); - - @Override - public final void register(Side side) { - if (isCreated) { - registerBlock(); - if (!side.isServer()) { - clientRegisterBlock(); - } - } - } - - protected abstract void registerBlock(); - - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/70eb5fe6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/70eb5fe6c42100141fce95f06aba7e85 deleted file mode 100644 index 09163c3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/70eb5fe6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/715935f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/715935f8c42100141fce95f06aba7e85 deleted file mode 100644 index bfa584d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/715935f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.mobs.entity.EntityHauntedArmor; - -public class HauntedArmorWithMeta extends BlockWithMeta { - - public HauntedArmorWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityHauntedArmor mob = new EntityHauntedArmor(world, position.posX + 0.5, position.posY, - position.posZ + 0.5, true); - mob.onSpawnWithEgg(null); - mob.setPersistenceRequired(true); - world.spawnEntityInWorld(mob); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/8062c9f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/8062c9f5c42100141fce95f06aba7e85 deleted file mode 100644 index 6824def..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/8062c9f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,404 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFireball; -import net.minecraft.entity.projectile.EntityLargeFireball; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { - - Vec3 startingPosition; - int stage = 1; - - boolean spawnMummy = false; - // Time To Wait after spawning to spawn another - int spawnCooldown = 4 * 20; - // Counter. When 0 its okay to spawn another - int spawnTimer = 60; - - boolean shootFireball = false; - int shootCooldown = 6 * 20; - int shootTimer = 30; - private static final ItemStack defaultHeldItem = ItemList.ankh.isPresent() ? new ItemStack(ItemList.ankh.get()) - : new ItemStack(Items.iron_sword); - - public EntityMummyPharaoh(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(7, new EntityAIWander(this, 1.0f, 120)); - tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(9, new EntityAILookIdle(this)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EnumSet.allOf(EntityStates.class), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummyPharaoh(World par1World, double parx, double pary, double parz) { - this(par1World); - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - yOffset = 0.0f; - } - - @Override - public ItemStack getHeldItem() { - return defaultHeldItem; - } - - @Override - public int getTotalArmorValue() { - switch (stage) { - case 1: - return 4; - case 2: - return 6; - case 3: - return 8; - case 4: - return 10; - default: - return 2; - } - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyshortroar"; - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - // TODO: Some of THis could be moved Server Side Only - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - if (startingPosition == null) { - startingPosition = Vec3.createVectorHelper(posX, posY, posZ); - } - - switch (stage) { - case 1: - /* Stage One Update: If Condition Valid Change Stage */ - if (getHealth() < 0.9 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - - break; - case 2: - /* Stage Two Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - - /* Stage Two Update: If Condition Valid Change Stage */ - if (getHealth() < 0.7 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - case 3: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Update: If Condition Valid Change Stage */ - if (getHealth() < 0.45 * getMaxHealth()) { - teleportTo(startingPosition.xCoord, startingPosition.yCoord + 2, startingPosition.zCoord); - stage++; - } - break; - - case 4: - /* Stage Three Ability */ - if (spawnMummy == true && !worldObj.isRemote) { - spawnMummy(); - spawnMummy = false; - } - - /* Stage Three Ability */ - if (shootFireball == true && !worldObj.isRemote) { - shootFireballAtTarget(); - shootFireball = false; - } - break; - default: - break; - } - - /* If Spawn Timer is 0, tell Entity its Allowed to Summon a Mummy */ - if (spawnTimer == 0) { - spawnMummy = true; - spawnTimer = spawnCooldown; - } - spawnTimer = Math.max(spawnTimer - 1, 0); - - /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Fireball */ - if (shootTimer == 0) { - shootFireball = true; - shootTimer = shootCooldown; - } - shootTimer = Math.max(shootTimer - 1, 0); - } - - /** - * Called when the entity is attacked. - */ - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer tempPlayer = (EntityPlayer) par1DamageSource.getEntity(); - double distance = tempPlayer.getDistanceSqToEntity(this); - - if (distance > 10) { - int holdRand = rand.nextInt(2); - if (holdRand == 1) { - teleportTo(tempPlayer.posX + 1, - worldObj.getHeightValue((int) tempPlayer.posX + 1, (int) tempPlayer.posZ + 1), - tempPlayer.posZ + 1); - } - } else { - int holdRand = rand.nextInt(5); - if (holdRand == 4) { - teleportRandomly(); - } - } - } - return super.attackEntityFrom(par1DamageSource, par2); - } - - private void spawnMummy() { - // Get a Random Position Around Entity - double desX; - double desZ; - - int Min_Distance = 5; - int Max_Distance = 9; - - // These "hold" are here because putting Rand.nextint without assigning to variable first - // caused minecraft to get angry at me (/shrug) - int hold = rand.nextInt(2); - int hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desX = Math.floor(this.posX) + hold2; - } else { - desX = Math.floor(this.posX) - hold2; - } - - hold = rand.nextInt(2); - hold2 = rand.nextInt(Max_Distance - Min_Distance) + Min_Distance; - ; - if (hold != 0) { - desZ = Math.floor(this.posZ) + hold2; - } else { - desZ = Math.floor(this.posZ) - hold2; - } - - // Note this is not final Y height, this is just for ground level - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - // If the block is not air - if (worldObj.isAirBlock((int) desX, desY - 2, (int) desZ)) { - worldObj.setBlock((int) desX, desY - 0, (int) desZ, Blocks.air); - worldObj.setBlock((int) desX, desY - 1, (int) desZ, Blocks.air); - } - // This sets where the monster will spawn on Y relative to Ground Level - desY -= 1; - - // Adjust X and Z so that they are at Center of Block and Not Edge - desX += 0.5; - desZ += 0.5; - - EntityMummy var17 = new EntityMummy(this.worldObj, desX, desY, desZ); - this.worldObj.spawnEntityInWorld(var17); - } - - private void shootFireballAtTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double var11 = targetedEntity.posX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = targetedEntity.posZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, - (int) this.posZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 1.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - private void shootFireballAroundTarget() { - EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); - if (targetedEntity != null) { - int holdRand = rand.nextInt(10) - 5; - double sourcePositionX = this.posX + holdRand; - double sourcePositionY = this.posY + 20; - holdRand = rand.nextInt(10) - 5; - double sourcePositionZ = this.posZ + holdRand; - - double desX = targetedEntity.posX + rand.nextInt(10) - 5; - double desZ = targetedEntity.posZ + rand.nextInt(10) - 5; - int desY = this.worldObj.getHeightValue((int) desX, (int) desZ); - - double var11 = desX - sourcePositionX; - double var13 = targetedEntity.boundingBox.minY + targetedEntity.height / 2.0F - - (sourcePositionY + this.height / 2.0F); - double var15 = desZ - sourcePositionZ; - this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(var11, var15)) * 180.0F / (float) Math.PI; - - this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) desX, desY, (int) desZ, 0); - EntityFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - double var18 = 4.0D; - Vec3 var20 = this.getLook(1.0F); - var17.posX = sourcePositionX + var20.xCoord * var18; - var17.posY = sourcePositionY + this.height / 2.0F + 0.5D; - var17.posZ = sourcePositionZ + var20.zCoord * var18; - this.worldObj.spawnEntityInWorld(var17); - } - } - - /** - * Teleport the Pharoah to a random nearby position - */ - private boolean teleportRandomly() { - double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 24.0D; - double var3 = worldObj.getHeightValue((int) var1, (int) var5); - return this.teleportTo(var1, var3, var5); - } - - /** - * Teleport the Pharoah - */ - private boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; - this.posX = par1; - this.posY = par3; - this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - - if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - Block var18; - while (!var17 && var15 > 0) { - var18 = this.worldObj.getBlock(var14, var15 - 1, var16); - - if (var18 != null && var18.getMaterial().blocksMovement()) { - var17 = true; - } else { - --this.posY; - --var15; - } - } - - if (var17) { - this.setPosition(this.posX, this.posY, this.posZ); - - if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox)) { - var13 = true; - } - } - } - - if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - int var18; - for (var18 = 0; var18 < var30; ++var18) { - double var19 = var18 / (var30 - 1.0D); - float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; - float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; - double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * this.width * 2.0D; - double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * this.height; - double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * this.width - * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, var21, var22, var23); - } - - this.worldObj.playSoundEffect(var7, var9, var11, "mob.endermen.portal", 1.0F, 1.0F); - this.worldObj.playSoundAtEntity(this, "mob.endermen.portal", 1.0F, 1.0F); - return true; - } - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "mob.irongolem.walk", 1.0F, 1.0F); - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && ItemList.ankh.isPresent()) { - ItemStack var2 = new ItemStack(ItemList.ankh.get()); - this.entityDropItem(var2, 5.0F); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b04fb6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b04fb6f5c42100141fce95f06aba7e85 deleted file mode 100644 index 54887ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b04fb6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.pathfinding.PathFinder; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericRideable; - -public class EntityAIControlledByPlayer extends EntityAIBase { - private final EntityGenericRideable thisEntity; - private final float maxSpeed; - private float currentSpeed = 0.0F; - - private float maxRotation = 5.0f*2; - /** Whether the entity's speed is boosted. */ - private boolean speedBoosted = false; - - /** - * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled - */ - private int speedBoostTime = 0; - - /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime = 0; - - public EntityAIControlledByPlayer(EntityGenericRideable par1EntityLiving, float par2) { - this.thisEntity = par1EntityLiving; - this.maxSpeed = par2; - this.setMutexBits(7); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - - /** - * Resets the task - */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - - @Override - public boolean continueExecuting() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered() || this.thisEntity.shouldIgnorePlayerRot()); - - -// return super.continueExecuting(); - } - - /** - * Updates the task - */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityGenericRideable var2 = (EntityGenericRideable)this.thisEntity; - float var3; - if(var2.shouldIgnorePlayerRot()){ - var3 = 0f; - }else{ - var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; - } - - if (var3 > maxRotation) { - var3 = maxRotation; - } - - if (var3 < -maxRotation) { - var3 = -maxRotation; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); - - if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - - if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - - int var4 = MathHelper.floor_double(this.thisEntity.posX); - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; - - if (this.speedBoosted) { - if (this.speedBoostTime++ > this.maxSpeedBoostTime) - { - this.speedBoosted = false; - } - - var7 += var7 * 1.15F * MathHelper.sin((float)this.speedBoostTime / (float)this.maxSpeedBoostTime * (float)Math.PI); - } - - float var8 = 0.91F; - - if (this.thisEntity.onGround) { - var8 = 0.54600006F; - Block var9 = this.thisEntity.worldObj.getBlock(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); - - if (var9 != null) { - var8 = var9.slipperiness * 0.91F; - } - } - - float var21 = 0.16277136F / (var8 * var8 * var8); - float var10 = MathHelper.sin(var2.rotationYaw * (float)Math.PI / 180.0F); - float var11 = MathHelper.cos(var2.rotationYaw * (float)Math.PI / 180.0F); - float var12 = var2.getAIMoveSpeed() * var21; - float var13 = Math.max(var7, 1.0F); - var13 = var12 / var13; - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; - - if (MathHelper.abs(var15) > MathHelper.abs(var16)) { - if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - - if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } - else { - var15 = 0.0F; - - if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - - if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } - - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); - - if ((var4 != var17 || var6 != var18) && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - - if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var20 = var1.getHeldItem(); - - if (var20 != null && var20.getItem() == Items.carrot_on_a_stick) { - var20.damageItem(1, var1); - - if (var20.stackSize == 0) { - var1.inventory.mainInventory[var1.inventory.currentItem] = new ItemStack(Items.fishing_rod); - } - } - } - - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - - /** - * Return whether the entity's speed is boosted. - */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - - /** - * Boost the entity's movement speed. - */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - - /** - * Return whether the entity is being controlled by a player. - */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b0ede9f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b0ede9f6c42100141fce95f06aba7e85 deleted file mode 100644 index c93ef7a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/b0ede9f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,104 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/c0d07600c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/c0d07600c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 93881fa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/c0d07600c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/c1fd49f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/c1fd49f9c42100141fce95f06aba7e85 deleted file mode 100644 index 491b3c2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/c1fd49f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag; - -import com.ngb.projectzulu.common.dungeon.spawner.tag.keys.Key; - - -public class TypeValuePair { - - private final Key type; - private final Object value; - - public static TypeValuePair createPair(Key type, Object value) { - return new TypeValuePair(type, value); - } - - public TypeValuePair(Key type, Object value) { - this.type = type; - this.value = value; - } - - public Key getType() { - return type; - } - - public Object getValue() { - return value; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0ee0100c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0ee0100c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0cf6193..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/e0ee0100c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f097a4a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f097a4a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9a7f238..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f097a4a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,96 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIWander extends EntityAIBase -{ - private EntityGenericCreature entity; - private double xPosition; - private double yPosition; - private double zPosition; - private float speed; - private int chanceToMove; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIWander(EntityGenericCreature par1EntityCreature, float speed, int chanceToMove) { - this.entity = par1EntityCreature; - this.speed = speed; - this.setMutexBits(1); - this.chanceToMove = chanceToMove; - } - public EntityAIWander(EntityGenericCreature par1EntityCreature, float speed, int chanceToMove, boolean shouldHop ) { - this(par1EntityCreature, speed, chanceToMove); - this.shouldHop = shouldHop; - } - - - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.entity.getAge() >= 100 && !entity.isEntityGrounded()) { - return false; - } - else if (this.entity.getRNG().nextInt(chanceToMove) != 0) { - return false; - } - else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); - - if (var1 == null) { - return false; - } - else { - this.xPosition = var1.xCoord; - this.yPosition = var1.yCoord; - this.zPosition = var1.zCoord; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - return !this.entity.getNavigator().noPath(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - if(shouldHop){ - tryToHop(); - } - } - - - public void tryToHop(){ - if (entity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - entity.getJumpHelper().setJumping(); - entity.getNavigator().setSpeed(speed); - } - else{ - entity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return entity.getRNG().nextInt(20) + 10; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f0e5a39fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f0e5a39fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5466309..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f0e5a39fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Collection; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.potion.PotionParser; - -import com.google.common.collect.HashBasedTable; -import com.google.common.collect.Table; - -/** - * This allows Registry of PotionItem readers. - * - * Each SubID represents a "Family" of Upgradeable Potions "i.e. SlowFall, Slowfall Extended, Slowfall Extended II". - * Used for determining Display Name, if an Ingredient is applicable, etc. Uniquely defined by SubID. - * - * For ItemPotions, ItemDamage (32bit Integer) is Parsed for properties. - * - * Only Reserved Bits are the First 4 bits for SubID bit 13 for Splash - * - * Note this is NOT Potion Effects (See {@link Potion}). A Reference to the relevent PoionID(s) is typically kept. - */ -public enum SubItemPotionRegistry { - INSTANCE; - private Table subPotions = HashBasedTable.create(2, 16); - private Table itemAndNameToSubIDMap = HashBasedTable.create(2, 16); - - public void addSubPotions(SubItemPotion... potionSubItems) { - for (SubItemPotion subItemPotion : potionSubItems) { - if (subPotions.row(subItemPotion.item).keySet().contains(subItemPotion.subID)) { - ProjectZuluLog.info("Potion Conflict: Replacing Potion at %s:%s with %s", subItemPotion.item, - subItemPotion.subID, subItemPotion.baseName); - } - subPotions.put(subItemPotion.item, subItemPotion.subID, subItemPotion); - itemAndNameToSubIDMap.put(subItemPotion.item, subItemPotion.baseName, subItemPotion.subID); - } - } - - public Collection getPotions(Item item) { - return subPotions.row(item).values(); - } - - public SubItemPotion getPotion(ItemStack itemStack) { - return getPotion(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())); - } - - public SubItemPotion getPotion(Item itemID, int subID) { - return subPotions.get(itemID, subID); - } - - public SubItemPotion getPotion(int itemID, String name) { - Integer subID = itemAndNameToSubIDMap.get(itemID, name); - return subID != null ? subPotions.get(itemID, subID) : null; - } - - public boolean isItemPotion(ItemStack itemStack) { - return itemStack != null ? subPotions.get(itemStack.getItem(), PotionParser.readID(itemStack.getItemDamage())) != null - : false; - } - - public boolean isItemPotion(Item itemID) { - return !subPotions.row(itemID).isEmpty(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f27934f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f27934f9c42100141fce95f06aba7e85 deleted file mode 100644 index 028572d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/eb/f27934f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/01a1389fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/01a1389fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d325bf3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/01a1389fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,198 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -public class ModelCentipede extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelCentipede() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - sidebody2.render(f5); - body.render(f5); - sidebody3.render(f5); - sidebody1.render(f5); - ANTENLEFROT1.render(f5); - ANTENRIGROT1.render(f5); - LEG11ROT.render(f5); - LEG21ROT.render(f5); - LEG31ROT.render(f5); - LEG41ROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - - ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/1025f9f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/1025f9f5c42100141fce95f06aba7e85 deleted file mode 100644 index 69a6d9f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/1025f9f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,108 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFrog extends EntityGenericAnimal implements IAnimals { - - public EntityFrog(World par1World) { - super(par1World); - setSize(0.5f, 0.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f, true)); - - // tasks.addTask(3, new EntityAIAttackOnCollide(this, moveSpeed, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f, true)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false, true)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 40, true)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 0; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "frogliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "froghurt"; - } - - @Override - protected void updateAITick() { - super.updateAITick(); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected boolean shouldPanic() { - return true; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { /* Does Not Play a Step Sound */ - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/10b723e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/10b723e4c42100141fce95f06aba7e85 deleted file mode 100644 index 02ea4e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/10b723e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityMobHeads extends TileEntity { - - /* Passed in From Item Damage */ - private int skullType; - private int rotation; - private String ExtraType = ""; - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("SkullType", (byte) (this.skullType & 255)); - par1NBTTagCompound.setByte("Rot", (byte) (this.rotation & 255)); - par1NBTTagCompound.setString("ExtraType", this.ExtraType); - - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - skullType = par1NBTTagCompound.getByte("SkullType"); - rotation = par1NBTTagCompound.getByte("Rot"); - - if (par1NBTTagCompound.hasKey("ExtraType")) { - this.ExtraType = par1NBTTagCompound.getString("ExtraType"); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - NBTTagCompound tag = packet.func_148857_g(); - skullType = tag.getByte("SkullType"); - rotation = tag.getByte("Rot"); - } - - public void setSkullType(int par1, String par2Str) { - skullType = par1; - ExtraType = par2Str; - } - - public int getSkullType() { - return skullType; - } - - public void setRotation(int par1) { - rotation = par1; - } - - @SideOnly(Side.CLIENT) - public int getRotation() { - return rotation; - } - - @SideOnly(Side.CLIENT) - public String getExtraType() { - return ExtraType; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/114096a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/114096a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c7b234d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/114096a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,157 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIMate extends EntityAIBase -{ - private EntityGenericBreedable theAnimal; - World theWorld; - private EntityGenericBreedable targetMate; - - /** - * Delay preventing a baby from spawning immediately when two mate-able animals find each other. - */ - int spawnBabyDelay = 0; - - /** The speed the creature moves at during mating behavior. */ - float moveSpeed; - - boolean shouldHop = false; - int slimeJumpDelay = 0; - - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2) { - this.theAnimal = par1EntityAnimal; - this.theWorld = par1EntityAnimal.worldObj; - this.moveSpeed = par2; - this.setMutexBits(3); - } - public EntityAIMate(EntityGenericBreedable par1EntityAnimal, float par2, boolean shouldHop) { - this(par1EntityAnimal, par2); - this.shouldHop = shouldHop; - } - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (!this.theAnimal.isInLove()) { - return false; - } - else { - this.targetMate = this.getNearbyMate(); - return this.targetMate != null; - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() - { - if(shouldHop){ - tryToHop(); - } - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - - /** - * Resets the task - */ - public void resetTask() - { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - - /** - * Updates the task - */ - public void updateTask() - { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; - - if(shouldHop){ - tryToHop(); - } - - if (this.spawnBabyDelay == 60) - { - this.spawnBaby(); - } - } - - /** - * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first - * valid mate found. - */ - private EntityGenericBreedable getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); - Iterator var3 = var2.iterator(); - EntityGenericBreedable var4; - - do { - if (!var3.hasNext()) { - return null; - } - - var4 = (EntityGenericBreedable)var3.next(); - } - while (!this.theAnimal.canMateWith(var4)); - - return var4; - } - - /** - * Spawns a baby animal of the same type. - */ - private void spawnBaby() { - EntityGenericBreedable var1 = this.theAnimal.getBabyAnimalEntity(this.targetMate); - - if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); - this.targetMate.resetInLove(); - var1.setGrowingAge(-24000); - var1.setLocationAndAngles(this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, 0.0F, 0.0F); - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - - for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; - this.theWorld.spawnParticle("heart", this.theAnimal.posX + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, this.theAnimal.posY + 0.5D + (double)(var2.nextFloat() * this.theAnimal.height), this.theAnimal.posZ + (double)(var2.nextFloat() * this.theAnimal.width * 2.0F) - (double)this.theAnimal.width, var4, var6, var8); - } - - this.theWorld.spawnEntityInWorld(new EntityXPOrb(this.theWorld, this.theAnimal.posX, this.theAnimal.posY, this.theAnimal.posZ, var2.nextInt(4) + 1)); - } - } - public void tryToHop(){ - if (theAnimal.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - - theAnimal.getJumpHelper().setJumping(); - theAnimal.getNavigator().setSpeed(moveSpeed); - } - else{ - theAnimal.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return theAnimal.getRNG().nextInt(20) + 10; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/20e524f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/20e524f5c42100141fce95f06aba7e85 deleted file mode 100644 index 91c8e41..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/20e524f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericAnimal; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class RenderGenericIdle extends RenderGenericLiving { - - public final ResourceLocation idleTexture; - - public RenderGenericIdle(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, - ResourceLocation idleTexture) { - super(par1ModelBase, shadowSize, livingTexture); - this.idleTexture = idleTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { - return idleTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/3172eea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/3172eea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee81004..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/3172eea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,253 +0,0 @@ -// Date: 21/08/2012 16:58:44 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityLizard; - -public class ModelLizard extends ModelBase { - ModelRenderer leg1; - ModelRenderer leg1u; - ModelRenderer leg2; - ModelRenderer leg2u; - - ModelRenderer TAILROT; - ModelRenderer Tail3; - ModelRenderer Tail2; - ModelRenderer Tail1; - - ModelRenderer FRONTROT; - ModelRenderer HEADBASE; - ModelRenderer Frill1; - ModelRenderer Frill2; - ModelRenderer Frill3; - ModelRenderer Frill4; - ModelRenderer head; - ModelRenderer leg3u; - ModelRenderer leg3; - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg4u; - - public ModelLizard() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TAILROT.dltfold1", 0, 0); - setTextureOffset("FRONTROT.dltfold3", 0, 0); - - leg1 = new ModelRenderer(this, 20, 22); - leg1.addBox(-3F, 0F, -1F, 2, 6, 2); - leg1.setRotationPoint(-4F, 18F, 6F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg1u = new ModelRenderer(this, 14, 22); - leg1u.addBox(-1F, 0F, -1F, 1, 2, 2); - leg1u.setRotationPoint(-4F, 18F, 6F); - leg1u.setTextureSize(64, 32); - leg1u.mirror = true; - setRotation(leg1u, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 20, 22); - leg2.addBox(1F, 0F, -1F, 2, 6, 2); - leg2.setRotationPoint(4F, 18F, 6F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg2u = new ModelRenderer(this, 14, 22); - leg2u.addBox(0F, 0F, -1F, 1, 2, 2); - leg2u.setRotationPoint(4F, 18F, 6F); - leg2u.setTextureSize(64, 32); - leg2u.mirror = true; - setRotation(leg2u, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 9F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - Tail3 = new ModelRenderer(this, 0, 17); - Tail3.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail3); - Tail3.setRotationPoint(0F, -1F, 10F); - Tail3.setTextureSize(64, 32); - Tail3.mirror = true; - setRotation(Tail3, 0F, 0F, 0F); - Tail2 = new ModelRenderer(this, 0, 17); - Tail2.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail2); - Tail2.setRotationPoint(0F, -1F, 5F); - Tail2.setTextureSize(64, 32); - Tail2.mirror = true; - setRotation(Tail2, 0F, 0F, 0F); - Tail1 = new ModelRenderer(this, 0, 17); - Tail1.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail1); - Tail1.setRotationPoint(0F, -1F, 0F); - Tail1.setTextureSize(64, 32); - Tail1.mirror = true; - setRotation(Tail1, 0F, 0F, 0F); - FRONTROT = new ModelRenderer(this, "FRONTROT"); - FRONTROT.setRotationPoint(0F, 19F, 6F); - setRotation(FRONTROT, 0F, 0F, 0F); - FRONTROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - FRONTROT.addChild(HEADBASE); - HEADBASE.setRotationPoint(0F, 0F, -13F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - Frill2 = new ModelRenderer(this, 29, 22); - Frill2.addBox(-3F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill2); - Frill2.setRotationPoint(-3F, 1F, -3F); - Frill2.setTextureSize(64, 32); - Frill2.mirror = true; - setRotation(Frill2, 0F, 0.0371786F, 0F); - Frill4 = new ModelRenderer(this, 37, 22); - Frill4.addBox(-4F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill4); - Frill4.setRotationPoint(-1F, -2F, -3F); - Frill4.setTextureSize(64, 32); - Frill4.mirror = true; - setRotation(Frill4, 0F, 0F, 0F); - Frill1 = new ModelRenderer(this, 29, 22); - Frill1.addBox(0F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill1); - Frill1.setRotationPoint(3F, 1F, -3F); - Frill1.setTextureSize(64, 32); - Frill1.mirror = true; - setRotation(Frill1, 0F, 0.0371786F, 0F); - - Frill3 = new ModelRenderer(this, 37, 22); - Frill3.addBox(0F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill3); - Frill3.setRotationPoint(1F, -2F, -3F); - Frill3.setTextureSize(64, 32); - Frill3.mirror = true; - setRotation(Frill3, 0F, 0F, 0F); - Frill3.mirror = false; - head = new ModelRenderer(this, 0, 0); - head.addBox(-4F, -4F, -9F, 6, 6, 8); - HEADBASE.addChild(head); - head.setRotationPoint(1F, 1F, 1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(HEADBASE); - leg3u = new ModelRenderer(this, 14, 22); - leg3u.addBox(-1F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg3u); - leg3u.setRotationPoint(-4F, -1F, -12F); - leg3u.setTextureSize(64, 32); - leg3u.mirror = true; - setRotation(leg3u, 0F, 0F, 0F); - body = new ModelRenderer(this, 10, 0); - body.addBox(-4F, -2F, -9F, 8, 4, 18); - FRONTROT.addChild(body); - body.setRotationPoint(0F, 0F, -6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4u = new ModelRenderer(this, 14, 22); - leg4u.addBox(0F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg4u); - leg4u.setRotationPoint(4F, -1F, -12F); - leg4u.setTextureSize(64, 32); - leg4u.mirror = true; - setRotation(leg4u, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 20, 22); - leg4.addBox(1F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg4); - leg4.setRotationPoint(4F, -1F, -12F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 20, 22); - leg3.addBox(-3F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg3); - leg3.setRotationPoint(-4F, -1F, -12F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - FRONTROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - FRONTROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityLizard var5 = (EntityLizard) par1EntityLiving; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - if (var5.prepareToSpit == true) { - Frill1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.0F * par3; - Frill2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 1.0F * par3; - - Frill3.rotateAngleZ = (float) (-45 * Math.PI / 180); - Frill3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - Frill3.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - - Frill4.rotateAngleZ = (float) (45 * Math.PI / 180); - Frill4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - Frill4.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - } else { - Frill1.rotateAngleZ = (float) (-90 * Math.PI / 180); // This is on Right - Frill2.rotateAngleZ = (float) (90 * Math.PI / 180); // This is on Left - - Frill3.rotateAngleY = (float) (-90 * Math.PI / 180); - Frill4.rotateAngleY = (float) (90 * Math.PI / 180); - } - leg1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - leg3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADBASE.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADBASE.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/31c0e9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/31c0e9f9c42100141fce95f06aba7e85 deleted file mode 100644 index 7638201..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/31c0e9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,19 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class ItemScale extends Item { - - public ItemScale(boolean full3D, String name) { - super(); - maxStackSize = 64; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setHasSubtypes(true); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/40d6d8e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/40d6d8e4c42100141fce95f06aba7e85 deleted file mode 100644 index b585ce1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/40d6d8e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserBlockRange extends KeyParserBase { - - public KeyParserBlockRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseBlockRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/50acb09ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/50acb09ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 41748eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/50acb09ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,321 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -import com.google.common.base.CharMatcher; - -public class SpawnerFields implements DataFields { - private boolean isEnabled = true; - - private GuiTextField minSpawnDelay; - private GuiTextField maxSpawnDelay; - private GuiTextField maxToSpawn; - private GuiTextField requiredPlayerRange; - private GuiTextField maxNearbyEntities; - - private GuiTextField spawnRangeVertical; - private GuiTextField spawnRangeHorizontal; - - private GuiTextField spawnOffsetX; - private GuiTextField spawnOffsetY; - private GuiTextField spawnOffsetZ; - - private GuiButton toggleDebug; - private GuiButton resetDebug; - - private GuiLimitedMobSpawner parent; - - SpawnerFields(GuiLimitedMobSpawner parent) { - this.parent = parent; - } - - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - minSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 22 + 2), new Point(20, 14), minSpawnDelay != null ? minSpawnDelay.getText() : ""); - maxSpawnDelay = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 22 + 2), new Point(20, 14), maxSpawnDelay != null ? maxSpawnDelay.getText() : ""); - - requiredPlayerRange = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 39 + 2), new Point(39, 14), requiredPlayerRange != null ? requiredPlayerRange.getText() - : ""); - - maxToSpawn = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58), new Point(20, 14), maxToSpawn != null ? maxToSpawn.getText() : ""); - maxNearbyEntities = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17), new Point(39, 14), maxNearbyEntities != null ? maxNearbyEntities.getText() - : ""); - - spawnRangeVertical = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(201, 58 + 17 * 2), new Point(20, 14), - spawnRangeVertical != null ? spawnRangeVertical.getText() : ""); - spawnRangeHorizontal = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, - new Point(177, 58 + 17 * 2), new Point(20, 14), - spawnRangeHorizontal != null ? spawnRangeHorizontal.getText() : ""); - - spawnOffsetX = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 177, 58 + 17 * 3), new Point(20, 14), spawnOffsetX != null ? spawnOffsetX.getText() : ""); - spawnOffsetZ = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 3), new Point(20, 14), spawnOffsetZ != null ? spawnOffsetZ.getText() : ""); - spawnOffsetY = setupTextField(mc.fontRenderer, new Point(screenWidth, screenHeight), backgroundSize, new Point( - 201, 58 + 17 * 4), new Point(20, 14), spawnOffsetY != null ? spawnOffsetY.getText() : ""); - - toggleDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 5, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Toggle Debug"); - resetDebug = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 70, 20, "Reset Debug"); - - return this; - } - - private GuiTextField setupTextField(FontRenderer fontRenderer, Point screenSize, Point backgroundSize, - Point position, Point boxSize, String text) { - GuiTextField newTextField = new GuiTextField(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 - + position.getX(), (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), - boxSize.getY()); - newTextField.setText(text); - newTextField.setTextColor(-1); - newTextField.setDisabledTextColour(-1); - newTextField.setEnableBackgroundDrawing(false); - newTextField.setMaxStringLength(3); - return newTextField; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - minSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMinSpawnDelay() / 20)); - maxSpawnDelay.setText(Integer.toString(limitedMobSpawner.getMaxSpawnDelay() / 20)); - maxToSpawn.setText(Integer.toString(limitedMobSpawner.getMaxSpawnableEntities())); - requiredPlayerRange.setText(Integer.toString(limitedMobSpawner.getRequriedPLayerRange())); - maxNearbyEntities.setText(Integer.toString(limitedMobSpawner.getMaxNearbyEntities())); - spawnRangeHorizontal.setText(Integer.toString(limitedMobSpawner.getSpawnRangeHorizontal())); - spawnRangeVertical.setText(Integer.toString(limitedMobSpawner.getSpawnRangeVertial())); - spawnOffsetX.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetX)); - spawnOffsetY.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetY)); - spawnOffsetZ.setText(Integer.toString(limitedMobSpawner.spawnRangeOffsetZ)); - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - limitedMobSpawner.setMinMaxSpawnDelay(Integer.parseInt(minSpawnDelay.getText()) * 20, - Integer.parseInt(maxSpawnDelay.getText()) * 20); - limitedMobSpawner.setMaxSpawnableEntities(Integer.parseInt(maxToSpawn.getText())); - limitedMobSpawner.setRequiredPlayerRange(Integer.parseInt(requiredPlayerRange.getText())); - limitedMobSpawner.setMaxNearbyEntities(Integer.parseInt(maxNearbyEntities.getText())); - limitedMobSpawner.setSpawnRangeHorizontal(Integer.parseInt(spawnRangeHorizontal.getText())); - limitedMobSpawner.setSpawnRangeVertical(Integer.parseInt(spawnRangeVertical.getText())); - limitedMobSpawner.spawnRangeOffsetX = Integer.parseInt(spawnOffsetX.getText()); - limitedMobSpawner.spawnRangeOffsetY = Integer.parseInt(spawnOffsetY.getText()); - limitedMobSpawner.spawnRangeOffsetZ = Integer.parseInt(spawnOffsetZ.getText()); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - return correctIfInvalid(minSpawnDelay, keyChar, keyID) || correctIfInvalid(maxSpawnDelay, keyChar, keyID) - || correctIfInvalid(maxToSpawn, keyChar, keyID) - || correctIfInvalid(maxNearbyEntities, keyChar, keyID) - || correctIfInvalid(requiredPlayerRange, keyChar, keyID) - || correctIfInvalid(spawnRangeVertical, keyChar, keyID) - || correctIfInvalid(spawnRangeHorizontal, keyChar, keyID) - || correctIfInvalid(spawnOffsetX, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetZ, "-0123456789", keyChar, keyID) - || correctIfInvalid(spawnOffsetY, "-0123456789", keyChar, keyID); - } - return false; - } - - private boolean correctIfInvalid(GuiTextField guiTextField, char keyChar, int keyID) { - return correctIfInvalid(guiTextField, "0123456789", keyChar, keyID); - } - - private boolean correctIfInvalid(GuiTextField guiTextField, String retainable, char keyChar, int keyID) { - if (guiTextField.textboxKeyTyped(keyChar, keyID)) { - String originalString = guiTextField.getText(); - String numericString = CharMatcher.anyOf(retainable).retainFrom(guiTextField.getText()) - .replaceAll("^0*", ""); - if (!originalString.equals(numericString)) { - guiTextField.setText(numericString); - } - if (guiTextField.getText().length() == 0) { - guiTextField.setText("0"); - } - return true; - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - minSpawnDelay.mouseClicked(par1, par2, par3); - maxSpawnDelay.mouseClicked(par1, par2, par3); - maxToSpawn.mouseClicked(par1, par2, par3); - maxNearbyEntities.mouseClicked(par1, par2, par3); - requiredPlayerRange.mouseClicked(par1, par2, par3); - spawnRangeVertical.mouseClicked(par1, par2, par3); - spawnRangeHorizontal.mouseClicked(par1, par2, par3); - spawnOffsetX.mouseClicked(par1, par2, par3); - spawnOffsetZ.mouseClicked(par1, par2, par3); - spawnOffsetY.mouseClicked(par1, par2, par3); - - if (par3 == 0 && toggleDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - } else { - NBTTagCompound tagToSave = new NBTTagCompound(); - parent.limitedMobSpawner.writeToNBT(tagToSave); - parent.limitedMobSpawner.setDebugMode(tagToSave); - parent.limitedMobSpawner.syncToServer(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && resetDebug.mousePressed(mc, par1, par2)) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - parent.limitedMobSpawner.loadDebugNBT(); - parent.limitedMobSpawner.setDebugMode(new NBTTagCompound()); - parent.limitedMobSpawner.syncToServer(); - parent.loadGuiFromTileEntity(); - } - mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (isEnabled) { - if (parent.limitedMobSpawner.isDebugEnabled()) { - toggleDebug.enabled = false; - toggleDebug.drawButton(mc, par1, par2); - toggleDebug.enabled = true; - } else { - toggleDebug.drawButton(mc, par1, par2); - } - - resetDebug.drawButton(mc, par1, par2); - - /* Draw Raw Text */ - mc.fontRenderer.drawString("Spawn Delay [Min / Max]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Player Activation Range", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17, 4210752); - mc.fontRenderer.drawString("Maximum To Spawn", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 2, 4210752); - mc.fontRenderer.drawString("Maximum Nearby", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 3, 4210752); - - mc.fontRenderer.drawString("Spawn Range [Hor/Ver]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 4, 4210752); - mc.fontRenderer.drawString("Spawn Offset [X / Z]", (screenSize.getX() - backgroundSize.getX()) / 2 + 46, - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 5, 4210752); - mc.fontRenderer.drawString( - "[Y]", - (screenSize.getX() - backgroundSize.getX()) / 2 + 46 - + mc.fontRenderer.getStringWidth("Spawn Offset X / "), - (screenSize.getY() - backgroundSize.getY()) / 2 + 26 + 17 * 6, 4210752); - - /* Draw TextBox Background Objects */ - mc.renderEngine.bindTexture(CREATURE_GUI); - // int textureID = mc.renderEngine.getTexture(DefaultProps.dungeonDiretory+"creaturelistgui.png"); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // mc.renderEngine.bindTexture(textureID); //TODO: Commented - - Point smallBoxImageLocation = new Point(154, 0); - Point smallBoxSize = new Point(22, 14); - Point verySmallBoxSize = new Point(22 - 7, 14); - drawBackgroundBox(new Point(175, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17), screenSize, backgroundSize, smallBoxImageLocation, smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 2), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 3), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(175, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 4), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - drawBackgroundBox(new Point(199, 21 + 17 * 6), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(175, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - drawBackgroundBox(new Point(199, 21 + 17 * 5), screenSize, backgroundSize, smallBoxImageLocation, - smallBoxSize); - - /* Draw Interactive Text Boxes */ - minSpawnDelay.drawTextBox(); - maxSpawnDelay.drawTextBox(); - maxToSpawn.drawTextBox(); - maxNearbyEntities.drawTextBox(); - requiredPlayerRange.drawTextBox(); - spawnRangeVertical.drawTextBox(); - spawnRangeHorizontal.drawTextBox(); - spawnOffsetX.drawTextBox(); - spawnOffsetZ.drawTextBox(); - spawnOffsetY.drawTextBox(); - } - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/612807f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/612807f9c42100141fce95f06aba7e85 deleted file mode 100644 index 3126af9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/612807f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,37 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -public enum EntityStates { - /* Primary States : Practically used by Everything */ - idle(0), - looking(1), - attacking(2), - - /* Secondary States : Common */ - fleeing(7), - following(6), - inLove(8), - sitting(9), - - /* Tertiary States : Used Rarely */ - stayStill(11), - posture(5), - inCover(10), - unknown(-1); - - public final int index; - public int index() { return index; } - - EntityStates(int index) { - this.index = index; - } - - /* Return unknown if State Cannot be Found */ - public static EntityStates getEntityByIndex(int index){ - for (EntityStates entityState : EntityStates.values()) { - if(entityState.index == index){ - return entityState; - } - } - return unknown; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90cb8701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90cb8701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 07d7f25..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/90cb8701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionMoveSpeed extends SubItemPotionGeneric { - - public SubItemPotionMoveSpeed(Item itemID, int subID) { - super(itemID, subID, "potion.moveSpeed"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 10, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.moveSpeed); - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.MOVE_SLOW.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.MOVE_SLOW.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/91cfbcffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/91cfbcffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f317f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/91cfbcffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutShell; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/a03cf89ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/a03cf89ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 54b37e9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/a03cf89ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.ai.EntityAITarget; -import net.minecraft.util.AxisAlignedBB; - - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - boolean entityCallsForHelp; - private int field_142052_b; - - public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) - { - super(par1EntityCreature, false); - this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() - { - int i = this.taskOwner.func_142015_aE(); - return i != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() - { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); - - if (this.entityCallsForHelp) - { - double d0 = this.getTargetDistance(); - List list = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(d0, 10.0D, d0)); - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) - { - EntityCreature entitycreature = (EntityCreature)iterator.next(); - - if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null && !entitycreature.isOnSameTeam(this.taskOwner.getAITarget())) - { - entitycreature.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/b1f78c9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/b1f78c9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d87f46b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/b1f78c9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c0d5aff7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c0d5aff7c42100141fce95f06aba7e85 deleted file mode 100644 index 24411cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c0d5aff7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,135 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelOstrichHead extends ModelBase{ - - ModelRenderer BODYROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer NECK7ROT; - private ModelRenderer NECK8ROT; - private ModelRenderer HEADROT; - - public ModelOstrichHead(){ - textureWidth = 64; - textureHeight = 64; - setTextureOffset("BODYROT.body3", 12, 25); - setTextureOffset("NECK1ROT.neck1", 22, 26); - setTextureOffset("NECK3ROT.neck3", 22, 26); - setTextureOffset("NECK4ROT.neck4", 22, 26); - setTextureOffset("NECK5ROT.neck5", 22, 26); - setTextureOffset("NECK6ROT.neck6", 22, 26); - setTextureOffset("NECK7ROT.neck7", 22, 26); - setTextureOffset("NECK8ROT.neck8", 22, 26); - setTextureOffset("HEADROT.head", 48, 0); - setTextureOffset("HEADROT.beaktop", 36, 0); - setTextureOffset("HEADROT.beakbot", 38, 5); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 26F, -1F); - setRotation(BODYROT, -1.570796F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body3", -1.5F, -3.5F, -4F, 3, 3, 2); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -2F, -4F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1F, -1F, -2F, 2, 2, 2); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1F, -1F, -2F, 2, 2, 2); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1F, -1F, -2F, 2, 2, 2); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1F, -1F, -2F, 2, 2, 2); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1F, -1F, -2F, 2, 2, 2); - NECK7ROT = new ModelRenderer(this, "NECK7ROT"); - NECK7ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK7ROT, 0F, 0F, 0F); - NECK7ROT.mirror = true; - NECK7ROT.addBox("neck7", -1F, -1F, -2F, 2, 2, 2); - NECK8ROT = new ModelRenderer(this, "NECK8ROT"); - NECK8ROT.setRotationPoint(0F, 0F, -2F); - setRotation(NECK8ROT, 0F, 0F, 0F); - NECK8ROT.mirror = true; - NECK8ROT.addBox("neck8", -1F, -1F, -2F, 2, 2, 2); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, -2F); - setRotation(HEADROT, 1.570796F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -2F, -2.5F, -4F, 4, 4, 4); - HEADROT.addBox("beaktop", -1F, -1F, -8F, 2, 1, 4); - HEADROT.addBox("beakbot", -1F, 0F, -7F, 2, 1, 3); - NECK8ROT.addChild(HEADROT); - NECK7ROT.addChild(NECK8ROT); - NECK6ROT.addChild(NECK7ROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK1ROT.addChild(NECK3ROT); - BODYROT.addChild(NECK1ROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - BODYROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - BODYROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - switch ((int)skullState) { - case 1: - BODYROT.rotateAngleX = (float) (-90*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-5*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-10*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (25*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (30*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (40*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (30*Math.PI/180); - HEADROT.rotateAngleX = (float) (20*Math.PI/180); - break; - default: - BODYROT.rotateAngleX = (float) (0*Math.PI/180); - NECK1ROT.rotateAngleX = (float) (-35*Math.PI/180); - NECK3ROT.rotateAngleX = (float) (-30*Math.PI/180); - NECK4ROT.rotateAngleX = (float) (-25*Math.PI/180); - NECK5ROT.rotateAngleX = (float) (-20*Math.PI/180); - NECK6ROT.rotateAngleX = (float) (+25*Math.PI/180); - NECK7ROT.rotateAngleX = (float) (+30*Math.PI/180); - NECK8ROT.rotateAngleX = (float) (+35*Math.PI/180); - HEADROT.rotateAngleX = (float) (+50*Math.PI/180); - break; - } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c1d66f01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c1d66f01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 79cbbac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c1d66f01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c1ee13f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c1ee13f8c42100141fce95f06aba7e85 deleted file mode 100644 index 3b98b63..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/c1ee13f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetHallway implements BlueprintSet, Blueprint { - - BlockWithMeta block; - BlockWithMeta floorblock; - - public BPSetHallway() { - floorblock = new BlockWithMeta(Blocks.sandstone); - block = new BlockWithMeta(Blocks.air); - } - - @Override - public String getIdentifier() { - return "hallway"; - } - - @Override - public int getWeight() { - return 10; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { -// if (random.nextInt(10) == 0) { -// return new BlockWithMeta(Block.tnt.blockID); -// } else { -// return floorblock; -// } - - if (piecePos.posY == 0) { - return floorblock; - } else { - return block; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0233ff5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0233ff5c42100141fce95f06aba7e85 deleted file mode 100644 index 2e9d289..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/e0233ff5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,502 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityMinotaur; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelMinotaur extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer BACKBELT2ROT; - ModelRenderer FRONTBELT2ROT; - ModelRenderer LEGRIGTOPROT; - - private ModelRenderer HEADROT; - private ModelRenderer ARMTOPRIGROT; - private ModelRenderer ARMTOPLEFROT; - private ModelRenderer BACKBELT3ROT; - private ModelRenderer FRONTBELT3ROT; - private ModelRenderer HORNLEF1ROT; - private ModelRenderer HORNLEF2ROT; - private ModelRenderer HORNLEF3ROT; - private ModelRenderer HORNRIG1ROT; - private ModelRenderer HORNRIG2ROT; - private ModelRenderer HORNRIG3ROT; - private ModelRenderer ARMBOTRIGROT; - private ModelRenderer HANDROT; - private ModelRenderer FINRIG2ROT; - private ModelRenderer FINRIG1ROT; - private ModelRenderer FINRIGROT3; - private ModelRenderer ARMBOTLEFROT; - private ModelRenderer HAMMERROT; - private ModelRenderer AXEBLADE2; - private ModelRenderer AXEBLADE3; - private ModelRenderer HANDLEFROT; - private ModelRenderer FINLEF2ROT; - private ModelRenderer FINLEF1ROT; - private ModelRenderer FINLEFROT3; - private ModelRenderer FRONTBELT4ROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer LEGRIGBOTROT; - - public ModelMinotaur() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 0, 49); - setTextureOffset("HEADROT.nose1", 30, 49); - setTextureOffset("HEADROT.nose2", 30, 56); - setTextureOffset("HORNLEF1ROT.hornlef1", 54, 58); - setTextureOffset("HORNLEF2ROT.hornlef2", 50, 53); - setTextureOffset("HORNLEF3ROT.hornlef3", 42, 60); - setTextureOffset("HORNRIG1ROT.hornrig1", 54, 58); - setTextureOffset("HORNRIG2ROT.hornrig2", 50, 53); - setTextureOffset("HORNRIG3ROT.hornrig3", 42, 60); - setTextureOffset("ARMTOPRIGROT.armrigtop", 36, 22); - setTextureOffset("ARMBOTRIGROT.armrigbot", 36, 36); - setTextureOffset("HANDROT.handrigbase", 38, 15); - setTextureOffset("FINRIG2ROT.fingerrig2", 56, 22); - setTextureOffset("FINRIG1ROT.fingerrig1", 56, 22); - setTextureOffset("FINRIGROT3.fingerrig3", 54, 16); - setTextureOffset("ARMTOPLEFROT.armleftop", 36, 22); - setTextureOffset("ARMTOPLEFROT.armorshoulder1", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder2", 31, 7); - setTextureOffset("ARMTOPLEFROT.armorshoulder3", 44, 8); - setTextureOffset("ARMTOPLEFROT.armorshoulder4", 38, 0); - setTextureOffset("ARMBOTLEFROT.armlefbot", 36, 36); - setTextureOffset("HAMMERROT.axeback", 64, 0); - setTextureOffset("HAMMERROT.axefront1", 64, 7); - setTextureOffset("HAMMERROT.axefront2", 64, 14); - setTextureOffset("HAMMERROT.axeblade1", 67, 22); - setTextureOffset("HAMMERROT.axebase", 43, 30); - setTextureOffset("AXEBLADE2.axeblade2", 67, 34); - setTextureOffset("AXEBLADE3.axeblade3", 67, 34); - setTextureOffset("HANDLEFROT.handlefbase", 38, 15); - setTextureOffset("FINLEF2ROT.fingerlef2", 56, 22); - setTextureOffset("FINLEF1ROT.fingerlef1", 56, 22); - setTextureOffset("FINLEFROT3.fingerlef3", 54, 16); - setTextureOffset("BODYROT.body", 0, 28); - setTextureOffset("BODYROT.belt1", 14, 0); - setTextureOffset("BODYROT.belt4", 0, 0); - setTextureOffset("BODYROT.belt2", 0, 0); - setTextureOffset("BODYROT.belt3", 14, 0); - setTextureOffset("LEGLEFTOPROT.legleftop", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront1", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefbase", 20, 20); - setTextureOffset("LEGLEFBOTROT.leglefbot", 0, 17); - setTextureOffset("LEGLEFBOTROT.footleffront2", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront3", 3, 12); - setTextureOffset("LEGLEFBOTROT.footleffront4", 0, 11); - setTextureOffset("LEGLEFBOTROT.footlefback2", 11, 14); - setTextureOffset("LEGLEFBOTROT.footlefback1", 8, 11); - setTextureOffset("BACKBELT2ROT.belt32", 16, 3); - setTextureOffset("BACKBELT3ROT.belt33", 18, 6); - setTextureOffset("FRONTBELT2ROT.belt12", 16, 3); - setTextureOffset("FRONTBELT3ROT.belt13", 18, 6); - setTextureOffset("FRONTBELT4ROT.belt14", 20, 9); - setTextureOffset("LEGRIGTOPROT.legrigtop", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront1", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigbase", 20, 20); - setTextureOffset("LEGRIGBOTROT.legrigbot", 0, 17); - setTextureOffset("LEGRIGBOTROT.footrigfront2", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront3", 3, 12); - setTextureOffset("LEGRIGBOTROT.footrigfront4", 0, 11); - setTextureOffset("LEGRIGBOTROT.footrigback2", 11, 14); - setTextureOffset("LEGRIGBOTROT.footrigback1", 8, 11); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 10F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -15F, -1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -7F, -3F, 8, 8, 7); - HEADROT.addBox("nose1", -2.5F, -3.5F, -6F, 5, 4, 3); - HEADROT.addBox("nose2", -2F, -2.5F, -8F, 4, 3, 2); - HORNLEF1ROT = new ModelRenderer(this, "HORNLEF1ROT"); - HORNLEF1ROT.setRotationPoint(-4F, -3F, 0.5F); - setRotation(HORNLEF1ROT, 0F, 0F, 0F); - HORNLEF1ROT.mirror = true; - HORNLEF1ROT.addBox("hornlef1", -2F, -1.5F, -1.5F, 2, 3, 3); - HORNLEF2ROT = new ModelRenderer(this, "HORNLEF2ROT"); - HORNLEF2ROT.setRotationPoint(-2F, 1.5F, 0F); - setRotation(HORNLEF2ROT, 0F, 0F, 0.7853982F); - HORNLEF2ROT.mirror = true; - HORNLEF2ROT.addBox("hornlef2", -4F, -2F, -1.5F, 4, 2, 3); - HORNLEF3ROT = new ModelRenderer(this, "HORNLEF3ROT"); - HORNLEF3ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(HORNLEF3ROT, 0F, 0F, 0.7504916F); - HORNLEF3ROT.mirror = true; - HORNLEF3ROT.addBox("hornlef3", -4F, -2F, -1F, 4, 2, 2); - HORNLEF2ROT.addChild(HORNLEF3ROT); - HORNLEF1ROT.addChild(HORNLEF2ROT); - HEADROT.addChild(HORNLEF1ROT); - HORNRIG1ROT = new ModelRenderer(this, "HORNRIG1ROT"); - HORNRIG1ROT.setRotationPoint(4F, -3F, 0.5F); - setRotation(HORNRIG1ROT, 0F, 0F, 0F); - HORNRIG1ROT.mirror = true; - HORNRIG1ROT.addBox("hornrig1", 0F, -1.5F, -1.5F, 2, 3, 3); - HORNRIG2ROT = new ModelRenderer(this, "HORNRIG2ROT"); - HORNRIG2ROT.setRotationPoint(2F, 1.5F, 0F); - setRotation(HORNRIG2ROT, 0F, 0F, -0.7853982F); - HORNRIG2ROT.mirror = true; - HORNRIG2ROT.addBox("hornrig2", 0F, -2F, -1.5F, 4, 2, 3); - HORNRIG3ROT = new ModelRenderer(this, "HORNRIG3ROT"); - HORNRIG3ROT.setRotationPoint(4F, 0F, 0F); - setRotation(HORNRIG3ROT, 0F, 0F, -0.7504916F); - HORNRIG3ROT.mirror = true; - HORNRIG3ROT.addBox("hornrig3", 0F, -2F, -1F, 4, 2, 2); - HORNRIG2ROT.addChild(HORNRIG3ROT); - HORNRIG1ROT.addChild(HORNRIG2ROT); - HEADROT.addChild(HORNRIG1ROT); - BODYROT.addChild(HEADROT); - ARMTOPRIGROT = new ModelRenderer(this, "ARMTOPRIGROT"); - ARMTOPRIGROT.setRotationPoint(8F, -11F, 0F); - setRotation(ARMTOPRIGROT, 0F, 0F, 0F); - ARMTOPRIGROT.mirror = true; - ARMTOPRIGROT.addBox("armrigtop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMBOTRIGROT = new ModelRenderer(this, "ARMBOTRIGROT"); - ARMBOTRIGROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTRIGROT, 0F, 0F, 0F); - ARMBOTRIGROT.mirror = true; - ARMBOTRIGROT.addBox("armrigbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HANDROT = new ModelRenderer(this, "HANDROT"); - HANDROT.setRotationPoint(1.5F, 8F, 0F); - setRotation(HANDROT, 0F, 0F, 0F); - HANDROT.mirror = true; - HANDROT.addBox("handrigbase", -1F, 0F, -2.5F, 2, 2, 5); - FINRIG2ROT = new ModelRenderer(this, "FINRIG2ROT"); - FINRIG2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG2ROT, 0F, 0F, 0F); - FINRIG2ROT.mirror = true; - FINRIG2ROT.addBox("fingerrig2", -1F, -1F, 0.5F, 2, 3, 2); - HANDROT.addChild(FINRIG2ROT); - FINRIG1ROT = new ModelRenderer(this, "FINRIG1ROT"); - FINRIG1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINRIG1ROT, 0F, 0F, 0F); - FINRIG1ROT.mirror = true; - FINRIG1ROT.addBox("fingerrig1", -1F, -1F, -2.5F, 2, 3, 2); - HANDROT.addChild(FINRIG1ROT); - ARMBOTRIGROT.addChild(HANDROT); - FINRIGROT3 = new ModelRenderer(this, "FINRIGROT3"); - FINRIGROT3.setRotationPoint(-2F, 8F, 0F); - setRotation(FINRIGROT3, 0F, 0F, 0F); - FINRIGROT3.mirror = true; - FINRIGROT3.addBox("fingerrig3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTRIGROT.addChild(FINRIGROT3); - ARMTOPRIGROT.addChild(ARMBOTRIGROT); - BODYROT.addChild(ARMTOPRIGROT); - ARMTOPLEFROT = new ModelRenderer(this, "ARMTOPLEFROT"); - ARMTOPLEFROT.setRotationPoint(-8F, -11F, 0F); - setRotation(ARMTOPLEFROT, 0F, 0F, 0F); - ARMTOPLEFROT.mirror = true; - ARMTOPLEFROT.addBox("armleftop", -2.5F, -2F, -2.5F, 5, 9, 5); - ARMTOPLEFROT.addBox("armorshoulder1", -3.5F, -2F, -3.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder2", -3.5F, -2F, -2.5F, 1, 4, 5); - ARMTOPLEFROT.addBox("armorshoulder3", -3.5F, -2F, 2.5F, 6, 4, 1); - ARMTOPLEFROT.addBox("armorshoulder4", -3.5F, -3F, -3.5F, 6, 1, 7); - ARMBOTLEFROT = new ModelRenderer(this, "ARMBOTLEFROT"); - ARMBOTLEFROT.setRotationPoint(0F, 7F, 0F); - setRotation(ARMBOTLEFROT, 0F, 0F, 0F); - ARMBOTLEFROT.mirror = true; - ARMBOTLEFROT.addBox("armlefbot", -2.5F, 0F, -2.5F, 5, 8, 5); - HAMMERROT = new ModelRenderer(this, "HAMMERROT"); - HAMMERROT.setRotationPoint(0.5F, 9F, 0F); - setRotation(HAMMERROT, 0F, 0F, 0F); - HAMMERROT.mirror = true; - HAMMERROT.addBox("axeback", -1.5F, -3F, -15.5F, 3, 2, 5); - HAMMERROT.addBox("axefront1", -1F, 1F, -15.5F, 2, 2, 5); - HAMMERROT.addBox("axefront2", -1.5F, 3F, -16F, 3, 2, 6); - HAMMERROT.addBox("axeblade1", -0.5F, 5F, -18F, 1, 2, 10); - HAMMERROT.addBox("axebase", -1F, -1F, -16F, 2, 2, 20); - AXEBLADE2 = new ModelRenderer(this, "AXEBLADE2"); - AXEBLADE2.setRotationPoint(0F, 6.5F, -18F); - setRotation(AXEBLADE2, -0.5235988F, 0F, 0F); - AXEBLADE2.mirror = true; - AXEBLADE2.addBox("axeblade2", -0.5F, -1.5F, -4F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE2); - AXEBLADE3 = new ModelRenderer(this, "AXEBLADE3"); - AXEBLADE3.setRotationPoint(0F, 6.5F, -8.5F); - setRotation(AXEBLADE3, 0.5235988F, 0F, 0F); - AXEBLADE3.mirror = true; - AXEBLADE3.addBox("axeblade3", -0.5F, -1.5F, 0F, 1, 2, 4); - HAMMERROT.addChild(AXEBLADE3); - ARMBOTLEFROT.addChild(HAMMERROT); - HANDLEFROT = new ModelRenderer(this, "HANDLEFROT"); - HANDLEFROT.setRotationPoint(-1.5F, 8F, 0F); - setRotation(HANDLEFROT, 0F, 0F, 0F); - HANDLEFROT.mirror = true; - HANDLEFROT.addBox("handlefbase", -1F, 0F, -2.5F, 2, 2, 5); - FINLEF2ROT = new ModelRenderer(this, "FINLEF2ROT"); - FINLEF2ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF2ROT, 0F, 0F, 0F); - FINLEF2ROT.mirror = true; - FINLEF2ROT.addBox("fingerlef2", -1F, -1F, 0.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF2ROT); - FINLEF1ROT = new ModelRenderer(this, "FINLEF1ROT"); - FINLEF1ROT.setRotationPoint(0F, 3F, 0F); - setRotation(FINLEF1ROT, 0F, 0F, 0F); - FINLEF1ROT.mirror = true; - FINLEF1ROT.addBox("fingerlef1", -1F, -1F, -2.5F, 2, 3, 2); - HANDLEFROT.addChild(FINLEF1ROT); - ARMBOTLEFROT.addChild(HANDLEFROT); - FINLEFROT3 = new ModelRenderer(this, "FINLEFROT3"); - FINLEFROT3.setRotationPoint(2F, 8F, 0F); - setRotation(FINLEFROT3, 0F, 0F, 0F); - FINLEFROT3.mirror = true; - FINLEFROT3.addBox("fingerlef3", -0.5F, 0F, -2F, 1, 2, 4); - ARMBOTLEFROT.addChild(FINLEFROT3); - ARMTOPLEFROT.addChild(ARMBOTLEFROT); - BODYROT.addChild(ARMTOPLEFROT); - BODYROT.addBox("body", -5.5F, -14F, -3.5F, 11, 14, 7); - BODYROT.addBox("belt1", -5.5F, -2F, -4.5F, 11, 2, 1); - BODYROT.addBox("belt4", 5.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt2", -6.5F, -2F, -4.5F, 1, 2, 9); - BODYROT.addBox("belt3", -5.5F, -2F, 3.5F, 11, 2, 1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-3F, 10F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("footleffront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGLEFBOTROT.addBox("leglefbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGLEFBOTROT.addBox("footleffront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGLEFBOTROT.addBox("footleffront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGLEFBOTROT.addBox("footlefback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGLEFBOTROT.addBox("footlefback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BACKBELT2ROT = new ModelRenderer(this, "BACKBELT2ROT"); - BACKBELT2ROT.setRotationPoint(0F, 10F, 4F); - setRotation(BACKBELT2ROT, 0F, 0F, 0F); - BACKBELT2ROT.mirror = true; - BACKBELT2ROT.addBox("belt32", -4.5F, 0F, -0.5F, 9, 2, 1); - BACKBELT3ROT = new ModelRenderer(this, "BACKBELT3ROT"); - BACKBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(BACKBELT3ROT, 0F, 0F, 0F); - BACKBELT3ROT.mirror = true; - BACKBELT3ROT.addBox("belt33", -3.5F, 0F, -0.5F, 7, 2, 1); - BACKBELT2ROT.addChild(BACKBELT3ROT); - FRONTBELT2ROT = new ModelRenderer(this, "FRONTBELT2ROT"); - FRONTBELT2ROT.setRotationPoint(0F, 10F, -4F); - setRotation(FRONTBELT2ROT, 0F, 0F, 0F); - FRONTBELT2ROT.mirror = true; - FRONTBELT2ROT.addBox("belt12", -4.5F, 0F, -0.5F, 9, 2, 1); - FRONTBELT3ROT = new ModelRenderer(this, "FRONTBELT3ROT"); - FRONTBELT3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT3ROT, 0F, 0F, 0F); - FRONTBELT3ROT.mirror = true; - FRONTBELT3ROT.addBox("belt13", -3.5F, 0F, -0.5F, 7, 2, 1); - FRONTBELT4ROT = new ModelRenderer(this, "FRONTBELT4ROT"); - FRONTBELT4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(FRONTBELT4ROT, 0F, 0F, 0F); - FRONTBELT4ROT.mirror = true; - FRONTBELT4ROT.addBox("belt14", -2.5F, 0F, -0.5F, 5, 2, 1); - FRONTBELT3ROT.addChild(FRONTBELT4ROT); - FRONTBELT2ROT.addChild(FRONTBELT3ROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(3F, 10F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 6F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("footrigfront1", -2.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigbase", -2.5F, 6F, -2.5F, 5, 2, 5); - LEGRIGBOTROT.addBox("legrigbot", -2.5F, 0F, -2.5F, 5, 6, 5); - LEGRIGBOTROT.addBox("footrigfront2", -1.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront3", 0.5F, 6F, -5F, 1, 2, 3); - LEGRIGBOTROT.addBox("footrigfront4", 1.5F, 7F, -4.5F, 1, 1, 2); - LEGRIGBOTROT.addBox("footrigback2", -1.5F, 7F, 3.5F, 3, 1, 1); - LEGRIGBOTROT.addBox("footrigback1", -2F, 6F, 2.5F, 4, 2, 1); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - LEGLEFTOPROT.render(f5); - BACKBELT2ROT.render(f5); - FRONTBELT2ROT.render(f5); - LEGRIGTOPROT.render(f5); - } - - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - - EntityMinotaur var5 = (EntityMinotaur) par1EntityLiving; - - int max = 30; - int attackCounter = max - var5.ticksExisted % max; - /* Constant Animation Rotations */ - - /* State Based Animations */ - LEGLEFTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGLEFBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - LEGRIGTOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEGRIGBOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - - FRONTBELT2ROT.rotateAngleX = Math.min(Math.min(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - BACKBELT2ROT.rotateAngleX = Math.max(Math.max(LEGLEFTOPROT.rotateAngleX, LEGRIGTOPROT.rotateAngleX), 0); - - FINRIG2ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINRIG1ROT.rotateAngleZ = (float) (90 * Math.PI / 180); - FINLEF1ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - FINLEF2ROT.rotateAngleZ = (float) (-90 * Math.PI / 180); - - BODYROT.rotateAngleX = (float) (5 * Math.PI / 180); - - if (var5.getEntityState() == EntityStates.attacking) { - ARMTOPLEFROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (6 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-40 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (-90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (10 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = (float) (90 * Math.PI / 180 * MathHelper.cos(par2 * 0.6662F) * par3); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-10 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (-30 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (0 * Math.PI / 180); - } - - if (var5.getAnimTime() > 0 && var5.getEntityState() == (EntityStates.attacking)) { - int animState = 0; - if (animState == 0) { - /* Two Handed Attack Anim */ - BODYROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (5 * Math.PI / 180), (float) (20 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPLEFROT.rotateAngleZ = (float) (5 * Math.PI / 180); - - ARMBOTLEFROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTLEFROT.rotateAngleZ = (float) (-30 * Math.PI / 180); - - ARMTOPRIGROT.rotateAngleX = ModelHelper.mapValueWithClamp(var5.getAnimTime(), var5.maxAnimTime, 10, - (float) (165 * Math.PI / 180), (float) (350 * Math.PI / 180)); - ARMTOPRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMTOPRIGROT.rotateAngleZ = (float) (-5 * Math.PI / 180); - - ARMBOTRIGROT.rotateAngleX = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleY = (float) (0 * Math.PI / 180); - ARMBOTRIGROT.rotateAngleZ = (float) (+30 * Math.PI / 180); - - HAMMERROT.rotateAngleX = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleY = (float) (0 * Math.PI / 180); - HAMMERROT.rotateAngleZ = (float) (+20 * Math.PI / 180); - } else { - ARMTOPLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-60 - * Math.PI / 180), (float) (-10 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMTOPLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - ARMBOTLEFROT.rotateAngleX = ModelHelper.mapValueWithClamp(attackCounter, max, 10, (float) (-90 - * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleY = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - ARMBOTLEFROT.rotateAngleZ = ModelHelper.mapValueWithClamp(attackCounter, max, 0, - (float) (0 * Math.PI / 180), (float) (0 * Math.PI / 180)); - - } - - } - - /* - * Blocking Animation ARMTOPLEFROT.rotateAngleX = (float) (-20*Math.PI/180); ARMTOPLEFROT.rotateAngleY = (float) - * (+10*Math.PI/180); ARMTOPLEFROT.rotateAngleZ = (float) (15*Math.PI/180); - * - * ARMBOTLEFROT.rotateAngleX = (float) (-80*Math.PI/180); ARMBOTLEFROT.rotateAngleY = (float) (-30*Math.PI/180); - * ARMBOTLEFROT.rotateAngleZ = (float) (+40*Math.PI/180); - * - * ARMTOPRIGROT.rotateAngleX = (float) (-30*Math.PI/180); ARMTOPRIGROT.rotateAngleY = (float) (-15*Math.PI/180); - * ARMTOPRIGROT.rotateAngleZ = (float) (5*Math.PI/180); - * - * ARMBOTRIGROT.rotateAngleX = (float) (-60*Math.PI/180); ARMBOTRIGROT.rotateAngleY = (float) (+45*Math.PI/180); - * ARMBOTRIGROT.rotateAngleZ = (float) (+30*Math.PI/180); - */ - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0956bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0956bf6c42100141fce95f06aba7e85 deleted file mode 100644 index edcac6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0956bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData().toString() - //.func_150283_g(nodeList.get(clickedIndex).getData().getId()) - , nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0bd6300c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0bd6300c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index bb6b436..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0bd6300c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,45 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMinHeight extends KeyParserBase { - - public KeyParserMinHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, 256, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer minSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord < minSpawnHeight ? true : false; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0f7f73ac92100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0f7f73ac92100141a6cb1c64d7b6ba1 deleted file mode 100644 index ccd9a52..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ec/f0f7f73ac92100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,129 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.Tessellator; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class GUINBTList extends GuiScrollingList { - NBTTree nodeTree; - ArrayList nodeList; - - CreatureFields parent; - int selectedElement = -1; - - Point screenSize; - Point backgroundSize; - - public GUINBTList(CreatureFields parent, Minecraft mc, NBTTree nodeTree, int listWidth, Point screenSize, - Point backgroundSize) { - super(mc, listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 100 - 14, (screenSize.getY() - backgroundSize.getY()) - / 2 + backgroundSize.getY() - 60 - 12, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 6, // Left - mc.fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.nodeTree = nodeTree; - this.nodeList = nodeTree.toArrayList(); - this.screenSize = screenSize; - this.backgroundSize = backgroundSize; - } - - public void recreateNodeList() { - this.nodeList = nodeTree.toArrayList(); - selectedElement = -1; - } - - @Override - protected int getSize() { - return nodeList.size(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - ProjectZuluLog.info("Clicked on Tag of Type %s with name %s", nodeList.get(clickedIndex).getData() - .func_150283_g(nodeList.get(clickedIndex).getData().getId()), nodeList.get(clickedIndex).getTagName()); - // if(nodeList.get(clickedIndex).getChildren().size() == 0){ - parent.setSelectedCurentNode(nodeList.get(clickedIndex)); - selectedElement = clickedIndex; - // } - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight; // + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - - int numParents = nodeList.get(listIndex).countParents(); - String filler = ""; - for (int i = 0; i < numParents; i++) { - filler = filler.concat(" "); - } - String renderString = filler + nodeList.get(listIndex).getTagName(); - - String renderResult = ""; - int countChildren = nodeList.get(listIndex).getChildren().size(); - int parentCount = nodeList.get(listIndex).countParents(); - if (countChildren == 0) { - renderResult = NBTHelper.getByID(nodeList.get(listIndex).getData().getId()).getValue( - nodeList.get(listIndex).getData()); - } - - int maxResultLength = 13 - parentCount * 2; - parent.mc.fontRenderer.drawStringWithShadow(renderString, this.left + 3, var3 + 2, 16777215); // Red: 0xFF2222 - // // //Blck: - // 4210752 - parent.mc.fontRenderer.drawStringWithShadow( - renderResult.length() > maxResultLength ? renderResult.substring(0, maxResultLength) : renderResult, - this.left + 140, var3 + 2, 16777215); // Red: 0xFF2222 //Blck: 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 55, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.mc.renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/002b1add3620001413909a661a93f408 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/002b1add3620001413909a661a93f408 deleted file mode 100644 index 45e5ad1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/002b1add3620001413909a661a93f408 +++ /dev/null @@ -1,36 +0,0 @@ -package com.example.soulmod; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.event.FMLInitializationEvent; - -@Mod(modid = SoulmodT1.MODID, version = SoulmodT1.VERSION) -public class SoulmodT1 -{ - public static final String MODID = "soulmodt1"; - public static final String VERSION = "1.0b"; - - @EventHandler - public void init(FMLInitializationEvent event) - { - GameRegistry.addRecipe(new ItemStack(Items.apple,4), - new Object[]{ - "AA", - "AA", - 'A', Blocks.cobblestone }); - - GameRegistry.addRecipe(new ItemStack(Items.dye, 2, 15), new Object[]{ - "AB ", - "AAC", - "A ", - 'A', Blocks.cobblestone, 'B', Blocks.dirt, 'C', new ItemStack(Items.dye, 1, 1) - }); - - GameRegistry.addRecipe(new ItemStack(Item.diamond, 2), new Object[] { - "DDD", "DDD", "DDD", 'D', Blocks.dirt }); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/005ba39dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/005ba39dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dc19269..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/005ba39dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import javax.swing.Icon; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockNightBloom extends BlockBush { - public static final String[] imageSuffix = new String[] { "_0", "_1", "_2", "_3", "_4" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int tickInterval = 4; - - public int getTickInterval() { - return tickInterval; - } - - public BlockNightBloom() { - super(Material.plants); - setTickRandomly(true); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 9; - } else { - return 0; - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // If Night Time && And is not open (meta != 4) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) > 13000 && par1World.getBlockMetadata(par2, par3, par4) != 4) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - - // If Day Time && And is not closed (meta != 0) : begin opening - if (mapTimeTo24000(par1World.getWorldTime()) < 13000 && par1World.getBlockMetadata(par2, par3, par4) != 0) { - - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 1, 3); - - par1World.scheduleBlockUpdate(par2, par3, par4, this, 20); - } - super.updateTick(par1World, par2, par3, par4, par5Random); - - if (par1World.getBlockMetadata(par2, par3, par4) == 4) { - setLightLevel(0.6f); - } - if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - setLightLevel(0); - } - - par1World.scheduleBlockUpdate(par2, par3, par4, this, (20 * 5) + par5Random.nextInt(20 * 10)); - } - - private Long mapTimeTo24000(Long worldTime) { - Long tempWorldTime = worldTime; - while (tempWorldTime > 24000) { - tempWorldTime -= 24000; - } - if (tempWorldTime <= 0) { - return 0L; - } - return tempWorldTime; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, this, 2); - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland - || (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/106160f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/106160f8c42100141fce95f06aba7e85 deleted file mode 100644 index c5703aa..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/106160f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/1089fe9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/1089fe9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f670851..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/1089fe9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,62 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectOasis; -import projectzulu.common.world2.randomizer.EdgeRandomizer; -import projectzulu.common.world2.randomizer.Randomizer; - -public class BuildingManagerOasis extends BuildingManagerBase { - - public ArchitectOasis architect; - public Randomizer randomizer; - MazeCell[][] oasis; - - public BuildingManagerOasis(World world, FeatureDirection direction, ChunkCoordinates startingPos, int xCells, - int zCells, int cellSize) { - super(world); - - int cellHeight = 4; - randomizer = new EdgeRandomizer(world, 2); - architect = new ArchitectOasis(world); - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - oasis = new MazeCell[xCells][zCells]; - for (int i = 0; i < oasis.length; i++) { - for (int j = 0; j < oasis[0].length; j++) { - oasis[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(oasis); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - architect.assignBlueprint(oasis, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < oasis.length; cellX++) { - for (int cellZ = 0; cellZ < oasis[0].length; cellZ++) { - MazeCell currentCell = oasis[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/11dceeffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/11dceeffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 76cbc2b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/11dceeffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; - -public class AloeVeraFeature extends BiomeFeature { - private int density = 3; - - public AloeVeraFeature() { - super("Aloe Vera", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.aloeVera.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 20; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.grass || iDBelow == Blocks.dirt || iDBelow == Blocks.sand) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.aloeVera.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/201a1ae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/201a1ae4c42100141fce95f06aba7e85 deleted file mode 100644 index 1ba40d0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/201a1ae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,51 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGorillaHead extends ModelBase{ - - ModelRenderer HEADROT; - - public ModelGorillaHead() - { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 23F, 0F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/20e149e8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/20e149e8c42100141fce95f06aba7e85 deleted file mode 100644 index 73462c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/20e149e8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - /** The PathNavigate of our entity. */ - EntityLivingBase entityPathNavigate; - int fleeChance = 0; - /** Task Owner in the form of out Generic Creature, used to access Specialized information, such as Anger or EntityState */ - EntityGenericCreature genericTaskOwner; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityLiving, boolean shouldCallAllies, boolean shouldCheckSight) { - super(par1EntityLiving, 16.0F, shouldCheckSight); - this.shouldCallAllies = shouldCallAllies; - this.setMutexBits(1); - this.genericTaskOwner = par1EntityLiving; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.isSuitableTarget(this.taskOwner.getAITarget(), false); - - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return shouldExecute(); -// return this.taskOwner.getAITarget() != null && this.taskOwner.getAITarget() != this.entityPathNavigate; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.entityPathNavigate = this.taskOwner.getAITarget(); - - if (this.shouldCallAllies){ - //List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), - // AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), - AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - - Iterator var2 = var1.iterator(); - - while (var2.hasNext()){ - EntityLiving var3 = (EntityLiving)var2.next(); - - if (this.taskOwner != var3 && var3.getAttackTarget() == null){ - var3.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - super.startExecuting(); - } - - @Override - public void updateTask() { - startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/31bb56a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/31bb56a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b11728..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/31bb56a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeDoubleSlabDeclaration extends BlockDeclaration { - - public PalmTreeDoubleSlabDeclaration() { - super("PalmTreeDoubleSlab", 2); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeDoubleSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreeSlab.get(), - BlockList.palmTreePlank.get())).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeDoubleSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/51454da0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/51454da0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2c03436..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/51454da0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/51542cf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/51542cf4c42100141fce95f06aba7e85 deleted file mode 100644 index 531b65e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/51542cf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import java.util.EnumSet; -import java.util.Random; - -/** - * Two Dimensional Direction - */ -public enum Direction { - /* U = Up, D = Down, L = Left, R = Right */ - U(0, 0, 1), D(1, 0, -1), L(2, 1, 0), R(3, -1, 0), UL(4, 1, 1), UR(5, -1, 1), DL(6, 1, -1), DR(7, -1, -1); - - public final int x; - public final int z; - public final int id; - - Direction(int id, int x, int z) { - this.id = id; - this.x = x; - this.z = z; - } - - public static final Direction[] invert = { D, U, R, L, DR, DL, UR, UL }; - public static final Direction[] cwRotation = { UR, DL, UL, DR, U, R, L, D }; - public static final Direction[] ccwRotation = { UL, DR, DL, UR, L, U, D, R }; - - public Direction invert() { - return invert[id]; - } - - /* Rotate Direction by an Ordinal either Clockwise or CounterClockwise */ - public Direction rotateOrdinal(boolean clockwise) { - return clockwise ? cwRotation[id] : ccwRotation[id]; - } - - public static Direction getCardinal(Random random) { - return getCardinal(random.nextInt(4)); - } - - public static Direction getCardinal(int id) { - id = id & 3; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getCardinals() { - return EnumSet.of(U, D, L, R); - } - - public static Direction getOrdinal(Random random) { - return getOrdinal(random.nextInt(8)); - } - - public static Direction getOrdinal(int id) { - id = id & 7; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getOrdinals() { - return EnumSet.of(U, D, L, R, UL, UR, DL, DR); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/70319bf6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/70319bf6c42100141fce95f06aba7e85 deleted file mode 100644 index b583356..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/70319bf6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,330 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - - -public class ObfuscationHelper { - - /** - * Helper used to See if we are unObfuscated by checking for a known non-Obfuscated name - * return true if unObfuscated (eclipse), false if obfuscated (Minecraft) - * @param list - */ - public static boolean isUnObfuscated(Field[] fieldList, String desired){ - for (int i = 0; i < fieldList.length; i++) { - if(fieldList[i].getName().equals(desired)){ - return true; - } - } - return false; - } - - public static boolean isUnObfuscated(Class regularClass, String regularClassName){ - return regularClass.getSimpleName().equals(regularClassName); - } - - public static Object invokeMethod(String eclipseName, String seargeName, Class containingClass, - Object containterInstance, Object... args) { - try { - Method method; - method = getIntanceOfMethod(eclipseName, seargeName, containterInstance); - if (method == null) { - throw new NoSuchMethodException(); - } - method.setAccessible(true); - return method.invoke(containterInstance, args); - } catch (NoSuchMethodException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (InvocationTargetException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } - return null; - } - - private static Method getIntanceOfMethod(String eclipseName, String seargeName, Object containterInstance, Class... topClassToLook) { - Class classToSearch = containterInstance.getClass(); - while (classToSearch.getSuperclass() != null) { - for (Method method : classToSearch.getDeclaredMethods()) { - if (eclipseName.equalsIgnoreCase(method.getName()) || seargeName.equalsIgnoreCase(method.getName())) { - return method; - } - } - classToSearch = classToSearch.getSuperclass(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get Static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Class containingClass, Class type){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(null)); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Object containterInstance, Class type){ - return getFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Get Non-Static Field - */ - public static T getFieldFromReflection(String srgName, String sourceName, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(srgName, containterInstance.getClass(), containterInstance, type); - } catch (NoSuchFieldException e) { - return getFieldFromReflection(sourceName, containterInstance.getClass(), containterInstance, type); - } - } - - public static T getFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(fieldName, containingClass, containterInstance, type); - } catch (NoSuchFieldException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", - fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Object containterInstance, Class type) - throws NoSuchFieldException { - return getCatchableFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, Class type) - throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(containterInstance)); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value) throws NoSuchFieldException{ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - - public static Class getDeclaredClass(String className, Class containingClass){ - for (Class declaredClass : containingClass.getDeclaredClasses()) { - if(declaredClass.getSimpleName().equals(className)){ - return declaredClass; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/70c5a49ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/70c5a49ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b1ed4fc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/70c5a49ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserTorchLight extends KeyParserRange { - - public KeyParserTorchLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/8107cda1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/8107cda1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 68cee4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/8107cda1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityMummy; -import projectzulu.common.mobs.models.ModelMummy; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MummyDeclaration extends SpawnableDeclaration { - - public MummyDeclaration() { - super("Mummy", 5, EntityMummy.class, EnumCreatureType.monster); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (255 << 16) + (255 << 8) + 255; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.entityProperties = new EntityProperties(16f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMummy(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "mummy.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/b1ae24a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/b1ae24a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 346e715..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/b1ae24a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,201 +0,0 @@ -package projectzulu.common.blocks.heads; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.MathHelper; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockMobHeads extends BlockContainer { - public enum Head { - RedFinch(0, "Stuffed Finch"), Crocodile(1, "Alligator Head"), Armadillo(2, "Armadillo Head"), BlackBear(3, - "Black Bear Head"), BrownBear(4, "Brown Bear Head"), PolarBear(5, "Polar Bear Head"), Beaver(6, - "Beaver Head"), Boar(7, "Boar Head"), Giraffe(8, "Giraffe Head"), Gorilla(9, "Gorilla Head"), Lizard( - 10, "Lizard Head"), Mammoth(11, "Mammoth Head"), Ostrich(12, "Ostrich Head"), Penguin(13, - "Penguin Head"), Rhino(14, "Rhino Head"), TreeEnt(15, "TreeEnt Head"), Vulture(16, "Vulture Head"), Elephant( - 17, "Elephant Head"); - - private final int meta; - - public int meta() { - return meta; - } - - private final String displayName; - - public String displayName() { - return displayName; - } - - private IIcon icon; - - private Head(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public static Head getByMeta(int meta) { - for (Head head : Head.values()) { - if (head.meta == meta) - return head; - } - return null; - } - } - - public BlockMobHeads() { - super(Material.circuits); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(1.0F); - setStepSound(Block.soundTypeStone); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return Head.getByMeta(par2).icon; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Head head : Head.values()) { - head.icon = par1IconRegister.registerIcon(getTextureName() + "_" + head.toString().toLowerCase()); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item item, CreativeTabs tabs, List items) { - for (Head head : Head.values()) { - items.add(new ItemStack(this, 1, head.meta)); - } - } - - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * Drops the block items with a specified chance of dropping the specified items - */ - @Override - public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { - } - - /** - * Updates the blocks bounds based on its current state. Args: world, x, y, z - */ - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; - - switch (var5) { - case 1: - default: - this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - break; - case 2: - this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); - break; - case 3: - this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); - break; - case 4: - this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); - break; - case 5: - this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } - } - - /** - * Called when the block is attempted to be harvested - */ - @Override - public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { - if (par6EntityPlayer.capabilities.isCreativeMode) { - par5 |= 8; - par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 3); - } - super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - - /** - * ejects contained items into the world, and notifies neighbours of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - if (!par1World.isRemote) { - if ((par6 & 8) == 0) { - this.dropBlockAsItem(par1World, par2, par3, par4, - new ItemStack(this, 1, this.getDamageValue(par1World, par2, par3, par4))); - } - super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - - /** - * Called when the block is placed in the world. - */ - @Override - public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, - ItemStack par6ItemStack) { - int var6 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 2.5D) & 3; - par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } - - @Override - public TileEntity createNewTileEntity(World var1, int var2) { - return new TileEntityMobHeads(); - } - - /** - * Get the block's damage value (for use with pick block). - */ - @Override - public int getDamageValue(World par1World, int par2, int par3, int par4) { - TileEntity var5 = par1World.getTileEntity(par2, par3, par4); - return var5 != null && var5 instanceof TileEntityMobHeads ? ((TileEntityMobHeads) var5).getSkullType() : super - .getDamageValue(par1World, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/f0cc3f9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/f0cc3f9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a8131d7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ed/f0cc3f9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,556 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityEagle; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelEagle extends ModelBase { - - float heightToRaise = 10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER2ROT; - private ModelRenderer TAILFEATHER4ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - - public ModelEagle() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("HEADROT.head", 10, 16); - setTextureOffset("HEADROT.beaktop", 22, 16); - setTextureOffset("HEADROT.beakbot", 22, 20); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 8); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 8); - setTextureOffset("TAILFEATHER2ROT.tailfeather2", 9, 8); - setTextureOffset("TAILFEATHER4ROT.tailfeather4", 9, 8); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 8); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 28, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 28, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -1.5F, -1.5F, -2F, 3, 3, 2); - HEADROT.addBox("beaktop", -1F, -0.5F, -5F, 2, 1, 3); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -4F, 1, 1, 2); - BODYROT.addChild(HEADROT); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0.7853982F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER2ROT = new ModelRenderer(this, "TAILFEATHER2ROT"); - TAILFEATHER2ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER2ROT, 0F, 0.5235988F, 0F); - TAILFEATHER2ROT.mirror = true; - TAILFEATHER2ROT.addBox("tailfeather2", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER2ROT); - TAILFEATHER4ROT = new ModelRenderer(this, "TAILFEATHER4ROT"); - TAILFEATHER4ROT.setRotationPoint(0F, 0F, 1F); - setRotation(TAILFEATHER4ROT, 0F, -0.5235988F, 0F); - TAILFEATHER4ROT.mirror = true; - TAILFEATHER4ROT.addBox("tailfeather4", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER4ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0F, 1F); - setRotation(TAILFEATHER5ROT, 0F, -0.7853982F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 5); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 3, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 3F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 3, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 2.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 2.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 1.0f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityEagle var5 = (EntityEagle) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER2ROT.rotateAngleY = (float) (30 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - TAILFEATHER4ROT.rotateAngleY = (float) (-30 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityEagle var5 = (EntityEagle) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/020f68a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/020f68a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b4ee220..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/020f68a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,71 +0,0 @@ -package projectzulu.common.world.terrain; - -import java.util.Collection; -import java.util.Collections; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.world2.buildingmanager.BuildingManagerCathedral; - -public class CathedralFeature extends BiomeFeature { - public static final String CATHEDRAL = "Cathedral"; - - public CathedralFeature() { - super(CATHEDRAL, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Collections.emptyList(); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCathedral(world, genBlockCoords, direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/10b4f6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/10b4f6f5c42100141fce95f06aba7e85 deleted file mode 100644 index 204c1eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/10b4f6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,340 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/21c696fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/21c696fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a681a02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/21c696fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,217 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; - -public abstract class EntityGenericCreature extends EntityAerial { - private PathEntity pathToEntity; - - public boolean hasPath() { - return this.pathToEntity != null; - } - - /** The Entity this EntityCreature is set to attack. */ - protected Entity entityToAttack; - - public Entity getEntityToAttack() { - return this.entityToAttack; - } - - public void setTarget(Entity par1Entity) { - this.entityToAttack = par1Entity; - } - - private float maximumHomeDistance = -1.0F; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); - private boolean field_110180_bt; - // Cooldown instituted on the entity when it attempts to find a path but fails. - private int leashPathCooldown = 0; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0f); - - /** - * returns true if a creature has attacked recently only used for creepers and skeletons - */ - /* Do I need this? */ - // protected boolean hasAttacked = false; - - /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick = 0; - - public int getFleeTick() { - return fleeingTick; - } - - public void setFleeTick(int fleeingTick) { - this.fleeingTick = fleeingTick; - } - - /* Entity State Variables */ - protected int animTime = 0; - - public int getAnimTime() { - return animTime; - } - - public void setAnimTime(int animTime) { - this.animTime = animTime; - } - - protected int angerLevel = 0; - - public int getAngerLevel() { - return angerLevel; - } - - public void setAngerLevel(int angerLevel) { - this.angerLevel = angerLevel; - } - - protected EntityStates entityState = EntityStates.idle; - - public EntityStates getEntityState() { - return entityState; - } - - public EntityGenericCreature(World par1World) { - super(par1World); - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - attackTime = Math.max(attackTime - 1, 0); - fleeingTick = Math.max(fleeingTick - 1, 0); - angerLevel = Math.max(angerLevel - 1, 0); - } - - @Override - public void onUpdate() { - super.onUpdate(); - leashPathCooldown = Math.max(leashPathCooldown - 1, 0); - } - - @Override - protected void updateLeashedState() { - super.updateLeashedState(); - - if (this.getLeashed() && this.getLeashedToEntity() != null - && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity entity = this.getLeashedToEntity(); - this.setHomeArea((int) entity.posX, (int) entity.posY, (int) entity.posZ, 5); - float f = this.getDistanceToEntity(entity); - - if (this instanceof EntityGenericTameable && ((EntityGenericTameable) this).isSitting()) { - if (f > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/402895f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/402895f4c42100141fce95f06aba7e85 deleted file mode 100644 index 1eec992..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/402895f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerCemetary; - -public class CemetaryFeature extends BiomeFeature { - public static final String CEMETARY = "Cemetary"; - - public CemetaryFeature() { - super(CEMETARY, Size.MEDIUM); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 100; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.extremeHills.biomeName, - BiomeGenBase.forest.biomeName, BiomeGenBase.jungleHills.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.icePlains.biomeName, BiomeGenBase.jungle.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, "Birch Forest", "Forested Island", "Forested Hills", - "Green Hills", "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", - "Snow Forest", "Snowy Rainforest", "Temperate Rainforest", "Woodlands" }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ).getMaterial() != Material.ice - && world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.sand) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 2, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerCemetary(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 1, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/41fbbaa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/41fbbaa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c218251..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/41fbbaa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.core.itemblockdeclaration; - -import net.minecraftforge.common.config.Configuration; -import cpw.mods.fml.relauncher.Side; - -public interface ItemBlockDeclaration { - - public enum Type { - Block, Item; - } - - public abstract Type getType(); - - public abstract int getRegisterPass(); - - /** - * Loads ands saves the ItemBlock from the configuration filed. - * - * Called twice. Once for ItemBlocks already in the Config and again for new Items. Pass is indicated by readOnly - * boolean. - * - * @param config Configuration file to read save from - * @param readOnly Boolean indicating this is the pass for ItemBlock already in the Configuration file - */ - public abstract void createWithConfig(Configuration config, boolean readOnly); - - /** - * Registers the Created Block with the Environment - * - * i.e GameRegistry - */ - public abstract void register(Side side); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/604c02e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/604c02e4c42100141fce95f06aba7e85 deleted file mode 100644 index 52bd77a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/604c02e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/8027c4f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/8027c4f4c42100141fce95f06aba7e85 deleted file mode 100644 index 5cac413..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/8027c4f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionResistance extends SubItemPotionHalfPower { - - public SubItemPotionResistance(Item itemID, int subID) { - super(itemID, subID, "Resistance"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 13, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.resistance); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/80ad6a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/80ad6a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2b8f553..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/80ad6a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class RenderSnow extends RenderGenericLiving { - public final ResourceLocation snowTexture; - - public RenderSnow(ModelBase modelBase, float shadowSize, ResourceLocation livingLocation, - ResourceLocation snowTexture) { - super(modelBase, shadowSize, livingLocation); - this.snowTexture = snowTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (BiomeDictionary.isBiomeOfType(entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ), - Type.FROZEN)) { - return snowTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/82ef5ce4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/82ef5ce4c42100141fce95f06aba7e85 deleted file mode 100644 index 75f2d0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/82ef5ce4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/a03a16a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/a03a16a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3cb2e80..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/a03a16a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,101 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntities extends KeyParserBase { - - public KeyParserEntities(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 6) { - String entityName = pieces[1]; - int minSearchRange = ParsingHelper.parseFilteredInteger(pieces[2], 32, "1st " + key.key); - int maxSearchRange = ParsingHelper.parseFilteredInteger(pieces[3], 32, "1st " + key.key); - int min = ParsingHelper.parseFilteredInteger(pieces[4], 16, "2st " + key.key); - int max = ParsingHelper.parseFilteredInteger(pieces[5], -1, "3nd " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), entityName, - minSearchRange, maxSearchRange, min, max }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - String entityName = (String) values[1]; - int minSearch = (Integer) values[2]; - int maxSearch = (Integer) values[3]; - - int current = countNearbyEntities(world, entityName, xCoord, yCoord, zCoord, minSearch, maxSearch); - int minRange = (Integer) values[4]; - int maxRange = (Integer) values[5]; - - boolean isValid; - if (minRange <= maxRange) { - isValid = (current <= maxRange && current >= minRange); - } else { - isValid = !(current < minRange && current > maxRange); - } - return isInverted ? isValid : !isValid; - } - - private int countNearbyEntities(World world, String searchName, int xCoord, int yCoord, int zCoord, int minRange, - int maxRange) { - int count = 0; - for (int i = 0; i < world.loadedEntityList.size(); ++i) { - Entity entities = (Entity) world.loadedEntityList.get(i); - if (entities.isEntityAlive()) { - String entityName = ""; - try { - entityName = EntityList.getEntityString(entities); - } catch (Exception e) { - ProjectZuluLog.severe("Error Accessing Entity Name of %s", entities.getClass().getSimpleName()); - e.printStackTrace(); - continue; - } - if (!searchName.trim().equals("") && !searchName.equalsIgnoreCase(entityName)) { - continue; - } - - int distance = (int) Math.sqrt(entities.getDistanceSq(xCoord, yCoord, zCoord)); - if (maxRange >= minRange && distance >= minRange && distance <= maxRange) { - count++; - continue; - } else if (maxRange < minRange && !(distance < minRange && distance > maxRange)) { - count++; - continue; - } - } - } - return count; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/c087b0f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/c087b0f9c42100141fce95f06aba7e85 deleted file mode 100644 index b583356..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/c087b0f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,330 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; - - -public class ObfuscationHelper { - - /** - * Helper used to See if we are unObfuscated by checking for a known non-Obfuscated name - * return true if unObfuscated (eclipse), false if obfuscated (Minecraft) - * @param list - */ - public static boolean isUnObfuscated(Field[] fieldList, String desired){ - for (int i = 0; i < fieldList.length; i++) { - if(fieldList[i].getName().equals(desired)){ - return true; - } - } - return false; - } - - public static boolean isUnObfuscated(Class regularClass, String regularClassName){ - return regularClass.getSimpleName().equals(regularClassName); - } - - public static Object invokeMethod(String eclipseName, String seargeName, Class containingClass, - Object containterInstance, Object... args) { - try { - Method method; - method = getIntanceOfMethod(eclipseName, seargeName, containterInstance); - if (method == null) { - throw new NoSuchMethodException(); - } - method.setAccessible(true); - return method.invoke(containterInstance, args); - } catch (NoSuchMethodException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } catch (InvocationTargetException e) { - ProjectZuluLog.severe("Obfuscation needs updating to access method %s. Notify modmaker.", eclipseName); - e.printStackTrace(); - } - return null; - } - - private static Method getIntanceOfMethod(String eclipseName, String seargeName, Object containterInstance, Class... topClassToLook) { - Class classToSearch = containterInstance.getClass(); - while (classToSearch.getSuperclass() != null) { - for (Method method : classToSearch.getDeclaredMethods()) { - if (eclipseName.equalsIgnoreCase(method.getName()) || seargeName.equalsIgnoreCase(method.getName())) { - return method; - } - } - classToSearch = classToSearch.getSuperclass(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get Static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Class containingClass, Class type){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(null)); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * @param fieldName - * @param type - * @return - */ - public static T getFieldFromReflection(String fieldName, Object containterInstance, Class type){ - return getFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Get Non-Static Field - */ - public static T getFieldFromReflection(String srgName, String sourceName, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(srgName, containterInstance.getClass(), containterInstance, type); - } catch (NoSuchFieldException e) { - return getFieldFromReflection(sourceName, containterInstance.getClass(), containterInstance, type); - } - } - - public static T getFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, - Class type) { - try { - return getCatchableFieldFromReflection(fieldName, containingClass, containterInstance, type); - } catch (NoSuchFieldException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s %s. Please notify modmaker Immediately.", - fieldName, type.getSimpleName()); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Object containterInstance, Class type) - throws NoSuchFieldException { - return getCatchableFieldFromReflection(fieldName, containterInstance.getClass(), containterInstance, type); - } - - /** - * Helper method to Perform Reflection to Get non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param type - * @return - */ - public static T getCatchableFieldFromReflection(String fieldName, Class containingClass, Object containterInstance, Class type) - throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - desiredField.setAccessible(true); - return type.cast(desiredField.get(containterInstance)); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - return null; - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value) throws NoSuchFieldException{ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, Object containterInstance, boolean isPrivate, T value){ - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - */ - public static void setFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - }catch (NoSuchFieldException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (IllegalAccessException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - }catch (SecurityException e) { - ProjectZuluLog.severe("Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - /** - * Helper method to Perform Reflection to Set non-static Field of Provided Type. Field is assumed Private. - * - * @param fieldName - * @param containingClass Class that contains desired field containerInstance should be castable to it. Required to - * get fields from parent classes - * @param containterInstance Instance of the Object to get the non-static Field - * @param isPrivate Whether the field is private and requires setAccessible(true) - * @param type - * @param value - * @return - * @throws NoSuchFieldException - */ - public static void setCatchableFieldUsingReflection(String fieldName, Class containingClass, - Object containterInstance, boolean isPrivate, boolean isFinal, T value) throws NoSuchFieldException { - try { - Field desiredField = containingClass.getDeclaredField(fieldName); - if (isPrivate) { - desiredField.setAccessible(true); - } - if (isFinal || isPrivate) { - Field modifiersField = Field.class.getDeclaredField("modifiers"); - modifiersField.setAccessible(true); - modifiersField.set(desiredField, desiredField.getModifiers() & ~Modifier.FINAL); - } - desiredField.set(containterInstance, value); - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } catch (SecurityException e) { - ProjectZuluLog.severe( - "Obfuscation needs to be updated to access the %s. Please notify modmaker Immediately.", fieldName); - e.printStackTrace(); - } - } - - - public static Class getDeclaredClass(String className, Class containingClass){ - for (Class declaredClass : containingClass.getDeclaredClasses()) { - if(declaredClass.getSimpleName().equals(className)){ - return declaredClass; - } - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/e0b296e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/e0b296e6c42100141fce95f06aba7e85 deleted file mode 100644 index e0669ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/e0b296e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomPoint extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomPoint() { - super(false); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ > 0 || random.nextInt(3) == 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randompoint"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/e10c14a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/e10c14a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9f416c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ee/e10c14a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreeLog extends Block { - - public BlockPalmTreeLog() { - super(Material.wood); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setStepSound(Block.soundTypeWood); - } - - /** - * The type of render function that is called for this block - */ - @Override - public int getRenderType() { - return 0; - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Determines the damage on the item the block drops. Used in cloth and wood. - */ - @Override - public int damageDropped(int par1) { - return par1; - } - - /** - * ejects contained items into the world, and notifies neighbors of an update, as appropriate - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; - - if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { - for (int var9 = -var7; var9 <= var7; ++var9) { - for (int var10 = -var7; var10 <= var7; ++var10) { - for (int var11 = -var7; var11 <= var7; ++var11) { - Block var12 = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - - if (var12 != null) { - var12.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - @Override - public boolean canSustainLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public boolean isWood(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/103cd900c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/103cd900c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index c7a2e26..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/103cd900c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,154 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EnumCreatureAttribute; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityMummy extends EntityGenericAnimal implements IMob { - - public EntityMummy(World par1World) { - super(par1World); - setSize(0.6F, 1.8F); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0f, true)); - - tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0f)); - tasks.addTask(6, new EntityAIWander(this, 1.0f, 80)); - - tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); - tasks.addTask(8, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - public EntityMummy(World par1World, double parx, double pary, double parz) { - this(par1World); - yOffset = 0.0f; - setLocationAndAngles(parx, pary, parz, 1, 1); - setPosition(parx, pary, parz); - } - - @Override - protected void entityInit() { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte) 0)); - } - - @Override - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.boundingBox.minY); - int k = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, i, j, k) > this.rand.nextInt(32)) { - return false; - } else { - int l = this.worldObj.getBlockLightValue(i, j, k); - - if (this.worldObj.isThundering()) { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - l = this.worldObj.getBlockLightValue(i, j, k); - this.worldObj.skylightSubtracted = i1; - } - - return l <= this.rand.nextInt(8); - } - } - - @Override - protected void updateAITick() { - setAngerLevel(100); - - this.setBesideClimbableBlock(this.isCollidedHorizontally); - super.updateAITick(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "mummyroar"; - } - - /** - * Returns the Y offset from the entity's position for any entity riding this one. - */ - @Override - public double getMountedYOffset() { - return this.height * 0.75D - 0.5D; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return true; - } - - /** - * returns true if this entity is by a ladder, false otherwise - */ - @Override - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - - /** - * Sets the Entity inside a web block. - */ - @Override - public void setInWeb() { - } - - /** - * Get this Entity's EnumCreatureAttribute - */ - @Override - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - - /** - * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using - * setBesideClimableBlock. - */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - - /** - * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is - * false. - */ - public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); - if (par1) { - var2 = (byte) (var2 | 1); - } else { - var2 &= -2; - } - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/2053c9a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/2053c9a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2f380de..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/2053c9a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package projectzulu.common.core; -/** - * Usage: - * Pair pair = Pair.createPair(1, "test"); - * pair.getElement0(); - * pair.getElement1(); - * @param - * @param - */ -public class Pair { - - private final K element0; - private final V element1; - - public static Pair createPair(K element0, V element1) { - return new Pair(element0, element1); - } - - public Pair(K element0, V element1) { - this.element0 = element0; - this.element1 = element1; - } - - public K getElement0() { - return element0; - } - - public V getElement1() { - return element1; - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/317febf7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/317febf7c42100141fce95f06aba7e85 deleted file mode 100644 index 531b65e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/317febf7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.world2; - -import java.util.EnumSet; -import java.util.Random; - -/** - * Two Dimensional Direction - */ -public enum Direction { - /* U = Up, D = Down, L = Left, R = Right */ - U(0, 0, 1), D(1, 0, -1), L(2, 1, 0), R(3, -1, 0), UL(4, 1, 1), UR(5, -1, 1), DL(6, 1, -1), DR(7, -1, -1); - - public final int x; - public final int z; - public final int id; - - Direction(int id, int x, int z) { - this.id = id; - this.x = x; - this.z = z; - } - - public static final Direction[] invert = { D, U, R, L, DR, DL, UR, UL }; - public static final Direction[] cwRotation = { UR, DL, UL, DR, U, R, L, D }; - public static final Direction[] ccwRotation = { UL, DR, DL, UR, L, U, D, R }; - - public Direction invert() { - return invert[id]; - } - - /* Rotate Direction by an Ordinal either Clockwise or CounterClockwise */ - public Direction rotateOrdinal(boolean clockwise) { - return clockwise ? cwRotation[id] : ccwRotation[id]; - } - - public static Direction getCardinal(Random random) { - return getCardinal(random.nextInt(4)); - } - - public static Direction getCardinal(int id) { - id = id & 3; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getCardinals() { - return EnumSet.of(U, D, L, R); - } - - public static Direction getOrdinal(Random random) { - return getOrdinal(random.nextInt(8)); - } - - public static Direction getOrdinal(int id) { - id = id & 7; - for (Direction direction : Direction.values()) { - if (direction.id == id) { - return direction; - } - } - throw new IllegalArgumentException("ID provided " + Integer.toString(id) + " is not a Direction"); - } - - public static EnumSet getOrdinals() { - return EnumSet.of(U, D, L, R, UL, UR, DL, DR); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/41c44400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/41c44400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index b57847f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/41c44400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(ctx, data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ChannelHandlerContext ctx, ByteBufOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(ctx, byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ChannelHandlerContext ctx, ByteBufInputStream buffer) throws IOException; -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/815031fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/815031fac42100141fce95f06aba7e85 deleted file mode 100644 index 4569a3d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/815031fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBearHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBearHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.head", 58, 0); - setTextureOffset("HEADROT.cuff", 58, 16); - setTextureOffset("HEADROT.earl", 69, 12); - setTextureOffset("HEADROT.earr", 75, 12); - setTextureOffset("HEADROT.nose", 58, 12); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 20F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -3F, -5F, 7, 6, 5); - HEADROT.addBox("cuff", -2F, 3F, -3F, 4, 1, 3); - HEADROT.addBox("earl", -4F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("earr", 2F, -5F, -3F, 2, 2, 1); - HEADROT.addBox("nose", -1.5F, 0F, -7F, 3, 2, 2); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/a0eef8a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/a0eef8a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index feb0740..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/a0eef8a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,577 +0,0 @@ -package projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.List; -import java.util.Scanner; - -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; - -/** - * Helper NBT Enum for proccessing NBTTagCompounds. Functions are recursive, due to the linked nature of NBTtags, they - * will call eachother as they go through the NBT tree. The Functions are stateless, depending on the provided input. - */ -public enum NBTHelper { - TAG_END(0) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }, - TAG_BYTE(1) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByte nbtTag = (NBTTagByte) currentNode.getData(); - nbtTagCompound.setByte(currentNode.getTagName(), nbtTag.func_150290_f()); - } - - @Override - String getValue(NBTBase currentTag) { - return Byte.toString(((NBTTagByte) currentTag).func_150290_f()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByte nbtTag = (NBTTagByte) currentNBT; - return new NBTTagByte(Byte.parseByte(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_SHORT(2) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagShort nbtTag = (NBTTagShort) currentNode.getData(); - nbtTagCompound.setShort(currentNode.getTagName(), nbtTag.func_150289_e()); - } - - @Override - String getValue(NBTBase currentTag) { - return Short.toString(((NBTTagShort) currentTag).func_150289_e()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagShort nbtTag = (NBTTagShort) currentNBT; - return new NBTTagShort(Short.parseShort(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_INT(3) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagInt nbtTag = (NBTTagInt) currentNode.getData(); - nbtTagCompound.setInteger(currentNode.getTagName(), nbtTag.func_150287_d()); - } - - @Override - String getValue(NBTBase currentTag) { - return Integer.toString(((NBTTagInt) currentTag).func_150287_d()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagInt nbtTag = (NBTTagInt) currentNBT; - return new NBTTagInt(Integer.parseInt(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LONG(4) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagLong nbtTag = (NBTTagLong) currentNode.getData(); - nbtTagCompound.setLong(currentNode.getTagName(), nbtTag.func_150291_c()); - } - - @Override - String getValue(NBTBase currentTag) { - return Long.toString(((NBTTagLong) currentTag).func_150291_c()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagLong nbtTag = (NBTTagLong) currentNBT; - return new NBTTagLong(Long.parseLong(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_FLOAT(5) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNode.getData(); - nbtTagCompound.setFloat(currentNode.getTagName(), nbtTag.func_150288_h()); - } - - @Override - String getValue(NBTBase currentTag) { - return Float.toString(((NBTTagFloat) currentTag).func_150288_h()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagFloat nbtTag = (NBTTagFloat) currentNBT; - return new NBTTagFloat(Float.parseFloat(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_DOUBLE(6) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNode.getData(); - nbtTagCompound.setDouble(currentNode.getTagName(), nbtTag.func_150286_g()); - } - - @Override - String getValue(NBTBase currentTag) { - return Double.toString(((NBTTagDouble) currentTag).func_150286_g()); - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagDouble nbtTag = (NBTTagDouble) currentNBT; - return new NBTTagDouble(Double.parseDouble(newValue)); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_BYTE_ARRAY(7) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNode.getData(); - nbtTagCompound.setByteArray(currentNode.getTagName(), nbtTag.func_150292_c()); - } - - @Override - String getValue(NBTBase currentTag) { - byte[] byteArray = ((NBTTagByteArray) currentTag).func_150292_c(); - String value = "{"; - for (int i = 0; i < byteArray.length; i++) { - value = value.concat(Byte.toString(byteArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagByteArray nbtTag = (NBTTagByteArray) currentNBT; - ArrayList fillerByteArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextByte()) { - fillerByteArray.add(scanner.nextByte()); - } - scanner.close(); - byte[] resultByte = new byte[fillerByteArray.size()]; - for (int i = 0; i < fillerByteArray.size(); i++) { - resultByte[i] = fillerByteArray.get(i); - } - return new NBTTagByteArray(resultByte); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_STRING(8) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagString nbtTag = (NBTTagString) currentNode.getData(); - nbtTagCompound.setString(currentNode.getTagName(), - nbtTag.func_150285_a_() != null ? nbtTag.func_150285_a_() : ""); - } - - @Override - String getValue(NBTBase currentTag) { - String string = ((NBTTagString) currentTag).func_150285_a_(); - return string != null ? string : ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagString nbtTag = (NBTTagString) currentNBT; - return new NBTTagString(newValue); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - TAG_LIST(9) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagList nbtTagList = (NBTTagList) currentTag; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", nbtTagList, List.class); - for (int i = 0; i < nbtTagList.tagCount(); i++) { - children.add(new NBTNode((NBTBase) listOtags.get(i), currentNode, "")); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newTagList); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagList tagList = (NBTTagList) currentTag; - String stringBuilder = ""; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", tagList, List.class); - for (int i = 0; i < tagList.tagCount(); i++) { - stringBuilder = stringBuilder + "" + ":" + ((NBTBase) listOtags.get(i)).getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagList oldTagList = (NBTTagList) currentNBT; - List listOtags = ObfuscationHelper.getFieldFromReflection("field_74747_a", "tagList", oldTagList, List.class); - String[] newValueParts = newValue.split(","); - NBTTagList newTagList = new NBTTagList(); - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < oldTagList.tagCount()) { - newTagList.appendTag((NBTBase) listOtags.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagList.appendTag(createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagList; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagList oldTagList = (NBTTagList) currentNode.getData(); - NBTTagList newTagList = new NBTTagList(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToTagList(newTagList, childNode); - } - nbtTagList.appendTag(newTagList); - } - }, - TAG_COMPOUND(10) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - ArrayList children = new ArrayList(); - NBTTagCompound nbtTagList = (NBTTagCompound) currentTag; - - for (Object keyObject : nbtTagList.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = nbtTagList.getTag(tagKey); - children.add(new NBTNode(nbtBase, currentNode, tagKey)); - } - return children; - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagCompound oldNBTTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newNBTTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newNBTTagCompound, childNode); - } - nbtTagCompound.setTag(currentNode.getTagName(), newNBTTagCompound); - } - - @Override - String getValue(NBTBase currentTag) { - NBTTagCompound tagCompound = (NBTTagCompound) currentTag; - String stringBuilder = ""; - for (Object keyObject : tagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - NBTBase nbtBase = tagCompound.getTag(tagKey); - stringBuilder = stringBuilder + tagKey + ":" + nbtBase.getId() + ","; - } - return stringBuilder; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNBT; - - String[] newValueParts = newValue.split(","); - NBTTagCompound newTagCompound = new NBTTagCompound(); - int numOldEntries = oldTagCompound.func_150296_c().size(); - ArrayList oldNBT = new ArrayList(numOldEntries); - for (Object keyObject : oldTagCompound.func_150296_c()) { - String tagKey = (String) keyObject; - oldNBT.add(oldTagCompound.getTag(tagKey)); - } - - for (int i = 0; i < newValueParts.length; i++) { - String[] newValuePieces = newValueParts[i].split(":"); - if (i < numOldEntries) { - newTagCompound.setTag(newValuePieces[0], oldNBT.get(i)); - } else { - String[] values = new String[newValuePieces.length - 2]; - for (int j = 2; j < values.length; j++) { - values[j - 2] = newValuePieces[j]; - } - newTagCompound.setTag(newValuePieces[0], createChildTag(Byte.parseByte(newValuePieces[1]), values)); - } - } - return newTagCompound; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - NBTTagCompound oldTagCompound = (NBTTagCompound) currentNode.getData(); - NBTTagCompound newTagCompound = new NBTTagCompound(); - for (NBTNode childNode : currentNode.getChildren()) { - NBTHelper helper = getByID(childNode.getData().getId()); - helper.writeToNBT(newTagCompound, childNode); - } - nbtTagList.appendTag(newTagCompound); - } - }, - TAG_INT_ARRAY(11) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNode.getData(); - nbtTagCompound.setIntArray(currentNode.getTagName(), nbtTag.func_150302_c()); - } - - @Override - String getValue(NBTBase currentTag) { - int[] intArray = ((NBTTagIntArray) currentTag).func_150302_c(); - String value = "{"; - for (int i = 0; i < intArray.length; i++) { - value = value.concat(Integer.toString(intArray[i])).concat(","); - } - value = value.concat("}"); - return value; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - NBTTagIntArray nbtTag = (NBTTagIntArray) currentNBT; - ArrayList fillerIntArray = new ArrayList(); - Scanner scanner = new Scanner(newValue); - while (scanner.hasNextInt()) { - fillerIntArray.add(scanner.nextInt()); - } - scanner.close(); - int[] resultInt = new int[fillerIntArray.size()]; - for (int i = 0; i < fillerIntArray.size(); i++) { - resultInt[i] = fillerIntArray.get(i); - } - return new NBTTagIntArray(resultInt); - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - nbtTagList.appendTag(currentNode.getData()); - } - }, - UNKNOWN(12) { - @Override - ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode) { - return new ArrayList(); - } - - @Override - void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode) { - } - - @Override - String getValue(NBTBase currentTag) { - return ""; - } - - @Override - NBTBase getNBTFromString(NBTBase currentNBT, String newValue) { - return null; - } - - @Override - void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode) { - } - }; - - public int iD; - - private NBTHelper(int iD) { - this.iD = iD; - } - - abstract ArrayList getChildTags(NBTBase currentTag, NBTNode currentNode); - - abstract void writeToNBT(NBTTagCompound nbtTagCompound, NBTNode currentNode); - - /** - * Return Value of Tag in the Form of a String. For Container tags, such as @link{NBTTagList} it returns List Size - * TODO: Should return list of Tags - */ - abstract String getValue(NBTBase currentTag); - - /** - * Sets Value of Value in the Form of a String. For Container tags, such as @link{NBTTagList} Does Nothing TODO: it - * sets the List Size - */ - abstract NBTBase getNBTFromString(NBTBase currentNBT, String newValue); - - abstract void writeToTagList(NBTTagList nbtTagList, NBTNode currentNode); - - public static NBTHelper getByID(int iD) { - for (NBTHelper nbtHelper : NBTHelper.values()) { - if (nbtHelper.iD == iD) { - return nbtHelper; - } - } - return UNKNOWN; - } - - public static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0dbe5a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0dbe5a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index b3f016f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/d0dbe5a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.nbt.NBTBase; - -import org.lwjgl.util.Point; - -public class GUIEditNodeTextField extends GuiTextField { - private NBTNode selectedNode = null; - - public GUIEditNodeTextField(FontRenderer par1FontRenderer, int xPos, int yPos, int width, int height) { - super(par1FontRenderer, xPos, yPos, width, height); - } - - public GUIEditNodeTextField(FontRenderer fontRenderer, int maxTextChars, Point screenSize, Point backgroundSize, - Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - setupTextField(30000); - } - - public GUIEditNodeTextField(GUIEditNodeTextField oldTextFields, FontRenderer fontRenderer, int maxTextChars, - Point screenSize, Point backgroundSize, Point position, Point boxSize) { - this(fontRenderer, (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(), - (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(), boxSize.getX(), boxSize.getY()); - - this.selectedNode = oldTextFields.selectedNode; - setText(oldTextFields.getText()); - setupTextField(30000); - } - - private void setupTextField(int maxTextChars) { - setTextColor(-1); - setDisabledTextColour(-1); - setMaxStringLength(maxTextChars); - setEnableBackgroundDrawing(false); - } - - public boolean isEnabled() { - return selectedNode != null; - } - - public void setSelectedNode(NBTNode selectedNode) { - this.selectedNode = selectedNode; - setText(selectedNode.getValue()); - } - - public boolean saveAndClear(NBTTree nodeTree) { - NBTBase newNBT = selectedNode.createNBTFromString(getText()); - if (newNBT != null) { - if (selectedNode.getParent() != null) { - selectedNode.getParent().replaceChild(selectedNode, - new NBTNode(newNBT, selectedNode.getParent(), selectedNode.getTagName())); - } else { - // Properties name is arbitrary, the top compound in entity NBT is/was typically called properties - selectedNode = new NBTNode(newNBT, null, "Properties"); - } - clear(); - return true; - } - return false; - } - - public void clear() { - selectedNode = null; - setText(""); - } - - @Override - public boolean textboxKeyTyped(char keyChar, int keyID) { - if (selectedNode != null) { - return super.textboxKeyTyped(keyChar, keyID); - } - return false; - } - - @Override - public void mouseClicked(int par1, int par2, int par3) { - if (selectedNode != null) { - super.mouseClicked(par1, par2, par3); - } - } - - @Override - public void drawTextBox() { - super.drawTextBox(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/e1e731e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/e1e731e4c42100141fce95f06aba7e85 deleted file mode 100644 index d922708..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/e1e731e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,58 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/f01a99ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/f01a99ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6e0e7bf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/f01a99ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockWoodSlab; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import projectzulu.common.ProjectZulu_Core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockZuluSlab extends BlockWoodSlab { - - public static Block singleSlabID; - Block baseBlock; - - /** Single Slab Constructor */ - public BlockZuluSlab(Block baseBlock) { - super(false); - singleSlabID = this; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - /** Double Slab Constructor */ - public BlockZuluSlab(Block singleSlab, Block baseBlock) { - super(true); - singleSlabID = singleSlab; - this.baseBlock = baseBlock; - setLightOpacity(0); - setHardness(2.0F); - setResistance(5.0F); - setStepSound(Block.soundTypeWood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - @Override - protected ItemStack createStackedBlock(int par1) { - return new ItemStack(singleSlabID, 2, par1 & 7); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return baseBlock.getIcon(par1, par2 & 7); - } - - @Override - public String func_150002_b(int par1) { - return super.getUnlocalizedName(); - } - - @Override - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - par3List.add(new ItemStack(par1, 1, 0)); - } - - @Override - public Item getItemDropped(int par1, Random par2Random, int par3) { - return Item.getItemFromBlock(singleSlabID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/f10b05f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/f10b05f6c42100141fce95f06aba7e85 deleted file mode 100644 index b738ec7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ef/f10b05f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityBlueFinch extends EntityFinch { - - public EntityBlueFinch(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/003ca0fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/003ca0fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4493e5d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/003ca0fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/007228e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/007228e4c42100141fce95f06aba7e85 deleted file mode 100644 index 1c8212d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/007228e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemAloeVeraSeeds extends Item { - - /** - * The ItemID of block this seed turns into (wheat or pumpkin stems for instance) - */ - private Block blockType; - - public ItemAloeVeraSeeds(Block turnIntoID, String unlocalizedName) { - super(); - blockType = turnIntoID; - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(unlocalizedName); - setTextureName(DefaultProps.blockKey + ":" + unlocalizedName); - } - - @Override - public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int xCoord, int yCoord, int zCoord, - int par7, float par8, float par9, float par10) { - if (par7 != 1) { - return false; - } else if (player.canPlayerEdit(xCoord, yCoord, zCoord, par7, itemStack) - && player.canPlayerEdit(xCoord, yCoord + 1, zCoord, par7, itemStack)) { - Block block = world.getBlock(xCoord, yCoord, zCoord); - - if ((block == Blocks.dirt || block == Blocks.sand || block == Blocks.grass) - && world.isAirBlock(xCoord, yCoord + 1, zCoord)) { - world.setBlock(xCoord, yCoord + 1, zCoord, this.blockType); - --itemStack.stackSize; - return true; - } else { - return false; - } - } else { - return false; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/20d810ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/20d810ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9affc23..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/20d810ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/21285ca2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/21285ca2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a3f5688..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/21285ca2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world; - -import java.util.Random; - -public enum CellIndexDirection { - Middle, Inner, NorthMiddle, SouthMiddle, WestMiddle, EastMiddle, NorthWestCorner, NorthEastCorner, SouthWestCorner, SouthEastCorner, NorthWall, SouthWall, WestWall, EastWall; - - public boolean isCorner() { - return this == NorthWestCorner || this == NorthEastCorner || this == SouthWestCorner || this == SouthEastCorner; - } - - public static CellIndexDirection randomCardinalDirection(Random random) { - switch (random.nextInt(4)) { - case 0: - return NorthMiddle; - case 1: - return SouthMiddle; - case 2: - return WestMiddle; - case 3: - return EastMiddle; - default: - return NorthMiddle; - } - } - - public CellIndexDirection calcDirection(int cellIndex, int cellSize) { - - /* Check if Middle */ - if (cellSize % 2 == 1) { - if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1) / 2) { - return Middle; - } else if (cellIndex == (cellSize - 1) / 2) { - return WestMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2) { - return NorthMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) + (cellSize - 1) / 2) { - return EastMiddle; - } else if (cellIndex == cellSize * (cellSize - 1) / 2 + (cellSize - 1)) { - return SouthMiddle; - } - } - - /* Check if Corner */ - if (cellIndex == 0) { - return NorthWestCorner; - } else if (cellIndex == cellSize - 1) { - return SouthWestCorner; - } else if (cellIndex == cellSize * cellSize - 1) { - return SouthEastCorner; - } else if (cellIndex == cellSize * cellSize - cellSize) { - return NorthEastCorner; - } - - /* Check if Outer Edge */ - if ((cellIndex % cellSize == (0))) { - return NorthWall; - } else if ((cellIndex % cellSize == (cellSize - 1))) { - return SouthWall; - } else if (cellIndex >= cellSize * (cellSize - 1) && cellIndex < cellSize * cellSize) { - return EastWall; - } else if (cellIndex >= 0 && cellIndex < cellSize) { - return WestWall; - } - - /* If Nothing Else Mark as Inner */ - return Inner; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/3113f59fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/3113f59fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cde2d21..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/3113f59fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.BlockWithPalmTree; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/31f7c4fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/31f7c4fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 87943ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/31f7c4fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/50fc8df4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/50fc8df4c42100141fce95f06aba7e85 deleted file mode 100644 index 14154b2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/50fc8df4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerOasis; - -public class OasisFeature extends BiomeFeature { - public static final String OASIS = "Oasis"; - - public OasisFeature() { - super(OASIS, Size.SMALL); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 3; - chunksPerSpawn = 400; - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.desert.biomeName, BiomeGenBase.desertHills.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (!BlockList.palmTreeSapling.isPresent() || !BlockList.palmTreeLog.isPresent() - || !BlockList.palmTreeLeaves.isPresent()) { - return false; - } - - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 3, 6)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerOasis(world, direction, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 3, - genBlockCoords.posZ), 6, 8, 3).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/50ff42f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/50ff42f6c42100141fce95f06aba7e85 deleted file mode 100644 index d08cdf1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/50ff42f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/513baaf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/513baaf8c42100141fce95f06aba7e85 deleted file mode 100644 index dd9ed3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/513baaf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,596 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityHornBill; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/51a2829fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/51a2829fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f7fe156..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/51a2829fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.potion; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.item.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; - -public class EntityPZPotion extends EntityPotion { - - private ItemStack potionStack; - - public EntityPZPotion(World par1World) { - super(par1World); - } - - public EntityPZPotion(World world, EntityLivingBase living, ItemStack itemStack) { - super(world, living, itemStack); - potionStack = itemStack; - } - - public EntityPZPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { - super(par1World, par2, par4, par6, par8ItemStack); - potionStack = par8ItemStack; - } - - @Override - public int getPotionDamage() { - return potionStack != null ? potionStack.getItemDamage() : 0; - } - - @Override - protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { - if (!this.worldObj.isRemote && potionStack.getItem() != null && potionStack.getItem() instanceof ItemPotion) { - @SuppressWarnings("unchecked") - List effectList = ((ItemPotion) potionStack.getItem()).getEffects(potionStack); - - if (effectList != null && !effectList.isEmpty()) { - AxisAlignedBB axisalignedbb = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - @SuppressWarnings("unchecked") - List entityList = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, - axisalignedbb); - - if (entityList != null && !entityList.isEmpty()) { - Iterator iterator = entityList.iterator(); - - while (iterator.hasNext()) { - EntityLivingBase entityliving = iterator.next(); - double squareDistance = this.getDistanceSqToEntity(entityliving); - - if (squareDistance < 16.0D) { - double distanceFactor = 1.0D - Math.sqrt(squareDistance) / 4.0D; - - if (entityliving == par1MovingObjectPosition.entityHit) { - distanceFactor = 1.0D; - } - - Iterator iterator1 = effectList.iterator(); - - while (iterator1.hasNext()) { - PotionEffect potioneffect = iterator1.next(); - int potionID = potioneffect.getPotionID(); - - if (Potion.potionTypes[potionID].isInstant()) { - Potion.potionTypes[potionID].affectEntity(this.getThrower(), entityliving, - potioneffect.getAmplifier(), distanceFactor); - } else { - int potionDuration = (int) (distanceFactor * potioneffect.getDuration() + 0.5D); - - if (potionDuration > 20) { - entityliving.addPotionEffect(new PotionEffect(potionID, potionDuration, - potioneffect.getAmplifier())); - } - } - } - } - } - } - } - - this.worldObj.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), - (int) Math.round(this.posZ), potionStack.getItemDamage()); - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - - if (par1NBTTagCompound.hasKey("Potion")) { - potionStack = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); - } - - if (potionStack == null) { - this.setDead(); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - - if (potionStack != null) { - par1NBTTagCompound.setTag("Potion", potionStack.writeToNBT(new NBTTagCompound())); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/80df2efac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/80df2efac42100141fce95f06aba7e85 deleted file mode 100644 index 255cc10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/80df2efac42100141fce95f06aba7e85 +++ /dev/null @@ -1,71 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBoarHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - - public ModelBoarHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.nose2", 28, 0); - setTextureOffset("HEADROT.nose1", 42, 0); - setTextureOffset("HEADROT.tusklef1", 0, 29); - setTextureOffset("HEADROT.tusklef2", 0, 27); - setTextureOffset("HEADROT.tuskrig1", 0, 29); - setTextureOffset("HEADROT.tuskrig2", 0, 27); - setTextureOffset("HEADROT.tusklef3", 0, 29); - setTextureOffset("HEADROT.tusklef4", 0, 27); - setTextureOffset("HEADROT.tuskrig3", 0, 29); - setTextureOffset("HEADROT.tuskrig4", 0, 27); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 4F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -4F, -3.5F, -5F, 8, 7, 6); - HEADROT.addBox("nose2", -2.5F, -0.5F, -7F, 5, 4, 2); - HEADROT.addBox("nose1", -2F, 0.5F, -9F, 4, 3, 2); - HEADROT.addBox("tusklef1", -4F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tusklef2", -4F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tuskrig1", 2F, 2.5F, -9F, 2, 1, 1); - HEADROT.addBox("tuskrig2", 3F, 1.5F, -9F, 1, 1, 1); - HEADROT.addBox("tusklef3", -4.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tusklef4", -4.5F, 1.5F, -7F, 1, 1, 1); - HEADROT.addBox("tuskrig3", 2.5F, 2.5F, -7F, 2, 1, 1); - HEADROT.addBox("tuskrig4", 3.5F, 1.5F, -7F, 1, 1, 1); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/90fc8ff8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/90fc8ff8c42100141fce95f06aba7e85 deleted file mode 100644 index 095bc24..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/90fc8ff8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.entity.RenderLiving; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; - -public class RenderGenericLiving extends RenderLiving implements RenderWrapper { - - public final ResourceLocation livingTexture; - - public RenderGenericLiving(ModelBase modelBase, float shadowSize, ResourceLocation livingTexture) { - super(modelBase, shadowSize); - this.livingTexture = livingTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - return livingTexture; - } - - @Override - public Render getRender() { - return this; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/917469fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/917469fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 025521a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/917469fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSky extends KeyParserBase { - - public KeyParserSky(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - if (pieces.length == 1) { - parsedChainable.add(new TypeValuePair(key, isInverted(parseable))); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing Needs Sky parameter. Invalid Argument Length."); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - boolean isInverted = (Boolean) typeValuePair.getValue(); - boolean canSeeSky = canBlockSeeTheSky(world, xCoord, yCoord, zCoord); - return isInverted ? canSeeSky : !canSeeSky; - } - - protected boolean canBlockSeeTheSky(World world, int xCoord, int yCoord, int zCoord) { - return world.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/a050a3429620001419c88e79630e4081 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/a050a3429620001419c88e79630e4081 deleted file mode 100644 index cfd8ae2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/a050a3429620001419c88e79630e4081 +++ /dev/null @@ -1,168 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Random; -import net.minecraft.util.MathHelper; -import net.minecraft.util.Vec3; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class RandomPositionGenerator -{ - /** - * used to store a direction when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. - * MULTIPLE findTowards and findAway calls, will share this var - */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - - /** - * finds a random target within par1(x,z) and par2 (y) blocks - */ - public static Vec3 findRandomTarget(EntityGenericCreature par0EntityCreature, int par1, int par2) { - return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 - */ - public static Vec3 findRandomTargetBlockTowards(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; - staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; - staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 - */ - public static Vec3 findRandomTargetBlockAwayFrom(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; - staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; - staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; - return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); - } - - /** - * finds a random target within par1(x,z) and par2 (y) blocks trending towards desired height level above ground - */ - public static Vec3 flyRandomlyTowardHeightLevel(EntityGenericCreature par0EntityCreature, int par1, int par2, int heightLevel) { - return flyToRandomTargetBlockAtHeight(par0EntityCreature, par1, par2, (Vec3)null, heightLevel); - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 findRandomTargetBlock(EntityGenericCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { - Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (par0EntityCreature.hasHome()) { - double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); - double var13 = (double)(par0EntityCreature.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17 = var4.nextInt(2 * par2) - par2; - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(par0EntityCreature.posX); - var17 += MathHelper.floor_double(par0EntityCreature.posY); - var14 += MathHelper.floor_double(par0EntityCreature.posZ); - - if (!var10 || par0EntityCreature.isWithinHomeDistance(var12, var17, var14)) { - float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - //return par0EntityCreature.a((double) k, (double) l, (double) i1); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } - - /** - * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of - * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number - */ - private static Vec3 flyToRandomTargetBlockAtHeight(EntityGenericCreature entity, int par1, int par2, Vec3 par3Vec3, int heightLevel) { - Random var4 = entity.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; - - if (entity.hasHome()) { - double var11 = (double)(entity.getHomePosition().getDistanceSquared(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY), MathHelper.floor_double(entity.posZ)) + 4.0F); - double var13 = (double)(entity.getMaximumHomeDistance() + (float)par1); - var10 = var11 < var13 * var13; - } - else { - var10 = false; - } - - for (int var16 = 0; var16 < 10; ++var16) { - int var12 = var4.nextInt(2 * par1) - par1; - int var17; - if(entity.posY > entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel*1.25){ - var17 = var4.nextInt(2 * par2) - par2*3/2; - }else if(entity.posY < entity.worldObj.getPrecipitationHeight( (int)entity.posX, (int)entity.posZ) + heightLevel){ - var17 = var4.nextInt(2 * par2) - par2/2; - }else{ - var17 = var4.nextInt(2 * par2) - par2; - } - - int var14 = var4.nextInt(2 * par1) - par1; - - if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { - var12 += MathHelper.floor_double(entity.posX); - var17 += MathHelper.floor_double(entity.posY); - var14 += MathHelper.floor_double(entity.posZ); - - if (!var10 || entity.isWithinHomeDistance(var12, var17, var14)) { - float var15 = entity.getBlockPathWeight(var12, var17, var14); - - if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; - var8 = var14; - var5 = true; - } - } - } - } - - if (var5) { - //return entity.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - return Vec3.createVectorHelper((double)var6, (double)var7, (double)var8); - } - else { - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/a1e442ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/a1e442ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f6d5d99..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/a1e442ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,160 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.TerrainFeatureHelper; -import projectzulu.common.core.terrain.BiomeFeature; -import projectzulu.common.core.terrain.FeatureConfiguration; -import projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/d02706e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/d02706e5c42100141fce95f06aba7e85 deleted file mode 100644 index f157fad..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/d02706e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,215 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityAerial extends EntityLiving { - - protected ChunkCoordinates targetPosition; - /** Tries to Assign targetPosition - * Checks if Valid first using isTargetPositionValid - * Returns False if invald - */ - public boolean setTargetPosition(ChunkCoordinates targetPosition){ - if(isTargetPositionValid(targetPosition)){ - this.targetPosition = targetPosition; - return true; - } - return false; - } - protected int maxFlightHeight = 20; - public int getMaxFlightHeight(){ return maxFlightHeight; } - public EntityAerial(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - - /* Handle whether Entity is Flying or not*/ - if( defaultGrounded() ){ - this.dataWatcher.addObject(17, Byte.valueOf((byte)1)); - }else{ - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - } - - } - - public boolean defaultGrounded() { - return true; - } - - public boolean isEntityGrounded() { - return this.dataWatcher.getWatchableObjectByte(17) != 0; - } - protected void setEntityGrounded(Boolean par1) { - if(par1){ - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - }else { - this.dataWatcher.updateObject(17, Byte.valueOf((byte)0)); - } - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound){ - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("Is Grounded", this.dataWatcher.getWatchableObjectByte(17)); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound){ - super.readEntityFromNBT(par1NBTTagCompound); - if(par1NBTTagCompound.hasKey("Is Grounded")){ - this.dataWatcher.updateObject(17, par1NBTTagCompound.getByte("Is Grounded")); - } - } - - @Override - protected void updateAITasks() { - if(!isEntityGrounded() && targetPosition != null){ - /* Get The Direction I want to travel in */ - double var1 = (double)this.targetPosition.posX + 0.5D - this.posX; - double var3 = (double)this.targetPosition.posY + 0.1D - this.posY; - double var5 = (double)this.targetPosition.posZ + 0.5D - this.posZ; - - /* Change Velocity */ - /* Normalize the Direction I want to travel in, then add and scale it to Motion */ - this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D*0.3D; - this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D*0.3D; - this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D*0.3D; - float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; - float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); - this.moveForward = 0.5F; - this.rotationYaw += var8; - } - super.updateAITasks(); - } - - protected boolean shouldBeFlying() { - return false; - } - - public boolean isTargetPositionValid(){ - return isTargetPositionValid(this.targetPosition); - } - - public boolean isTargetPositionValid(ChunkCoordinates targetPosition){ - /* Invalid if Water, is below height = 3 (superflat), and if its null */ - if (targetPosition != null && (!this.worldObj.isAirBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ) || targetPosition.posY < 3 - || this.worldObj.getBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ).getMaterial().equals(Material.water))){ -// targetPosition = null; - return false; - } - return true; - } - - /* Checks if Entity is at the target position, return true if TargetPosition is null*/ - public boolean atTargetPosition(){ - if(targetPosition != null){ - return getDistance(targetPosition.posX, targetPosition.posY, targetPosition.posZ) < 2; - } - return true; - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - if(isEntityGrounded()){ - super.moveEntityWithHeading(par1, par2); - return; - } - - if (this.isInWater()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.800000011920929D; - this.motionY *= 0.800000011920929D; - this.motionZ *= 0.800000011920929D; - } - else if (this.handleLavaMovement()) - { - this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - else - { - float var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); - this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; - - if (this.onGround) - { - var3 = 0.54600006F; - Block block = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); - if (block != null) - { - var3 = block.slipperiness * 0.91F; - } - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= (double)var3; - this.motionY *= (double)var3; - this.motionZ *= (double)var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; - - if (var7 > 1.0F) - { - var7 = 1.0F; - } - - this.limbSwingAmount += (var7 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwing; - } - - - /** - * Method Designed for Flying Entities to adjust the Direction They are facing to the direction they are moving - */ - protected void adjustRotationToWaypoint() { - double var8 = targetPosition.posX - this.posX; - double var10 = targetPosition.posZ - this.posZ; - float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI);// - 90.0F; - float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); - - if (var15 > 30.0F){ - var15 = 30.0F; - } - - if (var15 < -30.0F){ - var15 = -30.0F; - } - this.renderYawOffset = this.rotationYaw += var15; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/e1872dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/e1872dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 420cf55..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/e1872dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.util.MathHelper; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotionHalfPower extends SubItemPotionGeneric { - - SubItemPotionHalfPower(Item itemID, int subID, String baseName) { - super(itemID, subID, baseName); - } - - @Override - protected int calculatePower(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int basePower = PotionParser.readPower(damageMeta); - int power = (MathHelper.ceiling_float_int(basePower / 2f) + MathHelper.ceiling_float_int(baseLevel / 2f)); - return power > 3 ? 3 : power; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/f04591e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/f04591e4c42100141fce95f06aba7e85 deleted file mode 100644 index 680b206..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f/f04591e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/00cc8ae6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/00cc8ae6c42100141fce95f06aba7e85 deleted file mode 100644 index 799993f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/00cc8ae6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,334 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralWestTower implements Blueprint { - - // List wallBlocks = new ArrayList(3); - // - // public BPCathedralWestTower() { - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 5)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 10)); - // wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); - // // wallBlocks.add(new BlockWithMeta(Blocks.air, 0, 1)); - // } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - // NorthEastCorner Contains Hallway Entrance - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising East-West */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posX + 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posZ - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner && piecePos.posZ == 3 - && piecePos.posX == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posZ == 4 && (piecePos.posX == 4 || piecePos.posX == 5)) { - return piecePos.posX == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - case SouthWestCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 0 : 3; - case NorthEastCorner: - return high ? 2 : 0; - case SouthEastCorner: - return high ? 1 : 2; - case SouthWestCorner: - return high ? 3 : 1; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralWestTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/104096a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/104096a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 73462c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/104096a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,74 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.AxisAlignedBB; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAIHurtByTarget extends EntityAITarget { - boolean shouldCallAllies; - - /** The PathNavigate of our entity. */ - EntityLivingBase entityPathNavigate; - int fleeChance = 0; - /** Task Owner in the form of out Generic Creature, used to access Specialized information, such as Anger or EntityState */ - EntityGenericCreature genericTaskOwner; - - public EntityAIHurtByTarget(EntityGenericCreature par1EntityLiving, boolean shouldCallAllies, boolean shouldCheckSight) { - super(par1EntityLiving, 16.0F, shouldCheckSight); - this.shouldCallAllies = shouldCallAllies; - this.setMutexBits(1); - this.genericTaskOwner = par1EntityLiving; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - return this.isSuitableTarget(this.taskOwner.getAITarget(), false); - - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - return shouldExecute(); -// return this.taskOwner.getAITarget() != null && this.taskOwner.getAITarget() != this.entityPathNavigate; - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.entityPathNavigate = this.taskOwner.getAITarget(); - - if (this.shouldCallAllies){ - //List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), - // AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - List var1 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), - AxisAlignedBB.getBoundingBox(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand((double)this.targetDistance, 4.0D, (double)this.targetDistance)); - - Iterator var2 = var1.iterator(); - - while (var2.hasNext()){ - EntityLiving var3 = (EntityLiving)var2.next(); - - if (this.taskOwner != var3 && var3.getAttackTarget() == null){ - var3.setAttackTarget(this.taskOwner.getAITarget()); - } - } - } - super.startExecuting(); - } - - @Override - public void updateTask() { - startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1125f9f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1125f9f5c42100141fce95f06aba7e85 deleted file mode 100644 index dfa4984..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/1125f9f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,149 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAILookIdle; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.EntityAIWatchClosest; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowOwner; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIFollowParent; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMate; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtByTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIOwnerHurtTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIPanic; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; -import com.ngb.projectzulu.common.mobs.entityai.EntityAITempt; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityFox extends EntityGenericAnimal implements IAnimals { - - public EntityFox(World par1World) { - super(par1World); - setSize(0.6f, 1.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.sitting)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - tasks.addTask(4, new EntityAIFollowOwner(this, 1.0f, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.egg, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - tasks.addTask(10, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); - tasks.addTask(11, new EntityAILookIdle(this)); - - targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - public int getTotalArmorValue() { - return 2; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "foxhurtsound"; - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - } - - @Override - public boolean isValidTamingItem(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - - if (itemStack.getItem() == Items.egg) { - return true; - } - return super.isValidTamingItem(itemStack); - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.egg) { - return true; - } else { - return false; - } - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Validates if Itemstack can be used to Heal Entity Caution: ItemStack may be Null - */ - @Override - public int getHealingValueIfValid(ItemStack itemStack) { - - if (itemStack == null) { - return 0; - } - - if (itemStack.getItem() == Items.egg) { - return ((ItemFood) Items.melon).func_150905_g(itemStack); - } - - return 0; - } - - @Override - public boolean isRideable() { - return super.isRideable(); - } - - @Override - protected boolean shouldPanic() { - if (isTamed()) { - return false; - } else { - return super.shouldPanic(); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/11b723e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/11b723e4c42100141fce95f06aba7e85 deleted file mode 100644 index 5ed96ac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/11b723e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,188 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/30066c01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/30066c01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index fe891c9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/30066c01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/50d211f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/50d211f5c42100141fce95f06aba7e85 deleted file mode 100644 index d7f55d6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/50d211f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,89 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; - -public class GuiBrewingStandSingle extends GuiContainer { - - private TileEntityBrewingBase brewingStand; - - public static final ResourceLocation brewing1 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing1.png"); - public static final ResourceLocation brewing3 = new ResourceLocation(DefaultProps.coreKey, "gui/brewing3.png"); - - public GuiBrewingStandSingle(InventoryPlayer inventoryPlayer, TileEntityBrewingBase tileEntity) { - super(new ContainerBrewingStandSingle(inventoryPlayer, tileEntity)); - brewingStand = tileEntity; - } - - /** - * Draw the Foreground layer for the GuiContainer (everything in front of the items) - */ - @Override - protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String s = StatCollector.translateToLocal(this.brewingStand.getInventoryName()); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, - 4210752); - } - - /** - * Draw the background layer for the GuiContainer (everything behind the items) - */ - @Override - protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - if (brewingStand.getSizeInventory() - 1 < 3) { - this.mc.renderEngine.bindTexture(brewing1); - } else { - this.mc.renderEngine.bindTexture(brewing3); - } - - int k = (this.width - this.xSize) / 2; - int l = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); - int i1 = this.brewingStand.getBrewTime(); - - if (i1 > 0) { - int j1 = (int) (28.0F * (1.0F - i1 / 400.0F)); - - if (j1 > 0) { - this.drawTexturedModalRect(k + 97, l + 16, 176, 0, 9, j1); - } - - int k1 = i1 / 2 % 7; - - switch (k1) { - case 0: - j1 = 29; - break; - case 1: - j1 = 24; - break; - case 2: - j1 = 20; - break; - case 3: - j1 = 16; - break; - case 4: - j1 = 11; - break; - case 5: - j1 = 6; - break; - case 6: - j1 = 0; - } - - if (j1 > 0) { - this.drawTexturedModalRect(k + 65, l + 14 + 29 - j1, 185, 29 - j1, 12, j1); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/521ae0a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/521ae0a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d325bf3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/521ae0a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,198 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -public class ModelCentipede extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelCentipede() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - sidebody2.render(f5); - body.render(f5); - sidebody3.render(f5); - sidebody1.render(f5); - ANTENLEFROT1.render(f5); - ANTENRIGROT1.render(f5); - LEG11ROT.render(f5); - LEG21ROT.render(f5); - LEG31ROT.render(f5); - LEG41ROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - - ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/6100e29fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/6100e29fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8da9791..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/6100e29fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/7036a79ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/7036a79ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 63a4c85..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/7036a79ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,165 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag; - -import java.util.IllegalFormatException; -import java.util.List; - -import net.minecraft.client.audio.SoundRegistry; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagByte; -import net.minecraft.nbt.NBTTagByteArray; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagDouble; -import net.minecraft.nbt.NBTTagFloat; -import net.minecraft.nbt.NBTTagInt; -import net.minecraft.nbt.NBTTagIntArray; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagLong; -import net.minecraft.nbt.NBTTagShort; -import net.minecraft.nbt.NBTTagString; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -public class NBTWriter { - - private String toWrite; - - public NBTWriter(String toWrite) { - this.toWrite = toWrite; - } - - public void writeToNBT(NBTTagCompound nbtTagCompound) throws IllegalFormatException, IllegalArgumentException { - String[] tagParts = toWrite.split(","); - - NBTBase currentTag = nbtTagCompound; - byte currentTagID = nbtTagCompound.getId(); - for (int i = 0; i < tagParts.length; i++) { - String tagOperation = tagParts[i]; - if (tagOperation.trim().equals("")) { - continue; - } - TagParser parser = TagParser.getByID(currentTagID); - currentTag = parser.process(currentTag, tagOperation); - currentTagID = currentTag.getId(); - } - } - - private enum TagParser { - TAG_LIST(9) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagList tag = (NBTTagList) curTag; - String[] operations = tagOperation.split("/"); - int listIndex = ParsingHelper.parseFilteredInteger(operations[0], 0, "listIndex|" + tagOperation); - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - while (tag.tagCount() < listIndex + 1) { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.appendTag(child); - } - if (childtag == 9 || childtag == 10) { - List tagList = ObfuscationHelper - .getFieldFromReflection("field_74747_a", "tagList", tag, List.class); - return (NBTBase) tagList.get(listIndex); - } else { - return tag; - } - } - }, - TAG_COMPOUND(10) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - NBTTagCompound tag = (NBTTagCompound) curTag; - String[] operations = tagOperation.split("/"); - try { - int childtag = ParsingHelper.parseFilteredInteger(operations[1], 0, "childTag|" + tagOperation); - if (tag.hasKey(operations[0])) { - return tag.getTag(operations[0]); - } else { - String[] values = new String[operations.length - 2]; - for (int i = 2; i < values.length; i++) { - values[i - 2] = operations[i]; - } - NBTBase child = createChildTag((byte) childtag, values); - tag.setTag(operations[0], child); - return child; - } - } catch (IndexOutOfBoundsException e) { - throw new IndexOutOfBoundsException("Illegal NBT Length when processing " + tagOperation); - } - } - }, - UNKNOWN(12) { - @Override - public NBTBase process(NBTBase curTag, String tagOperation) { - return curTag; - } - }; - - public final int tagID; - - private TagParser(int tagID) { - this.tagID = tagID; - } - - public static TagParser getByID(int iD) { - for (TagParser parser : TagParser.values()) { - if (parser.tagID == iD) { - return parser; - } - } - return UNKNOWN; - } - - /** - * Tacks the Current NBTBase and the user-input tagOperation and process them - * - * All operations, setting values and creating tags are done to curTag to maintain the NBT hierarchy - * - * Container tags return the searched for child. Value tags curTag. - */ - public abstract NBTBase process(NBTBase curTag, String tagOperation); - } - - private static NBTBase createChildTag(byte childtag, String... values) { - switch (childtag) { - /* Container Tags */ - case 9: - return new NBTTagList(); - case 10: - return new NBTTagCompound(); - /* Value Tags: operations[2] should contain value */ - case 1: - return new NBTTagByte(Byte.parseByte(values[0].trim())); - case 2: - return new NBTTagShort(Short.parseShort(values[0].trim())); - case 3: - return new NBTTagInt(Integer.parseInt(values[0].trim())); - case 4: - return new NBTTagLong(Long.parseLong(values[0].trim())); - case 5: - return new NBTTagFloat(Float.parseFloat(values[0].trim())); - case 6: - return new NBTTagDouble(Double.parseDouble(values[0].trim())); - case 7: - byte[] byteArray = new byte[values.length]; - for (int i = 2; i < values.length; i++) { - byteArray[i - 2] = (byte) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagByteArray(byteArray); - case 8: - return new NBTTagString(""); - case 11: - int[] intArray = new int[values.length - 2]; - for (int i = 2; i < values.length; i++) { - intArray[i - 2] = (int) ParsingHelper.parseFilteredInteger(values[i], 0, "ByteArray"); - } - return new NBTTagIntArray(intArray); - default: - ProjectZuluLog.severe("Unrecognised childtag tagId %s", childtag); - throw new IllegalArgumentException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/71046af5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/71046af5c42100141fce95f06aba7e85 deleted file mode 100644 index ab7c216..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/71046af5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityPelican; -import com.ngb.projectzulu.common.mobs.models.ModelPelican; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class PelicanDeclaration extends SpawnableDeclaration { - - public PelicanDeclaration() { - super("Pelican", 37, EntityPelican.class, EnumCreatureType.ambient); - setSpawnProperties(7, 5, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (214 << 16) + (214 << 8) + 214; - eggColor2 = (168 << 16) + (62 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.22f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelPelican(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "pelican.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.river.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.beach.biomeName); - defaultBiomesToSpawn.addAll(typeToArray(Type.BEACH)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/801ef8f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/801ef8f6c42100141fce95f06aba7e85 deleted file mode 100644 index 0b9bc71..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/801ef8f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.item.Item; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutMilk extends Item { - - public ItemCoconutMilk(int par2, boolean par3bool) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - } - - public int getMetadata(int par1) { - return par1; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/91e150e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/91e150e4c42100141fce95f06aba7e85 deleted file mode 100644 index 72fb9ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/91e150e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockQuickSand; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0cbdefec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0cbdefec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb41917..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/a0cbdefec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/c073e3f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/c073e3f8c42100141fce95f06aba7e85 deleted file mode 100644 index 7ae3058..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/c073e3f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityElephant; -import com.ngb.projectzulu.common.mobs.models.ModelElephant; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ElephantDeclaration extends SpawnableDeclaration { - - public ElephantDeclaration() { - super("Elephant", 27, EntityElephant.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 4); - - eggColor1 = (88 << 16) + (67 << 8) + 50; - eggColor2 = (190 << 16) + (165 << 8) + 145; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); - customMobData.entityProperties = new EntityProperties(30f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelElephant(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "elephant.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d16d41f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d16d41f5c42100141fce95f06aba7e85 deleted file mode 100644 index 6c6909a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/d16d41f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,253 +0,0 @@ -// Date: 21/08/2012 16:58:44 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityLizard; - -public class ModelLizard extends ModelBase { - ModelRenderer leg1; - ModelRenderer leg1u; - ModelRenderer leg2; - ModelRenderer leg2u; - - ModelRenderer TAILROT; - ModelRenderer Tail3; - ModelRenderer Tail2; - ModelRenderer Tail1; - - ModelRenderer FRONTROT; - ModelRenderer HEADBASE; - ModelRenderer Frill1; - ModelRenderer Frill2; - ModelRenderer Frill3; - ModelRenderer Frill4; - ModelRenderer head; - ModelRenderer leg3u; - ModelRenderer leg3; - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg4u; - - public ModelLizard() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TAILROT.dltfold1", 0, 0); - setTextureOffset("FRONTROT.dltfold3", 0, 0); - - leg1 = new ModelRenderer(this, 20, 22); - leg1.addBox(-3F, 0F, -1F, 2, 6, 2); - leg1.setRotationPoint(-4F, 18F, 6F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg1u = new ModelRenderer(this, 14, 22); - leg1u.addBox(-1F, 0F, -1F, 1, 2, 2); - leg1u.setRotationPoint(-4F, 18F, 6F); - leg1u.setTextureSize(64, 32); - leg1u.mirror = true; - setRotation(leg1u, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 20, 22); - leg2.addBox(1F, 0F, -1F, 2, 6, 2); - leg2.setRotationPoint(4F, 18F, 6F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg2u = new ModelRenderer(this, 14, 22); - leg2u.addBox(0F, 0F, -1F, 1, 2, 2); - leg2u.setRotationPoint(4F, 18F, 6F); - leg2u.setTextureSize(64, 32); - leg2u.mirror = true; - setRotation(leg2u, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 9F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - Tail3 = new ModelRenderer(this, 0, 17); - Tail3.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail3); - Tail3.setRotationPoint(0F, -1F, 10F); - Tail3.setTextureSize(64, 32); - Tail3.mirror = true; - setRotation(Tail3, 0F, 0F, 0F); - Tail2 = new ModelRenderer(this, 0, 17); - Tail2.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail2); - Tail2.setRotationPoint(0F, -1F, 5F); - Tail2.setTextureSize(64, 32); - Tail2.mirror = true; - setRotation(Tail2, 0F, 0F, 0F); - Tail1 = new ModelRenderer(this, 0, 17); - Tail1.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail1); - Tail1.setRotationPoint(0F, -1F, 0F); - Tail1.setTextureSize(64, 32); - Tail1.mirror = true; - setRotation(Tail1, 0F, 0F, 0F); - FRONTROT = new ModelRenderer(this, "FRONTROT"); - FRONTROT.setRotationPoint(0F, 19F, 6F); - setRotation(FRONTROT, 0F, 0F, 0F); - FRONTROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - FRONTROT.addChild(HEADBASE); - HEADBASE.setRotationPoint(0F, 0F, -13F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - Frill2 = new ModelRenderer(this, 29, 22); - Frill2.addBox(-3F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill2); - Frill2.setRotationPoint(-3F, 1F, -3F); - Frill2.setTextureSize(64, 32); - Frill2.mirror = true; - setRotation(Frill2, 0F, 0.0371786F, 0F); - Frill4 = new ModelRenderer(this, 37, 22); - Frill4.addBox(-4F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill4); - Frill4.setRotationPoint(-1F, -2F, -3F); - Frill4.setTextureSize(64, 32); - Frill4.mirror = true; - setRotation(Frill4, 0F, 0F, 0F); - Frill1 = new ModelRenderer(this, 29, 22); - Frill1.addBox(0F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill1); - Frill1.setRotationPoint(3F, 1F, -3F); - Frill1.setTextureSize(64, 32); - Frill1.mirror = true; - setRotation(Frill1, 0F, 0.0371786F, 0F); - - Frill3 = new ModelRenderer(this, 37, 22); - Frill3.addBox(0F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill3); - Frill3.setRotationPoint(1F, -2F, -3F); - Frill3.setTextureSize(64, 32); - Frill3.mirror = true; - setRotation(Frill3, 0F, 0F, 0F); - Frill3.mirror = false; - head = new ModelRenderer(this, 0, 0); - head.addBox(-4F, -4F, -9F, 6, 6, 8); - HEADBASE.addChild(head); - head.setRotationPoint(1F, 1F, 1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(HEADBASE); - leg3u = new ModelRenderer(this, 14, 22); - leg3u.addBox(-1F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg3u); - leg3u.setRotationPoint(-4F, -1F, -12F); - leg3u.setTextureSize(64, 32); - leg3u.mirror = true; - setRotation(leg3u, 0F, 0F, 0F); - body = new ModelRenderer(this, 10, 0); - body.addBox(-4F, -2F, -9F, 8, 4, 18); - FRONTROT.addChild(body); - body.setRotationPoint(0F, 0F, -6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4u = new ModelRenderer(this, 14, 22); - leg4u.addBox(0F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg4u); - leg4u.setRotationPoint(4F, -1F, -12F); - leg4u.setTextureSize(64, 32); - leg4u.mirror = true; - setRotation(leg4u, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 20, 22); - leg4.addBox(1F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg4); - leg4.setRotationPoint(4F, -1F, -12F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 20, 22); - leg3.addBox(-3F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg3); - leg3.setRotationPoint(-4F, -1F, -12F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - FRONTROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - FRONTROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityLizard var5 = (EntityLizard) par1EntityLiving; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - if (var5.prepareToSpit == true) { - Frill1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.0F * par3; - Frill2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 1.0F * par3; - - Frill3.rotateAngleZ = (float) (-45 * Math.PI / 180); - Frill3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - Frill3.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - - Frill4.rotateAngleZ = (float) (45 * Math.PI / 180); - Frill4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - Frill4.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - } else { - Frill1.rotateAngleZ = (float) (-90 * Math.PI / 180); // This is on Right - Frill2.rotateAngleZ = (float) (90 * Math.PI / 180); // This is on Left - - Frill3.rotateAngleY = (float) (-90 * Math.PI / 180); - Frill4.rotateAngleY = (float) (90 * Math.PI / 180); - } - leg1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - leg3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADBASE.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADBASE.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08b9bffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08b9bffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 87943ea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f08b9bffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,32 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.core.entitydeclaration.CreatureDeclaration; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreeperBlossomPrimedDefault extends CreatureDeclaration { - - public CreeperBlossomPrimedDefault() { - super("CreeperBlossomPrimed", 43, EntityCreeperBlossomPrimed.class, null); - setRegistrationProperties(128, 3, true); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderCreeperBlossomPrimed(0.5f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0ea23ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0ea23ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 972f773..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f0/f0ea23ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import net.minecraft.item.Item; -import projectzulu.common.api.ItemList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionBlindness; -import projectzulu.common.potion.subitem.SubItemPotionBubbling; -import projectzulu.common.potion.subitem.SubItemPotionCleansing; -import projectzulu.common.potion.subitem.SubItemPotionCurse; -import projectzulu.common.potion.subitem.SubItemPotionDigslowdown; -import projectzulu.common.potion.subitem.SubItemPotionDigspeed; -import projectzulu.common.potion.subitem.SubItemPotionIncendiary; -import projectzulu.common.potion.subitem.SubItemPotionJump; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import projectzulu.common.potion.subitem.SubItemPotionResistance; -import projectzulu.common.potion.subitem.SubItemPotionSlowfall; -import projectzulu.common.potion.subitem.SubItemPotionThorns; -import projectzulu.common.potion.subitem.SubItemPotionWaterBreathing; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PZExtraPotionDeclaration extends ItemDeclaration { - - public PZExtraPotionDeclaration() { - super("PZCustomPotion"); - } - - @Override - protected boolean createItem() { - Item item = new ItemPZPotion(name); - ItemList.customPotions = Optional.of(item); - int i = 0; - List list = new ArrayList(); - addToLists(item, i++, SubItemPotionList.BUBBLING, list, SubItemPotionBubbling.class); - addToLists(item, i++, SubItemPotionList.INCENDIARY, list, SubItemPotionIncendiary.class); - addToLists(item, i++, SubItemPotionList.SLOWFALL, list, SubItemPotionSlowfall.class); - addToLists(item, i++, SubItemPotionList.CLEANSING, list, SubItemPotionCleansing.class); - addToLists(item, i++, SubItemPotionList.CURSE, list, SubItemPotionCurse.class); - addToLists(item, i++, SubItemPotionList.THORNS, list, SubItemPotionThorns.class); - addToLists(item, i++, SubItemPotionList.JUMP, list, SubItemPotionJump.class); - addToLists(item, i++, SubItemPotionList.DIG_SPEED, list, SubItemPotionDigspeed.class); - addToLists(item, i++, SubItemPotionList.DIG_SLOW, list, SubItemPotionDigslowdown.class); - addToLists(item, i++, SubItemPotionList.RESISTANCE, list, SubItemPotionResistance.class); - addToLists(item, i++, SubItemPotionList.WATER_BREATHING, list, SubItemPotionWaterBreathing.class); - addToLists(item, i++, SubItemPotionList.BLINDNESS, list, SubItemPotionBlindness.class); - for (SubItemPotion subItemPotion : list) { - SubItemPotionRegistry.INSTANCE.addSubPotions(subItemPotion); - } - - return true; - } - - @Override - protected void registerItem() { - Item item = ItemList.customPotions.get(); - registerSubPotions(item); - GameRegistry.registerItem(item, name); - } - - private void registerSubPotions(Item itemID) { - Collection potions = SubItemPotionRegistry.INSTANCE.getPotions(itemID); - for (SubItemPotion subItemPotion : potions) { - subItemPotion.register(); - } - } - - private void addToLists(Item itemID, int subID, SubItemPotionList entry, List registryList, - Class potionClass) { - try { - SubItemPotion subItemPotion = potionClass.getConstructor(new Class[] { Item.class, int.class }) - .newInstance(new Object[] { itemID, subID }); - entry.set(subItemPotion); - registryList.add(subItemPotion); - } catch (Exception e) { - e.printStackTrace(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/00301fffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/00301fffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 79cbbac..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/00301fffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class EventHandleNullPotions { - - @SubscribeEvent - public void removeNullPotionEffects(LivingUpdateEvent event) { - EntityLivingBase entityLiving = event.entityLiving; - if (entityLiving.ticksExisted < 20) { - Collection potionEffects = entityLiving.getActivePotionEffects(); - Iterator iterator = potionEffects.iterator(); - while (iterator.hasNext()) { - PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); - if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { - ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", - potionEffectToRemove.getPotionID()); - iterator.remove(); - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/10dceeffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/10dceeffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 851af3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/10dceeffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,297 +0,0 @@ -package com.ngb.projectzulu.common.blocks.spike; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockSpikes extends Block { - - public static final String[] imageSuffix = new String[] { "", "_poison", "_sticky" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - public final int renderID; - - public BlockSpikes(int renderID) { - super(Material.iron); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - disableStats(); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeMetal); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 <= 5) { - return icons[0]; - } else if (par2 > 5 && par2 <= 11) { - return icons[1]; - } else { - return icons[2]; - } - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public void setBlockBoundsBasedOnState(IBlockAccess par1iBlockAccess, int par2, int par3, int par4) { - if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.fence - || par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.nether_brick_fence) { - this.setBlockBounds(0.375f, 0.0F, 0.375f, 0.625f, 0.4f, 0.625f); - - } else if (par1iBlockAccess.getBlock(par2, par3 - 1, par4) == Blocks.iron_bars) { - - boolean isNegZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 - 1)); - boolean isPosZ = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2, par3 - 1, par4 + 1)); - boolean isNegX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 - 1, par3 - 1, par4)); - boolean isPosX = canThisPaneConnectToThisBlockID(par1iBlockAccess.getBlock(par2 + 1, par3 - 1, par4)); - - float minX = !isNegX ? 0.4f : 0.0f; - float maxX = !isPosX ? 0.6f : 1.0f; - float minZ = !isNegZ ? 0.4f : 0.0f; - float maxZ = !isPosZ ? 0.6f : 1.0f; - - if (!isNegZ && !isPosZ && !isNegX && !isPosX) { - this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.4f, 1.0f); - } else { - this.setBlockBounds(minX, 0.0f, minZ, maxX, 0.4f, maxZ); - } - - } else { - switch (par1iBlockAccess.getBlockMetadata(par2, par3, par4)) { - case 0: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 1: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 2: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 0.5f); - break; - case 3: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 4: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 5: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - case 6: - this.setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.5f, 1.0f); - break; - case 7: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 0.5f, 1.0f, 1.0f); - break; - case 8: - this.setBlockBounds(0.0f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 9: - this.setBlockBounds(0.5f, 0.0F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - case 10: - this.setBlockBounds(0f, 0.0F, 0.5f, 1.0f, 1.0f, 1.0f); - break; - case 11: - this.setBlockBounds(0f, 0.5F, 0.0f, 1.0f, 1.0f, 1.0f); - break; - - default: - break; - } - } - - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - - @Override - public int quantityDropped(Random random) { - return 1; - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityLiving - && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) - || (par5Entity.prevPosX > par2 + 0.5 && par5Entity.posX < par2 + 0.5) || (par5Entity.prevPosZ > par4 + 0.5 && par5Entity.posZ < par4 + 0.5))) { - /* Check if Spikes are Poison, If So Also Apply Posion with Damage */ - if (par1World.getBlockMetadata(par2, par3, par4) > 5 && par1World.getBlockMetadata(par2, par3, par4) < 12) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); - } - if (par1World.getBlockMetadata(par2, par3, par4) > 11) { - ((EntityLiving) par5Entity).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 40, 4)); - } - par5Entity.attackEntityFrom(DamageSource.generic, 2); - } - - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Check if Item is Poison Droplet, is so Make Poisonous */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && ItemList.genericCraftingItems.isPresent() - && par5EntityPlayer.inventory.getCurrentItem().getItem() == ItemList.genericCraftingItems.get() - && par5EntityPlayer.inventory.getCurrentItem().getItemDamage() == ItemGenerics.Properties.PoisonDroplet - .meta() - && (par1World.getBlockMetadata(par2, par3, par4) < 6 || par1World.getBlockMetadata(par2, par3, par4) > 11)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison (meta<6) increase by 6, if sticky(>11) reduce by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) - 6, 3); - } - } - - /* Check if Item is Sticky Droplet, is so Make Sticky */ - if (par5EntityPlayer.inventory.getCurrentItem() != null - && par5EntityPlayer.inventory.getCurrentItem().getItem() == Items.slime_ball - && (par1World.getBlockMetadata(par2, par3, par4) < 12)) { - - /* Consume if Not Creative */ - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.getCurrentItem().stackSize = par5EntityPlayer.inventory.getCurrentItem().stackSize - 1; - } - - /* If not Poison or Sticky (meta<6) increase by 12, if Poison(>6 & <11) increase by 6 */ - if (par1World.getBlockMetadata(par2, par3, par4) < 6) { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 12, 3); - } else { - par1World.setBlock(par2, par3, par4, this, par1World.getBlockMetadata(par2, par3, par4) + 6, 3); - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - /** - * Copied from BlockPane (Iron Fence). Gets passed in the blockID of the block adjacent and supposed to return true - * if its allowed to connect to the type of blockID passed in. Args: blockID - */ - private final boolean canThisPaneConnectToThisBlockID(Block block) { - return block.isOpaqueCube() || block == Blocks.iron_bars || block == Blocks.glass; - } - - /** - * Used to Set Metadata as the block is placed called before onBlockPlacedBy by ItemBlock and ItemReed was called - * void updateBlockMetadata was called int func_85104 ~1.4.5 - 1.4.6 was called int onBlockPlaced ~1.4.7 - */ - @Override - public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, - float par8, int par9) { - int var9 = par1World.getBlockMetadata(par2, par3, par4); - if (par5 == 1 && this.canPlaceSpikeOn(par1World, par2, par3 - 1, par4)) { - var9 = 0; - } - - if (par5 == 2 && this.canPlaceSpikeOn(par1World, par2, par3, par4 + 1)) { - var9 = 4; - } - - if (par5 == 3 && this.canPlaceSpikeOn(par1World, par2, par3, par4 - 1)) { - var9 = 2; - } - - if (par5 == 4 && this.canPlaceSpikeOn(par1World, par2 + 1, par3, par4)) { - var9 = 3; - } - - if (par5 == 5 && this.canPlaceSpikeOn(par1World, par2 - 1, par3, par4)) { - var9 = 1; - } - if (par5 == 0 && this.canPlaceSpikeOn(par1World, par2, par3 + 1, par4)) { - var9 = 5; - } - - return var9; - } - - /** - * Determines if a torch can be placed on the top surface of this block. Useful for creating your own block that - * torches can be on, such as fences. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @return True to allow the torch to be placed - */ - public boolean canPlaceSpikeOn(World world, int x, int y, int z) { - if (World.doesBlockHaveSolidTopSurface(world, x, y, z)) { - return true; - } else { - Block id = world.getBlock(x, y, z); - return id == Blocks.glass || id == Blocks.piston || id == Blocks.piston_extension - || id == Blocks.piston_head || id == Blocks.sticky_piston; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/10dd5001c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/10dd5001c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index aa8e756..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/10dd5001c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,262 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityHauntedArmor; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHauntedArmor extends ModelBase { - public ModelRenderer swordhand; - public ModelRenderer bipedHead; - public ModelRenderer bipedBody; - public ModelRenderer bipedRightArm; - public ModelRenderer bipedLeftArm; - public ModelRenderer bipedRightLeg; - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedBody2; - public ModelRenderer bipedRightLeg2; - public ModelRenderer bipedLeftLeg2; - - public static String[] bipedArmorFilenamePrefix = new String[] { "cloth", "chain", "iron", "diamond", "gold" }; - - public ModelHauntedArmor() { - this(0.0f, 0.0f); - } - - public ModelHauntedArmor(float par1, float par2) { - super(); - - int textureWidth = 64; - int textureHeight = 32; - - this.bipedHead = new ModelRenderer(this, 0, 0); - this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); - this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); - this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; - this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); - this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; - this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - this.bipedBody2 = new ModelRenderer(this, 16, 16); - this.bipedBody2.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.bipedBody2.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightLeg2 = new ModelRenderer(this, 0, 16); - this.bipedRightLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedRightLeg2.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg2 = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg2.mirror = true; - this.bipedLeftLeg2.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); - this.bipedLeftLeg2.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - - swordhand = new ModelRenderer(this, 0, 0); - swordhand.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1); - swordhand.setRotationPoint(0F, 9F, -7F); - swordhand.setTextureSize(textureWidth, textureHeight); - swordhand.mirror = true; - setRotation(swordhand, 0F, 0F, 0F); - } - - @Override - public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); - GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); - this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - GL11.glPopMatrix(); - } else { - String textureLocation; - ResourceLocation resource; - ItemStack itemStack; - float scale; - - /* Render Armor Legs */ - textureLocation = "/armor/iron_2.png"; - EntityHauntedArmor var5 = (EntityHauntedArmor) par1Entity; - itemStack = var5.func_130225_q(2) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_chestplate); - - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 2, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - scale = par7 * 0.85f; - this.bipedRightLeg2.render(scale); - this.bipedLeftLeg2.render(scale); - - /* Render Armor Upper Body */ - textureLocation = "/armor/iron_1.png"; - itemStack = var5.func_130225_q(1) != null ? var5.func_130225_q(2) : new ItemStack(Items.golden_leggings); - resource = RenderBiped.getArmorResource(par1Entity, itemStack, 1, null); - Minecraft.getMinecraft().renderEngine.bindTexture(resource); - this.bipedHead.render(par7); - this.bipedBody.render(par7); - this.bipedRightArm.render(par7); - this.bipedLeftArm.render(par7); - this.bipedRightLeg.render(par7); - this.bipedLeftLeg.render(par7); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase livingBase, float par2, float par3, float par4) { - EntityHauntedArmor var5 = (EntityHauntedArmor) livingBase; - /* Sleeping Animation */ - if (var5.getEntityState() == EntityStates.idle) { - bipedHead.setRotationPoint(-4f, 15.9f, 0f); - setRotation(bipedHead, 0, 0, (float) (90f * Math.PI / 180)); - - bipedRightArm.setRotationPoint(-6f, 17.8f, 0f); - setRotation(bipedRightArm, (float) (-66f * Math.PI / 180), 0, 0); - bipedLeftArm.setRotationPoint(7f, 23.0f, 4.0f); - setRotation(bipedLeftArm, 0, 0, (float) (-90f * Math.PI / 180)); - - bipedBody.setRotationPoint(0.0f, 22.0f, 9.5f); - setRotation(bipedBody, (float) (-90f * Math.PI / 180), 0, 0); - bipedBody2.setRotationPoint(0.0f, 26f, 9.5f); - setRotation(bipedBody2, (float) (-90f * Math.PI / 180), 0, 0); - - bipedRightLeg.setRotationPoint(-2.0f, 12.0f, -7f); - setRotation(bipedRightLeg, 0, 0, 0); - bipedRightLeg2.setRotationPoint(-9f, 26.0f, 0f); - setRotation(bipedRightLeg2, (float) (90f * Math.PI / 180), (float) (-13f * Math.PI / 180), 0); - - bipedLeftLeg.setRotationPoint(2.0f, 12.0f, -6f); - setRotation(bipedLeftLeg, 0, 0, 0); - bipedLeftLeg2.setRotationPoint(7, 26.0f, 0f); - setRotation(bipedLeftLeg2, (float) (-90f * Math.PI / 180), (float) (-2f * Math.PI / 180), 0); - - swordhand.setRotationPoint(0f, 9.0f, -12f); - setRotation(swordhand, (float) (90f * Math.PI / 180), 0, 0); - - /* Wake Up Animation */ - } else if (var5.getWakeUpTimer() > 0) { - float wakeUpTimer = var5.getWakeUpTimer(); - float timeToWakeUp = 30; - ModelHelper.mapRotationPoint(bipedHead, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, 0, 0, 0); - ModelHelper.mapRotation(bipedHead, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (90f * Math.PI / 180), 0, 0, - 0); - - ModelHelper.mapRotationPoint(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, -6f, 17.8f, 0f, -5, 2, 0); - ModelHelper.mapRotation(bipedRightArm, wakeUpTimer, timeToWakeUp, 0, (float) (-66f * Math.PI / 180), 0, 0, - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 7f, 23.0f, 4.0f, 5, 2, 0); - ModelHelper.mapRotation(bipedLeftArm, wakeUpTimer, timeToWakeUp, 0, 0, 0, (float) (-90f * Math.PI / 180), - 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, wakeUpTimer, timeToWakeUp, 0.0f, 0, 22.0f, 9.5f, 0, 0, 0); - ModelHelper.mapRotation(bipedBody, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), 0, 0, 0, - 0, 0); - - ModelHelper - .mapRotationPoint(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0f, -2.0f, 12.0f, -7f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0f, -9f, 26.0f, 0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), - (float) (-13f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0f, 2.0f, 12.0f, -6f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, wakeUpTimer, timeToWakeUp, 0, 0, 0, 0, 0, 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0f, 7, 26.0f, 0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, wakeUpTimer, timeToWakeUp, 0, (float) (-90f * Math.PI / 180), - (float) (-2f * Math.PI / 180), 0, 0, 0, 0); - - ModelHelper.mapRotationPoint(swordhand, wakeUpTimer, timeToWakeUp, 0f, 0f, 9.0f, -12f, 0, 9f, -12f); - ModelHelper.mapRotation(swordhand, wakeUpTimer, timeToWakeUp, 0, (float) (90f * Math.PI / 180), 0, 0, - (float) (-70f * Math.PI / 180), 0, 0); - - /* Attack Animation */ - } else if (var5.getAnimTime() > 0 && var5.getEntityState() == EntityStates.attacking) { - ModelHelper.mapRotationPoint(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, 0, 9f, -17f, 0, 9f, -8f); - ModelHelper.mapRotation(swordhand, var5.getAnimTime(), var5.maxAnimTime, 0, (float) (0 * Math.PI / 180), - (float) (-10 * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - /* Living Animation */ - } else { - float mapValue; - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 30; - float mapStart = 30; - float mapEnd = -30; - ModelHelper.mapRotationPoint(swordhand, mapValue, mapStart, mapEnd, -4f, 9f, -8, 6, 9f, -4f); - ModelHelper.mapRotation(swordhand, mapValue, mapStart, mapEnd, (float) (-40 * Math.PI / 180), (float) (-10 - * Math.PI / 180), (float) (-30 * Math.PI / 180), (float) (-70 * Math.PI / 180), - (float) (10 * Math.PI / 180), (float) (30 * Math.PI / 180)); - - ModelHelper.mapRotationPoint(bipedHead, mapValue, mapStart, mapEnd, 0, -2f, 0f, 0, 2f, 0); - ModelHelper.mapRotation(bipedHead, mapValue, mapStart, mapEnd, 0, 0, -0.1f, 0, 0, 0.1f); - - ModelHelper.mapRotationPoint(bipedRightArm, mapValue, mapStart, mapEnd, -6, 3, 0, -5, 1, 0); - ModelHelper.mapRotation(bipedRightArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftArm, mapValue, mapStart, mapEnd, 6, 3, 0, 5, 1, 0); - ModelHelper.mapRotation(bipedLeftArm, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedBody, mapValue, mapStart, mapEnd, 0, 0, 1f, 0, 0, -1f); - ModelHelper.mapRotation(bipedBody, mapValue, mapStart, mapEnd, 0, -0.05f, 0, 0, 0.05f, 0); - - mapValue = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * par3 * 45; - ModelHelper.mapRotationPoint(bipedRightLeg, mapValue, mapStart, mapEnd, -2.9f, 12.0f, 1.0f, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg, mapValue, mapStart, mapEnd, (float) (-30 * Math.PI / 180), 0, 0.05f, - (float) (30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedRightLeg2, mapValue, mapStart, mapEnd, -1.9f, 12f, 0, -1.9f, 12f, 0); - ModelHelper.mapRotation(bipedRightLeg2, mapValue, mapStart, mapEnd, (float) (-10 * Math.PI / 180), 0, - 0.05f, (float) (10 * Math.PI / 180), 0, 0); - - ModelHelper.mapRotationPoint(bipedLeftLeg, mapValue, mapStart, mapEnd, 2.9f, 12f, -1.0f, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg, mapValue, mapStart, mapEnd, (float) (30 * Math.PI / 180), 0, 0.05f, - (float) (-30 * Math.PI / 180), 0, 0); - ModelHelper.mapRotationPoint(bipedLeftLeg2, mapValue, mapStart, mapEnd, 1.9f, 12f, 0, 1.9f, 12f, 0); - ModelHelper.mapRotation(bipedLeftLeg2, mapValue, mapStart, mapEnd, (float) (10 * Math.PI / 180), 0, 0.05f, - (float) (-10 * Math.PI / 180), 0, 0); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/116160f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/116160f8c42100141fce95f06aba7e85 deleted file mode 100644 index 34cf1bd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/116160f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.api.SubItemPotionList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionCleansing extends SubItemPotionGeneric { - - public SubItemPotionCleansing(Item itemID, int subID) { - super(itemID, subID, "potion.cleansing"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.cleansing; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ItemList.genericCraftingItems.isPresent() && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.GlowingGoo.meta) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.CURSE.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.CURSE.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/1189fe9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/1189fe9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 347c932..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/1189fe9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectPyramid; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/304fe7f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/304fe7f9c42100141fce95f06aba7e85 deleted file mode 100644 index 429eff2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/304fe7f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemReed; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class ItemUniversalFlowerPot extends ItemReed { - - public ItemUniversalFlowerPot(Block block) { - super(block); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(block.getUnlocalizedName()); - setTextureName("flower_pot"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/609909f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/609909f9c42100141fce95f06aba7e85 deleted file mode 100644 index 11a173f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/609909f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,110 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIMoveTowardsTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import com.ngb.projectzulu.common.mobs.entityai.EntityAIStayStill; - -public class EntitySandWorm extends EntityGenericAnimal implements IMob { - - public EntitySandWorm(World par1World) { - super(par1World); - setSize(1.5f, 1.0f); - getNavigator().setAvoidsWater(false); - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, true)); - tasks.addTask(4, new EntityAIMoveTowardsTarget(this, 1.0f, 32.0F)); - - tasks.addTask(6, new EntityAIMoveTowardsRestriction(this, 1.0f)); - - // targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(5, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityVillager.class, 16.0F, 0, true)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - @Override - protected boolean canDespawn() { - return true; - } - - @Override - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { - setAngerLevel(400); - super.onCollideWithPlayer(par1EntityPlayer); - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - setAngerLevel(400); - return super.attackEntityFrom(par1DamageSource, par2); - } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - super.onLivingUpdate(); - - if (getEntityState() == EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 4D) != null) { - setAngerLevel(100); - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return null; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "sandwormroar"; - } - - /** - * Returns the sound this mob makes on death. - */ - @Override - protected String getDeathSound() { - return null; - } - - /** - * Plays step sound at given x, y, z for the entity - */ - @Override - protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { - this.worldObj.playSoundAtEntity(this, "sand", 1.0F, 1.0F); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/81323aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/81323aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 02ea4e8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/81323aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,83 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityMobHeads extends TileEntity { - - /* Passed in From Item Damage */ - private int skullType; - private int rotation; - private String ExtraType = ""; - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setByte("SkullType", (byte) (this.skullType & 255)); - par1NBTTagCompound.setByte("Rot", (byte) (this.rotation & 255)); - par1NBTTagCompound.setString("ExtraType", this.ExtraType); - - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - skullType = par1NBTTagCompound.getByte("SkullType"); - rotation = par1NBTTagCompound.getByte("Rot"); - - if (par1NBTTagCompound.hasKey("ExtraType")) { - this.ExtraType = par1NBTTagCompound.getString("ExtraType"); - } - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) { - NBTTagCompound tag = packet.func_148857_g(); - skullType = tag.getByte("SkullType"); - rotation = tag.getByte("Rot"); - } - - public void setSkullType(int par1, String par2Str) { - skullType = par1; - ExtraType = par2Str; - } - - public int getSkullType() { - return skullType; - } - - public void setRotation(int par1) { - rotation = par1; - } - - @SideOnly(Side.CLIENT) - public int getRotation() { - return rotation; - } - - @SideOnly(Side.CLIENT) - public String getExtraType() { - return ExtraType; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/9039efe3c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/9039efe3c42100141fce95f06aba7e85 deleted file mode 100644 index 2be9e10..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/9039efe3c42100141fce95f06aba7e85 +++ /dev/null @@ -1,264 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -import net.minecraft.block.BlockFlower; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", - "_t4" }; - @SideOnly(Side.CLIENT) - private IIcon[] blockIcons; - - public BlockAloeVera() { - super(Material.plants); - setTickRandomly(true); - disableStats(); - setHardness(0); - setStepSound(Block.soundTypeGrass); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return blockIcons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.blockIcons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.blockIcons.length; ++i) { - this.blockIcons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - if (this.blockIcons[i] == null) { - } - } - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - // See if Aloe Vera Should Grow - // Control Bottom Alor Vera - int tempAVMeta = par1World.getBlockMetadata(par2, par3, par4); - int waterRate = waterGrowthRate(par1World, par2, par3, par4); - int weedRate = weedGrowthRate(par1World, par2, par3, par4); - int probabilityOutOf = 200; - - if (tempAVMeta < 3) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // Final Stage of Bottom AloeVera, Created the flower block above - if (tempAVMeta == 3 && waterRate > 1) { - // If Meta Data is at 3 or then we check to see if we can grow flower above and tumbleweed - // Check if Air is above and the block below is not aloeVera. If So, place the top 'Flower Aloe Vera' above - if (par1World.getBlock(par2, par3 + 1, par4).isAir(par1World, par2, par3 + 1, par4) - && par1World.getBlock(par2, par3 - 1, par4) != BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (par1World.getLightBrightness(par2, par3 + 1, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3 + 1, par4, BlockList.aloeVera.get(), 4, 3); - } - } - } - - // Following Section of Code deals with Flower block, but WaterRate needs to be recalculate based on water level - // not to - // to Flower block coords but to base coords - waterRate = waterGrowthRate(par1World, par2, par3 - 1, par4); - weedRate = weedGrowthRate(par1World, par2, par3 - 1, par4); - - // Deals with the flower block, if its 3-8 and is above an Aloe Vera Block (The Bottom) then it needs to grow - if (tempAVMeta > 3 && tempAVMeta < 8 && waterRate > 1 - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.aloeVera.get()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - // Growth is proportional to the lightlevel, more light more likely to advance - if (par1World.getLightBrightness(par2, par3, par4) - holdRand >= 0) { - par1World.setBlock(par2, par3, par4, BlockList.aloeVera.get(), tempAVMeta + 1, 3); - } - } - - // If Flower is at final stage, it needs to spawn tumbleweed and destroy itself - if (tempAVMeta == 8 && par1World.getBlock(par2, par3, par4) == BlockList.aloeVera.get() - && BlockList.tumbleweed.isPresent()) { - int holdRand = par5Random.nextInt(probabilityOutOf); - if (weedRate - holdRand >= 0) { - // Check in 3*3 square For air to place tumbleweed, cannot be placed over water - - Vec3 suitableBlockLoc = findSuitableBlockLoc(par1World, par2, par3 - 1, par4); - // Place Tumbleweed - if (suitableBlockLoc != null) { - // Place Tumbleweed at that desired location - par1World.setBlock((int) suitableBlockLoc.xCoord, (int) suitableBlockLoc.yCoord, - (int) suitableBlockLoc.zCoord, BlockList.tumbleweed.get()); - // Remove Flower as Tumbleweed is dead plant I guess - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - } - - // Water Food Growth - // Check That Block Below is Sand and if Random replace with watered dirt stage 1 - int holdRand = par5Random.nextInt(probabilityOutOf / 2); - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 0, 3); - } - } - if (par1World.getBlock(par2, par3 - 1, par4) == Blocks.dirt && waterRate - holdRand >= 0) { - if (BlockList.wateredDirt.isPresent()) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), 4, 3); - } - } - - if (BlockList.wateredDirt.isPresent() - && par1World.getBlock(par2, par3 - 1, par4) == BlockList.wateredDirt.get() && waterRate - holdRand >= 0) { - int tempMeta = par1World.getBlockMetadata(par2, par3 - 1, par4); - if (tempMeta != 3 && tempMeta != 7) { - par1World.setBlock(par2, par3 - 1, par4, BlockList.wateredDirt.get(), tempMeta + 1, 3); - } - } - super.updateTick(par1World, par2, par3, par4, par5Random); - par1World.scheduleBlockUpdate(par2, par3, par4, this, 225 / 2); - } - - private Vec3 findSuitableBlockLoc(World par1World, int par2, int par3, int par4) { - for (int i = -1; i < 2; i++) { - // Will Only Place Tumbleweed on same level or down one - for (int j = -1; j < 1; j++) { - for (int k = -1; k < 2; k++) { - - if (par1World.getBlock(par2 + i, par3 + j, par4 + k) == Blocks.air - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.flowing_water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.water - && par1World.getBlock(par2 + i, par3 + j - 1, par4 + k) != Blocks.air) { - return Vec3.createVectorHelper(par2 + i, par3 + j, par4 + k); - } - } - } - } - return null; - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - par1World.scheduleBlockUpdate(par2, par3, par4, BlockList.aloeVera.get(), 4); - - super.onBlockAdded(par1World, par2, par3, par4); - } - - private int waterGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int waterGrowthRate = 1; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - if (block == Blocks.flowing_water || block == Blocks.water) { - waterGrowthRate += 1; - break; - } - } - } - } - return Math.min(waterGrowthRate, 30); - } - - private int weedGrowthRate(World par1World, int par2, int par3, int par4) { - // Blocks to Check - // Check Blocks in a 5x5 Grid centered on Block - int weedGrowthRate = 0; - for (int i = -4; i < 5; i++) { - for (int j = -4; j < 5; j++) { - // y axis - for (int k = -1; k < 1; k++) { - - Block block = par1World.getBlock(par2 + i, par3 + k, par4 + j); - // Nearby Water Speeds Up Growth - if (block == Blocks.flowing_water || block == Blocks.water) { - weedGrowthRate += 1; - break; - } - } - } - } - return Math.min(weedGrowthRate, 30); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 3) { - ret.add(new ItemStack(this)); - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - ret.add(new ItemStack(ItemList.aloeVeraSeeds.get())); - } - return ret; - } - - if (metadata == 8) { - if (ItemList.aloeVeraSeeds.isPresent()) { - ret.add(new ItemStack(Items.dye, 1, 11)); - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - if (metadata == 7) { - ret.add(new ItemStack(Items.dye, 1, 11)); - } - return ret; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public int getRenderType() { - return 1; - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - if (BlockList.wateredDirt.isPresent() && block == BlockList.wateredDirt.get()) { - return true; - } - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand - || block == BlockList.aloeVera.get(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/910127f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/910127f8c42100141fce95f06aba7e85 deleted file mode 100644 index 4c53fae..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/910127f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericCarved; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericEdge; -import com.ngb.projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import com.ngb.projectzulu.common.world2.blueprint.BlueprintSet; -import com.ngb.projectzulu.common.world2.blueprints.BPScatteredTombstonesAndFlowers; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemetaryEdge; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemetaryFountain; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemetaryFountain2; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemeteryTomb; -import com.ngb.projectzulu.common.world2.blueprints.BlueprintCemeteryTomb2; - -public class ArchitectCemetary extends ArchitectBase { - BlueprintSet edge = new BPSetGenericEdge(new BlueprintCemetaryEdge()); - - public ArchitectCemetary(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPScatteredTombstonesAndFlowers())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb2(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemetaryFountain(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintCemetaryFountain2())); - stockpile.addBlueprintSet(edge); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/913bce9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/913bce9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9b05e6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/913bce9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,65 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelRhinoHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer BODYROT; - private ModelRenderer HEADROT; - - public ModelRhinoHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.earrig", 102, 15); - setTextureOffset("HEADROT.earlef", 96, 15); - setTextureOffset("HEADROT.horn1", 96, 0); - setTextureOffset("HEADROT.horn2", 96, 5); - setTextureOffset("HEADROT.horn3", 96, 10); - setTextureOffset("HEADROT.head1", 108, 0); - setTextureOffset("HEADROT.head2", 109, 12); - setTextureOffset("HEADROT.head3", 109, 23); - setTextureOffset("HEADROT.head4", 111, 34); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 18F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 6.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("earrig", 3F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("earlef", -5F, -6F, -1.5F, 2, 3, 1); - HEADROT.addBox("horn1", -1.5F, -1F, -13F, 3, 2, 3); - HEADROT.addBox("horn2", -1F, -4F, -13F, 2, 3, 2); - HEADROT.addBox("horn3", -0.5F, -8F, -13F, 1, 4, 1); - HEADROT.addBox("head1", -4F, -4F, -2F, 8, 10, 2); - HEADROT.addBox("head2", -3.5F, -2F, -5F, 7, 8, 3); - HEADROT.addBox("head3", -3F, -1F, -9F, 6, 7, 4); - HEADROT.addBox("head4", -2.5F, 1F, -13F, 5, 5, 4); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/919f5af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/919f5af9c42100141fce95f06aba7e85 deleted file mode 100644 index 136b9d5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/919f5af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,113 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSolidSide extends KeyParserBase { - - public KeyParserSolidSide(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - boolean isInverted = false; - if (isInverted(parseable)) { - isInverted = true; - } - - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - TypeValuePair typeValue = null; - - if (pieces.length == 3 || pieces.length == 4) { - int side = ParsingHelper.parseFilteredInteger(pieces[1], 0, "side"); - int rangeX, rangeY, rangeZ; - rangeX = rangeY = rangeZ = 0; - String[] rangePieces = pieces[2].split("/"); - if (rangePieces.length == 3) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRangeX"); - rangeY = ParsingHelper.parseFilteredInteger(rangePieces[1], 0, key.key + "BlockRangeY"); - rangeZ = ParsingHelper.parseFilteredInteger(rangePieces[2], 0, key.key + "BlockRangeZ"); - } else if (rangePieces.length == 1) { - rangeX = ParsingHelper.parseFilteredInteger(rangePieces[0], 0, key.key + "BlockRange"); - rangeY = rangeX; - rangeZ = rangeX; - } else { - ProjectZuluLog.severe("Error Parsing Range of %s. Invalid Argument Length of %s.", key.key, - rangePieces.length); - } - - if (pieces.length == 4) { - String[] offsetPieces = pieces[3].split("/"); - int offsetX = ParsingHelper.parseFilteredInteger(offsetPieces[0], 0, key.key + "OffsetX"); - int offsetY = ParsingHelper.parseFilteredInteger(offsetPieces[1], 0, key.key + "OffsetY"); - int offsetZ = ParsingHelper.parseFilteredInteger(offsetPieces[2], 0, key.key + "OffsetZ"); - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ, offsetX, - offsetY, offsetZ }); - } else { - typeValue = new TypeValuePair(key, new Object[] { isInverted, side, rangeX, rangeY, rangeZ }); - } - } else { - ProjectZuluLog.severe("Error Parsing %s Block Parameter. Invalid Argument Length of %s.", key.key, - pieces.length); - return false; - } - - if (typeValue != null && typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - int side = (Integer) values[1]; - - if (values.length == 5 || values.length == 8) { - int rangeX = (Integer) values[2]; - int rangeY = (Integer) values[3]; - int rangeZ = (Integer) values[4]; - int offsetX, offsetY, offsetZ; - offsetX = offsetY = offsetZ = 0; - if (values.length == 8) { - offsetX = (Integer) values[5]; - offsetY = (Integer) values[6]; - offsetZ = (Integer) values[7]; - } - - for (int i = -rangeX; i <= rangeX; i++) { - for (int k = -rangeZ; k <= rangeZ; k++) { - for (int j = -rangeY; j <= rangeY; j++) { - boolean isSolid = world.getBlock(xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k).isSideSolid(world, xCoord + offsetX + i, yCoord + offsetY + j, - zCoord + offsetZ + k, ForgeDirection.getOrientation(side)); - if (!isInverted && isSolid || isInverted && !isSolid) { - return false; - } - } - } - } - } - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/c030398f6023001416428e945fc8fb52 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/c030398f6023001416428e945fc8fb52 deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/c030398f6023001416428e945fc8fb52 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/c1cb859ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/c1cb859ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index fa48de0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/c1cb859ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,91 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/d0a9a8f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/d0a9a8f7c42100141fce95f06aba7e85 deleted file mode 100644 index 4f2dd93..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/d0a9a8f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.models.ModelFinch; - -public class TileEntityMobHeadsRenderer extends TileEntitySpecialRenderer { - enum HeadRender { - Finch_Red(0, new ModelFinch(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.74F), new Position(0.5F, 1.5F, 0.26F), - new Position(0.74F, 1.5F, 0.5F), new Position(0.26F, 1.5F, 0.5F) }), Crocodile(1, - new ModelCrocodileHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Armadillo(2, new ModelArmadilloHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 0.80F), new Position(0.5F, 1.75F, 0.20F), - new Position(0.80F, 1.75F, 0.5F), new Position(0.20F, 1.75F, 0.5F) }), BearBlack(3, - new ModelBearHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85F), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85F, 1.75F, 0.5F), - new Position(0.15F, 1.75F, 0.5F) }), BearBrown(4, new ModelBearHead(), 0.08F, new Position[] { - new Position(0.26F, 2.0F, 0.5F), new Position(0.5F, 1.90f, 0.5F), new Position(0.5F, 2.1F, 0.85F), - new Position(0.5F, 2.1F, 0.15F), new Position(0.85F, 2.1F, 0.5F), new Position(0.15f, 2.1F, 0.5F) }), BearPolar( - 5, new ModelBearHead(), 0.1F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 2.4F, 0.5F), new Position(0.5F, 2.5F, 0.80F), - new Position(0.5F, 2.5F, 0.20f), new Position(0.80f, 2.5F, 0.5F), - new Position(0.20f, 2.5F, 0.5F) }), Beaver(6, new ModelBeaverHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.85f), - new Position(0.5F, 1.75F, 0.15F), new Position(0.85f, 1.75F, 0.5F), new Position(0.15f, 1.75F, 0.5F) }), Boar( - 7, new ModelBoarHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.70f), - new Position(0.5F, 1.75F, 0.30f), new Position(0.70f, 1.75F, 0.5F), - new Position(0.30f, 1.75F, 0.5F) }), Giraffe(8, new ModelGiraffeHead(), 0.035F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 0.85F, 0.5F), new Position(0.5F, 1.15F, 1.00f), - new Position(0.5F, 1.15F, 0.00f), new Position(1.00F, 1.15F, 0.5F), new Position(0.00F, 1.15F, 0.5F) }), Gorilla( - 9, new ModelGorillaHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), - new Position(0.20f, 1.75F, 0.5F) }), Lizard(10, new ModelLizardHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.80f), - new Position(0.5F, 1.75F, 0.20f), new Position(0.80f, 1.75F, 0.5F), new Position(0.20f, 1.75F, 0.5F) }), Mammoth( - 11, new ModelMammothHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.40F, 0.5F), new Position(0.5F, 1.56F, 0.70f), - new Position(0.5F, 1.56F, 0.30f), new Position(0.70f, 1.56F, 0.5F), - new Position(0.30f, 1.56F, 0.5F) }), Ostrich(12, new ModelOstrichHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), - new Position(0.5F, 1.75F, 1.2F), new Position(0.5F, 1.75F, -0.1F), - new Position(1.15F, 1.75F, 0.5F), new Position(-0.15F, 1.75F, 0.5F) }), Penguin(13, - new ModelPenguinHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.85F, 0.75f), - new Position(0.5F, 1.85F, 0.25f), new Position(0.75f, 1.85F, 0.5F), - new Position(0.25f, 1.85F, 0.5F) }), Rhino(14, new ModelRhinoHead(), 0.0625F, new Position[] { - new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75F, 0.60F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.60f, 1.75F, 0.5F), new Position(0.40f, 1.75F, 0.5F) }), TreeEnt( - 15, new ModelTreeEntHead(), 0.0625F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 1.5F, 0.5F), new Position(0.5F, 1.75f, 0.55F), - new Position(0.5F, 1.75F, 0.4F), new Position(0.55F, 1.75F, 0.5F), - new Position(0.45F, 1.75F, 0.5F) }), Vulture(16, new ModelVultureHead(), 0.0625F, - new Position[] { new Position(0.26F, 1.5F, 0.5F), new Position(0.5F, 1.55F, 0.5F), - new Position(0.5F, 2.10F, 0.95F), new Position(0.5F, 2.10F, 0.05F), - new Position(0.95F, 2.10F, 0.5F), new Position(0.05F, 2.10F, 0.5F) }), Elephant(17, - new ModelElephantHead(), 0.0505F, new Position[] { new Position(0.26F, 1.5F, 0.5F), - new Position(0.5F, 0.9F, 0.5F), new Position(0.5F, 0.9F, 0.59F), - new Position(0.5F, 0.9F, 0.41F), new Position(0.59F, 0.9F, 0.5F), - new Position(0.41F, 0.9F, 0.5F) }); - - private final ModelBase model; - private final int iD; - private final float scale; - private final Position[] transOffset; - public final ResourceLocation resourceLocation; - - private HeadRender(int iD, ModelBase model, float scale, Position[] offSets) { - this.iD = iD; - this.model = model; - this.transOffset = offSets; - this.scale = scale; - resourceLocation = new ResourceLocation(DefaultProps.mobKey, this.toString().toLowerCase() + ".png"); - } - - public ModelBase getModel() { - return model; - } - - public int getID() { - return iD; - } - - public Position getOffset(int index) { - return transOffset[index]; - } - - public static HeadRender getByID(int iD) { - for (HeadRender head : HeadRender.values()) { - if (head.iD == iD) - return head; - } - return null; - } - } - - public static class Position { - public final float x; - public final float y; - public final float z; - - public Position(float x, float y, float z) { - this.x = x; - this.y = y; - this.z = z; - } - } - - public TileEntityMobHeadsRenderer() { - } - - public void renderAModelAt(TileEntityMobHeads tile, float par1, float par2, float par3, float f) { - - /* Get Rotation */ - float rotation = (float) (tile.getRotation() * 360) / 16f; - - /* Get Meta */ - int meta = 0; - if (tile.getWorldObj() != null) { - meta = (tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord) & 7); - } - /* Get And Set Attributes Specific to Skull Type */ - int skullType = tile.getSkullType(); - HeadRender mobhead = HeadRender.getByID(skullType); - float scale = mobhead.scale; - String textureLocation = DefaultProps.mobDiretory + mobhead.toString().toLowerCase() + ".png"; - int skullState = 0; - if (meta == 1) { - switch (mobhead) { - case Giraffe: - case Mammoth: - case Ostrich: - case Vulture: - case Elephant: - skullState = 1; - break; - default: - break; - } - } - bindTexture(mobhead.resourceLocation); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glTranslatef(par1 + (float) mobhead.getOffset(meta).x, par2 + (float) mobhead.getOffset(meta).y, par3 - + (float) mobhead.getOffset(meta).z); - /* Override Rotation if on the Side of a Block */ - switch (meta) { - case 1: - break; - case 2: - break; - case 3: - rotation = 180.0F; - break; - case 4: - rotation = 270.0F; - break; - case 5: - default: - rotation = 90.0F; - } - - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glScalef(-1.0f, -1.0F, 1.0F); - mobhead.model.render((Entity) null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale); - GL11.glPopMatrix(); - } - - public void renderTileEntityAt(TileEntity tileentity, double par2, double par4, double par6, float par8) { - renderAModelAt((TileEntityMobHeads) tileentity, (float) par2, (float) par4, (float) par6, par8); // where to - // render - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/f140fae4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/f140fae4c42100141fce95f06aba7e85 deleted file mode 100644 index 59ea507..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f1/f140fae4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.settings; - -import java.util.EnumSet; - -import projectzulu.common.dungeon.spawner.tag.keys.Key; - -/** - * Tags system taken from the Just Another Spawner minecraft mod licensed under the Apache license v2.0 - * - * Just Another Spawner (JAS) is a Minecraft Mod that aimed at providing an alternative entity spawning system for - * Minecraft. - * - * License / Legal Stuff Copyright 2012 Tarion Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - */ -public class OptionalSettingsSpawning extends OptionalSettingsBase { - - public OptionalSettingsSpawning(String parseableString) { - super(parseableString.replace("{", "").replace("}", ""), EnumSet.of(Key.spawn, Key.light, Key.block, - Key.blockRange, Key.blockFoot, Key.spawnRange, Key.sky, Key.minSpawnHeight, Key.maxSpawnHeight, - Key.liquid, Key.opaque, Key.normal, Key.solidSide, Key.difficulty, Key.torchLight, Key.ground, Key.top, - Key.fill, Key.modspawn, Key.origin, Key.players, Key.entities, Key.random, Key.writenbt)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/0114ffa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/0114ffa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e11d92c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/0114ffa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/11b4f6f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/11b4f6f5c42100141fce95f06aba7e85 deleted file mode 100644 index bab5d35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/11b4f6f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -/** - * Class Holds Entity Age Methods - * such as setting and saving age - */ -public class EntityGenericAgeable extends EntityGenericCreature{ - - public EntityGenericAgeable(World par1World) { - super(par1World); - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Growing Age */ - this.dataWatcher.addObject(12, new Integer(0)); - } - /** - * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's - * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the - * Entity is considered a child. - */ - public int getGrowingAge() { return this.dataWatcher.getWatchableObjectInt(12); } - public void setGrowingAge(int par1) { this.dataWatcher.updateObject(12, Integer.valueOf(par1)); } - - /** - * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons - * use this to react to sunlight and start to burn. - */ - @Override - public void onUpdate() { - super.onUpdate(); - int var1 = this.getGrowingAge(); - - if (var1 < 0){ - ++var1; - this.setGrowingAge(var1); - } - else if (var1 > 0){ - --var1; - this.setGrowingAge(var1); - } - } - - @Override - public boolean isChild() { - return getGrowingAge() < 0; - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readEntityFromNBT(par1NBTTagCompound); - this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/3031f09fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/3031f09fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 561ba75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/3031f09fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeDiagonal extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeDiagonal(boolean inverted) { - super(inverted); - } - - /** - * BPOasisEdgeDiagonal G GG GGG - */ - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ - (!inverted ? piecePos.posX : cellSize - 1 - piecePos.posX) >= 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "diagonal"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/309a17a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/309a17a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d87f46b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/309a17a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserEntityCap extends KeyParserBase { - - public KeyParserEntityCap(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseEntityCap(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/4105e5f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/4105e5f9c42100141fce95f06aba7e85 deleted file mode 100644 index c93ef7a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/4105e5f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,104 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.entity.RenderBiped; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.temperature.ITempArmor; - -public class ItemZuluArmor extends ItemArmor implements ITempArmor { - /** Holds the 'base' maxDamage that each armorType have. */ - private static final int[] maxDamageArray = new int[] { 11, 16, 15, 13 }; - - /** - * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots - */ - public final int armorType; - - /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; - - /** - * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is - * iron, 3 is diamond and 4 is gold. - */ - public final int renderIndex; - - /** The EnumArmorMaterial used for this ItemArmor */ - private final ArmorMaterial material; - - public ItemZuluArmor(ArmorMaterial armorMat, int renderIndex, int armorType, String name) { - super(armorMat, renderIndex, armorType); - this.material = armorMat; - this.armorType = armorType; - this.renderIndex = renderIndex; - this.damageReduceAmount = armorMat.getDamageReductionAmount(armorType); - this.setMaxDamage(armorMat.getDurability(armorType)); - this.maxStackSize = 1; - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setUnlocalizedName(name); - setTextureName(DefaultProps.blockKey + ":" + name); - } - - /** - * Return the enchantability factor of the item, most of the time is based on material. - */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - - /** - * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets - * multiplied by armor material factor) - */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } - - @Override - public float getAddToPlayTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - return 0; - } - - @Override - public float getAddToLocTempOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp) { - if (material.equals(ProjectZulu_Core.desertClothMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.scaleMaterial)) { - return -0.4f; - } else if (material.equals(ProjectZulu_Core.goldScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.ironScaleMaterial)) { - return -0.3f; - } else if (material.equals(ProjectZulu_Core.diamondScaleMaterial)) { - return -0.2f; - } - - if (material.equals(ProjectZulu_Core.furMaterial)) { - return 0.3f; - } - - return 0f; - } - - @Override - public float getAddToHeatTransferOnEquip(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0; - } - - @Override - public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - return false; - } - - @Override - public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" - + (armorType == 2 ? 2 : 1) + ".png"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/508cd6e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/508cd6e4c42100141fce95f06aba7e85 deleted file mode 100644 index fa48de0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/508cd6e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,91 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/50b383fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/50b383fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 57ac02f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/50b383fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.core.ProjectZuluLog; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent; - -public class ExperienceRedistributor { - private ConcurrentHashMap entityIdToExperience = new ConcurrentHashMap(); - - public void addExpereince(EntityPlayer player, int experience) { - entityIdToExperience.put(player.getEntityId(), experience); - } - - @SubscribeEvent - public void onPlayerRespawn(PlayerRespawnEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience [%s] and adding [%s]", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } - - @SubscribeEvent - public void onPlayerLogout(PlayerLoggedOutEvent event) { - Integer experience = entityIdToExperience.remove(event.player.getEntityId()); - if (experience != null) { - ProjectZuluLog.info("Removing Experience (%s) and adding (%s)", event.player.experienceTotal, experience); - event.player.experienceLevel = 0; - event.player.experienceTotal = 0; - event.player.experience = 0; - event.player.addExperience(experience); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/51f241fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/51f241fac42100141fce95f06aba7e85 deleted file mode 100644 index 66e0144..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/51f241fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,332 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockLeavesBase; -import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.ColorizerFoliage; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.IShearable; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Used ExtrabiomesXL Leaf to Deobfuscate names of Leaf Properties https://github.com/ExtrabiomesXL/ExtrabiomesXL - */ -public class BlockPalmTreeLeaves extends BlockLeavesBase implements IShearable { - public static final String[] imageSuffix = new String[] { "_opaque", "" }; - int[] adjacentTreeBlocks; - - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - private int iconIndex; - private static final int METADATA_BITMASK = 0x3; - private static final int METADATA_USERPLACEDBIT = 0x4; - private static final int METADATA_DECAYBIT = 0x8; - private static final int METADATA_CLEARDECAYBIT = -METADATA_DECAYBIT - 1; - - public BlockPalmTreeLeaves() { - super(Material.leaves, false); - this.setTickRandomly(true); - setHardness(0.2F); - setLightOpacity(1); - setStepSound(Block.soundTypeGrass); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - } - - private static int clearDecayOnMetadata(int metadata) { - return metadata & METADATA_CLEARDECAYBIT; - } - - private static boolean isDecaying(int metadata) { - return (metadata & METADATA_DECAYBIT) != 0; - } - - private static boolean isUserPlaced(int metadata) { - return (metadata & METADATA_USERPLACEDBIT) != 0; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return icons[iconIndex]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - @SideOnly(Side.CLIENT) - public int getBlockColor() { - double var1 = 0.5D; - double var3 = 1.0D; - return ColorizerFoliage.getFoliageColor(var1, var3); - } - - /** - * Returns the color this block should be rendered. Used by leaves. - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean shouldSideBeRendered(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { - setGraphicsLevel(Minecraft.getMinecraft().gameSettings.fancyGraphics); - return super.shouldSideBeRendered(par1iBlockAccess, par2, par3, par4, par5); - } - - /** - * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called - * when first determining what to render. - */ - @Override - @SideOnly(Side.CLIENT) - public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var6 = 0; - int var7 = 0; - int var8 = 0; - - for (int var9 = -1; var9 <= 1; ++var9) { - for (int var10 = -1; var10 <= 1; ++var10) { - int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor( - par2 + var10, par3, par4 + var9); - var6 += (var11 & 16711680) >> 16; - var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } - return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255; - } - - /** - * Notidy Nearby Leaves to Begin Decaying - */ - @Override - public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) { - byte decayRadius = 1; - int chunkCheckRadius = decayRadius + 1; - - /* Chck that Chunk is Loaded */ - if (par1World.checkChunksExist(par2 - chunkCheckRadius, par3 - chunkCheckRadius, par4 - chunkCheckRadius, par2 - + chunkCheckRadius, par3 + chunkCheckRadius, par4 + chunkCheckRadius)) { - for (int var9 = -decayRadius; var9 <= decayRadius; ++var9) { - for (int var10 = -decayRadius; var10 <= decayRadius; ++var10) { - for (int var11 = -decayRadius; var11 <= decayRadius; ++var11) { - - Block nearBlockID = par1World.getBlock(par2 + var9, par3 + var10, par4 + var11); - if (nearBlockID != null) { - nearBlockID.beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); - } - } - } - } - } - } - - /** - * Ticks the block if it's been scheduled - */ - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.isRemote) - return; - - int metadata = par1World.getBlockMetadata(par2, par3, par4); - if (isUserPlaced(metadata) || !isDecaying(metadata)) - return; - - byte rangeWood = 4; - int rangeCheckChunk = rangeWood + 1; // rangeCheckChunk - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; - - if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; - if (par1World.checkChunksExist(par2 - rangeCheckChunk, par3 - rangeCheckChunk, par4 - rangeCheckChunk, par2 - + rangeCheckChunk, par3 + rangeCheckChunk, par4 + rangeCheckChunk)) { - int var13; - int var14; - - for (var12 = -rangeWood; var12 <= rangeWood; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - Block block = par1World.getBlock(par2 + var12, par3 + var13, par4 + var14); - if (block != null - && block.canSustainLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; - } else if (block != null && block.isLeaves(par1World, par2 + var12, par3 + var13, par4 + var14)) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } - } - - int var15; - for (var12 = 1; var12 <= 4; ++var12) { - for (var13 = -rangeWood; var13 <= rangeWood; ++var13) { - for (var14 = -rangeWood; var14 <= rangeWood; ++var14) { - for (var15 = -rangeWood; var15 <= rangeWood; ++var15) { - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11] == var12 - 1) { - if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 - + var15 + var11] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 - + (var15 + var11 - 1)] = var12; - } - - if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] == -2) { - this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 - + var11 + 1] = var12; - } - } - } - } - } - } - } - - if (adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11] >= 0) { - par1World.setBlockMetadataWithNotify(par2, par3, par4, clearDecayOnMetadata(metadata), 3); - } else { - removeLeaves(par1World, par2, par3, par4); - } - } - - /** - * A randomly called display update to be able to add particles or other items for display - */ - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) - && !World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { - double var6 = par2 + par5Random.nextFloat(); - double var8 = par3 - 0.05D; - double var10 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); - } - } - - private void removeLeaves(World par1World, int par2, int par3, int par4) { - this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - int chance = world.rand.nextInt(100); - ArrayList ret = new ArrayList(); - - if (10 - chance >= 0) { - if (ItemList.coconutItem.isPresent()) { - ret.add(new ItemStack(ItemList.coconutItem.get())); - } - return ret; - } - if (30 - chance >= 0) { - if (BlockList.palmTreeSapling.isPresent()) { - ret.add(new ItemStack(BlockList.palmTreeSapling.get())); - return ret; - } - } - return ret; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - /** - * Pass true to draw this block using fancy graphics, or false for fast graphics. - */ - @SideOnly(Side.CLIENT) - public void setGraphicsLevel(boolean par1) { - this.field_150121_P = par1; - this.iconIndex = par1 ? 0 : 1; - } - - @Override - public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { - return true; - } - - @Override - public ArrayList onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 3)); - return ret; - } - - @Override - public void beginLeavesDecay(World world, int x, int y, int z) { - world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 8, 3); - } - - @Override - public boolean isLeaves(IBlockAccess world, int x, int y, int z) { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/714895e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/714895e5c42100141fce95f06aba7e85 deleted file mode 100644 index 1d46da4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/714895e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,291 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityFrog; - -public class ModelFrog extends ModelBase { - - ModelRenderer BODYROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer FOOTROT2; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer FOOTROT1; - private ModelRenderer LEG3TOPROT; - private ModelRenderer LEG3BOTROT; - private ModelRenderer FOOTROT3; - private ModelRenderer HEADROT; - private ModelRenderer MOUTHTOPRPT; - private ModelRenderer MOUTHBOTROT; - private ModelRenderer LEG4TOPROT; - private ModelRenderer LEG4BOTROT; - private ModelRenderer FOOTROT4; - private float heightToRaise = -30; - - public ModelFrog() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 18); - setTextureOffset("BODYROT.backdeco2", 0, 12); - setTextureOffset("LEG2TOPROT.legtop2", 32, 18); - setTextureOffset("LEG2BOTROT.legbot2", 32, 24); - setTextureOffset("FOOTROT2.backfoot2", 38, 18); - setTextureOffset("FOOTROT2.toe21", 38, 21); - setTextureOffset("FOOTROT2.toe22", 38, 23); - setTextureOffset("FOOTROT2.toe23", 38, 21); - setTextureOffset("LEG1TOPROT.legtop1", 32, 18); - setTextureOffset("LEG1BOTROT.legbot1", 32, 24); - setTextureOffset("FOOTROT1.backfoot1", 38, 18); - setTextureOffset("FOOTROT1.toe11", 38, 21); - setTextureOffset("FOOTROT1.toe12", 38, 23); - setTextureOffset("FOOTROT1.toe13", 38, 21); - setTextureOffset("LEG3TOPROT.legtop3", 32, 18); - setTextureOffset("LEG3BOTROT.legbot3", 32, 24); - setTextureOffset("FOOTROT3.backfoot3", 38, 18); - setTextureOffset("FOOTROT3.toe31", 38, 21); - setTextureOffset("FOOTROT3.toe32", 38, 23); - setTextureOffset("FOOTROT3.toe33", 38, 21); - setTextureOffset("HEADROT.eyelef", 0, 0); - setTextureOffset("HEADROT.eyerig", 6, 0); - setTextureOffset("HEADROT.headdecomid", 28, 0); - setTextureOffset("HEADROT.headdecolef1", 12, 0); - setTextureOffset("HEADROT.backdeco1", 24, 7); - setTextureOffset("HEADROT.headdecorig1", 20, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop0", 46, 0); - setTextureOffset("MOUTHTOPRPT.mouthtop1", 50, 4); - setTextureOffset("MOUTHTOPRPT.mouthtop2", 52, 8); - setTextureOffset("MOUTHTOPRPT.mouthtop3", 54, 11); - setTextureOffset("MOUTHTOPRPT.mouthtop4", 56, 14); - setTextureOffset("MOUTHBOTROT.mouthbot0", 46, 16); - setTextureOffset("MOUTHBOTROT.mouthbot1", 50, 21); - setTextureOffset("MOUTHBOTROT.mouthbot2", 52, 24); - setTextureOffset("MOUTHBOTROT.mouthbot3", 54, 27); - setTextureOffset("MOUTHBOTROT.mouthbot4", 46, 29); - setTextureOffset("LEG4TOPROT.legtop4", 32, 18); - setTextureOffset("LEG4BOTROT.legbot4", 32, 24); - setTextureOffset("FOOTROT4.backfoot4", 38, 18); - setTextureOffset("FOOTROT4.toe41", 38, 21); - setTextureOffset("FOOTROT4.toe42", 38, 23); - setTextureOffset("FOOTROT4.toe43", 38, 21); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 15F - heightToRaise, 7F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -3.5F, -3F, -9F, 7, 5, 9); - BODYROT.addBox("backdeco2", -2.5F, -4F, -7F, 5, 1, 5); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(4F, 0F, -2F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("legtop2", -0.5F, 0F, -1F, 1, 4, 2); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("legbot2", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT2 = new ModelRenderer(this, "FOOTROT2"); - FOOTROT2.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT2, 0F, 0F, 0F); - FOOTROT2.mirror = true; - FOOTROT2.addBox("backfoot2", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT2.addBox("toe21", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT2.addBox("toe22", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT2.addBox("toe23", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG2BOTROT.addChild(FOOTROT2); - LEG2TOPROT.addChild(LEG2BOTROT); - BODYROT.addChild(LEG2TOPROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-4F, 0F, -2F); - setRotation(LEG1TOPROT, 0F, 0F, 0F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("legtop1", -0.5F, 0F, -1F, 1, 4, 2); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("legbot1", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT1 = new ModelRenderer(this, "FOOTROT1"); - FOOTROT1.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT1, 0F, 0F, 0F); - FOOTROT1.mirror = true; - FOOTROT1.addBox("backfoot1", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT1.addBox("toe11", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT1.addBox("toe12", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT1.addBox("toe13", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG1BOTROT.addChild(FOOTROT1); - LEG1TOPROT.addChild(LEG1BOTROT); - BODYROT.addChild(LEG1TOPROT); - LEG3TOPROT = new ModelRenderer(this, "LEG3TOPROT"); - LEG3TOPROT.setRotationPoint(3F, 0F, -8F); - setRotation(LEG3TOPROT, 0F, 0F, 0F); - LEG3TOPROT.mirror = true; - LEG3TOPROT.addBox("legtop3", -0.5F, 0F, -1F, 1, 4, 2); - LEG3BOTROT = new ModelRenderer(this, "LEG3BOTROT"); - LEG3BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG3BOTROT, 0F, 0F, 0F); - LEG3BOTROT.mirror = true; - LEG3BOTROT.addBox("legbot3", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT3 = new ModelRenderer(this, "FOOTROT3"); - FOOTROT3.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT3, 0F, 0F, 0F); - FOOTROT3.mirror = true; - FOOTROT3.addBox("backfoot3", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT3.addBox("toe31", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT3.addBox("toe32", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT3.addBox("toe33", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG3BOTROT.addChild(FOOTROT3); - LEG3TOPROT.addChild(LEG3BOTROT); - BODYROT.addChild(LEG3TOPROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -9F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("eyelef", -2.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("eyerig", 1.5F, -5F, -2F, 1, 3, 2); - HEADROT.addBox("headdecomid", -0.5F, -4F, -2F, 1, 2, 4); - HEADROT.addBox("headdecolef1", -1.5F, -4.5F, -2F, 1, 3, 3); - HEADROT.addBox("backdeco1", -2.5F, -3F, 0F, 5, 1, 2); - HEADROT.addBox("headdecorig1", 0.5F, -4.5F, -2F, 1, 3, 3); - MOUTHTOPRPT = new ModelRenderer(this, "MOUTHTOPRPT"); - MOUTHTOPRPT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHTOPRPT, 0F, 0F, 0F); - MOUTHTOPRPT.mirror = true; - MOUTHTOPRPT.addBox("mouthtop0", -3.5F, -2F, -2F, 7, 2, 2); - MOUTHTOPRPT.addBox("mouthtop1", -3F, -1.5F, -3F, 6, 3, 1); - MOUTHTOPRPT.addBox("mouthtop2", -2.5F, -1F, -4F, 5, 2, 1); - MOUTHTOPRPT.addBox("mouthtop3", -2F, -0.5F, -5F, 4, 2, 1); - MOUTHTOPRPT.addBox("mouthtop4", -1.5F, 0F, -6F, 3, 1, 1); - HEADROT.addChild(MOUTHTOPRPT); - MOUTHBOTROT = new ModelRenderer(this, "MOUTHBOTROT"); - MOUTHBOTROT.setRotationPoint(0F, 0F, 0F); - setRotation(MOUTHBOTROT, 0F, 0F, 0F); - MOUTHBOTROT.mirror = true; - MOUTHBOTROT.addBox("mouthbot0", -3.5F, 0F, -2F, 7, 3, 2); - MOUTHBOTROT.addBox("mouthbot1", -3F, 1F, -3F, 6, 2, 1); - MOUTHBOTROT.addBox("mouthbot2", -2.5F, 1F, -4F, 5, 2, 1); - MOUTHBOTROT.addBox("mouthbot3", -2F, 1F, -5F, 4, 2, 1); - MOUTHBOTROT.addBox("mouthbot4", -1.5F, 1F, -6F, 3, 2, 1); - HEADROT.addChild(MOUTHBOTROT); - BODYROT.addChild(HEADROT); - LEG4TOPROT = new ModelRenderer(this, "LEG4TOPROT"); - LEG4TOPROT.setRotationPoint(-3F, 0F, -8F); - setRotation(LEG4TOPROT, 0F, 0F, 0F); - LEG4TOPROT.mirror = true; - LEG4TOPROT.addBox("legtop4", -0.5F, 0F, -1F, 1, 4, 2); - LEG4BOTROT = new ModelRenderer(this, "LEG4BOTROT"); - LEG4BOTROT.setRotationPoint(0F, 4F, 0F); - setRotation(LEG4BOTROT, 0F, 0F, 0F); - LEG4BOTROT.mirror = true; - LEG4BOTROT.addBox("legbot4", -0.5F, 0F, -1F, 1, 4, 2); - FOOTROT4 = new ModelRenderer(this, "FOOTROT4"); - FOOTROT4.setRotationPoint(0F, 4.5F, 0F); - setRotation(FOOTROT4, 0F, 0F, 0F); - FOOTROT4.mirror = true; - FOOTROT4.addBox("backfoot4", -1F, -0.5F, 0F, 2, 1, 2); - FOOTROT4.addBox("toe41", -2F, -0.5F, -0.5F, 2, 1, 1); - FOOTROT4.addBox("toe42", -0.5F, -0.5F, -2F, 1, 1, 2); - FOOTROT4.addBox("toe43", 0F, -0.5F, -0.5F, 2, 1, 1); - LEG4BOTROT.addChild(FOOTROT4); - LEG4TOPROT.addChild(LEG4BOTROT); - BODYROT.addChild(LEG4TOPROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(0.5f * f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(0.5f * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase entityLiving, float par2, float par3, float par4) { - EntityFrog var5 = (EntityFrog) entityLiving; - if (!var5.onGround) { - /* Jumping In Air */ - BODYROT.rotateAngleX = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG2BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (+60 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (-0 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+60 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (45 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (0 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (-60 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (0 * Math.PI / 180); - } else { - /* Standing On Ground */ - BODYROT.rotateAngleX = (float) (-45 * Math.PI / 180); - LEG2TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG2TOPROT.rotateAngleY = (float) (-30 * Math.PI / 180); - LEG2TOPROT.rotateAngleZ = (float) (0 * Math.PI / 180); - - LEG2BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG2BOTROT.rotateAngleY = (float) (25 * Math.PI / 180); - - LEG1TOPROT.rotateAngleX = (float) (-65 * Math.PI / 180); - LEG1TOPROT.rotateAngleY = (float) (30 * Math.PI / 180); - LEG1TOPROT.rotateAngleZ = (float) (+0 * Math.PI / 180); - LEG1BOTROT.rotateAngleX = (float) (110 * Math.PI / 180); - LEG1BOTROT.rotateAngleY = (float) (-25 * Math.PI / 180); - - LEG3TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG3BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - - LEG4TOPROT.rotateAngleX = (float) (10 * Math.PI / 180); - LEG4BOTROT.rotateAngleX = (float) (35 * Math.PI / 180); - } - super.setLivingAnimations(entityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - EntityFrog var5 = (EntityFrog) entity; - if (!var5.onGround) { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } else { - HEADROT.rotateAngleX = (float) (45 * Math.PI / 180) + 0 * Math.min(Math.max(f4, -15), +15) - * (float) (Math.PI / 180f); - } - // HEADROT.rotateAngleY = -1F + Math.min(Math.max(f3, -45), +45) * (float)(Math.PI/180f); - // HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float)(Math.PI/180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/71c098f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/71c098f6c42100141fce95f06aba7e85 deleted file mode 100644 index 3cb64b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/71c098f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,126 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import com.google.common.base.Optional; - -public class OptionalItemStack { - enum OptionalType { - BLOCK, ITEM, OREDIC; - } - - private OptionalType type = OptionalType.BLOCK; - private Optional itemBlock; - private int meta; - private int stackSize; - - public OptionalItemStack(Optional itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - - if (itemBlock.isPresent()) { - if (itemBlock.get() instanceof Item) { - type = OptionalType.ITEM; - } else if (itemBlock.get() instanceof Block) { - type = OptionalType.BLOCK; - } else if (itemBlock.get() instanceof String) { - type = OptionalType.OREDIC; - } - } else { - itemBlock = Optional.absent(); - } - } - - /* Item */ - public OptionalItemStack(Item itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Item itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.ITEM); - } - - /* Block */ - public OptionalItemStack(Block itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(Block itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.BLOCK); - } - - /* Ore Dictionary String */ - public OptionalItemStack(String itemBlock) { - this(itemBlock, 1, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize) { - this(itemBlock, stackSize, 0); - } - - public OptionalItemStack(String itemBlock, int stackSize, int meta) { - this(Optional.of(itemBlock), stackSize, meta, OptionalType.OREDIC); - } - - /** Optional Parameter With Supplied Type */ - public OptionalItemStack(Optional itemBlock, OptionalType type) { - this(itemBlock, 1, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, OptionalType type) { - this(itemBlock, stackSize, 0, type); - } - - public OptionalItemStack(Optional itemBlock, int stackSize, int meta, OptionalType type) { - this.itemBlock = itemBlock; - this.meta = meta; - this.stackSize = stackSize; - this.type = type; - } - - public boolean isPresent() { - return itemBlock != null && itemBlock.isPresent(); - } - - public ItemStack createItemStack() { - switch (type) { - case BLOCK: - return new ItemStack((Block) (itemBlock.get()), stackSize, meta); - case ITEM: - return new ItemStack((Item) (itemBlock.get()), stackSize, meta); - default: - throw new IllegalStateException("Cannot create ItemStack for OptionalType"); - } - } - - public Object createRecipeObject() { - switch (type) { - case BLOCK: - case ITEM: - return createItemStack(); - case OREDIC: - return itemBlock.get(); - default: - throw new IllegalStateException(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/81b9d4fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/81b9d4fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d7e4fa8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/81b9d4fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityGiraffe; -import projectzulu.common.mobs.models.ModelGiraffe; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class GiraffeDeclaration extends SpawnableDeclaration { - - public GiraffeDeclaration() { - super("Giraffe", 26, EntityGiraffe.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (239 << 16) + (228 << 8) + 109; - eggColor2 = (91 << 16) + (87 << 8) + 41; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.3f, 0.0f, 0.5f, 32.0f).createFromConfig( - config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelGiraffe(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "giraffe.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add("Savanna"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/9268ff9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/9268ff9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9dcd7a8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/9268ff9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAIBase; - -public class EntityAISmoothSwimming extends EntityAIBase{ - private EntityLiving theEntity; - private boolean smootherSwimming = false; - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving){ - this.theEntity = par1EntityLiving; - this.setMutexBits(4); - par1EntityLiving.getNavigator().setCanSwim(true); - } - - public EntityAISmoothSwimming(EntityLiving par1EntityLiving, boolean smootherSwimming){ - this(par1EntityLiving); - this.smootherSwimming = smootherSwimming; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - - /** - * Updates the task - */ - public void updateTask(){ -// if(smootherSwimming -//// && this.theEntity.getRNG().nextFloat() < 0.8F -//// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ) -// && !theEntity.worldObj.isAirBlock((int)theEntity.posX, (int)theEntity.posY+1, (int)theEntity.posZ)){ -// this.theEntity.getJumpHelper().setJumping(); -// } - - if(this.theEntity.getRNG().nextFloat() < 0.8F){ - this.theEntity.getJumpHelper().setJumping(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/a23925a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/a23925a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index aded3cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/a23925a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.item.ItemStack; - -public class TileEntityBrewingTriple extends TileEntityBrewingBase { - - public TileEntityBrewingTriple() { - brewingItemStacks = new ItemStack[4]; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b08b1df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b08b1df8c42100141fce95f06aba7e85 deleted file mode 100644 index fe2c17e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/b08b1df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthStair implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - int index = 0; - int botYPos = (cellSize - 1) - piecePos.posZ + index * cellSize; - int topYPos = (cellSize - 1) - piecePos.posZ + (index + 1) * cellSize; - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } else if (piecePos.posY == botYPos) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else if (piecePos.posY == topYPos) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - - if (piecePos.posY >= botYPos && piecePos.posY <= topYPos) { - if (piecePos.posX == 0 || piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } else { - return null; - } - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public String getIdentifier() { - return "labyrinthentrancestair"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/c06422a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/c06422a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b09e4a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/c06422a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.entity.Entity; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class EntityCreeperBlossomPrimed extends Entity { - /** How long the fuse is */ - public int fuse; - - public EntityCreeperBlossomPrimed(World par1World) { - super(par1World); - this.fuse = 40; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; - } - - public EntityCreeperBlossomPrimed(World par1World, double par2, double par4, double par6) { - this(par1World); - this.setPosition(par2, par4, par6); - float var8 = (float) (Math.random() * Math.PI * 2.0D); - this.motionX = (double) (-((float) Math.sin((double) var8)) * 0.02F); - this.motionY = 0.20000000298023224D; - this.motionZ = (double) (-((float) Math.cos((double) var8)) * 0.02F); - this.fuse = 40; - this.prevPosX = par2; - this.prevPosY = par4; - this.prevPosZ = par6; - } - - @Override - protected void entityInit() { - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - @Override - protected boolean canTriggerWalking() { - return false; - } - - /** - * Returns true if other Entities should be prevented from moving through this Entity. - */ - @Override - public boolean canBeCollidedWith() { - return !this.isDead; - } - - /** - * Called to update the entity's position/logic. - */ - @Override - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.9800000190734863D; - this.motionY *= 0.9800000190734863D; - this.motionZ *= 0.9800000190734863D; - - if (this.onGround) { - this.motionX *= 0.699999988079071D; - this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - - if (this.fuse-- <= 0) { - this.setDead(); - - if (!this.worldObj.isRemote) { - this.explode(); - } - } else { - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - } - } - - private void explode() { - float var1 = 1.5F; - this.worldObj.createExplosion((Entity) null, this.posX, this.posY, this.posZ, var1, this.worldObj - .getGameRules().getGameRuleBooleanValue("mobGriefing")); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - @Override - protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { - par1NBTTagCompound.setByte("Fuse", (byte) this.fuse); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - @Override - protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { - this.fuse = par1NBTTagCompound.getByte("Fuse"); - } - - @SideOnly(Side.CLIENT) - @Override - public float getShadowSize() { - return 0.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/e1413af5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/e1413af5c42100141fce95f06aba7e85 deleted file mode 100644 index 0903441..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/e1413af5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,31 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummyPharaoh extends ModelBiped { - - /** - * Sets the models various rotation angles. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f253dafdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f253dafdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1f317f0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f2/f253dafdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemCoconutShell; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/202df3a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/202df3a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 543f3f7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/202df3a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummy extends ModelBiped { - - /** - * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms - * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how - * "far" arms and legs can swing at most. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/313b1af9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/313b1af9c42100141fce95f06aba7e85 deleted file mode 100644 index acdd317..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/313b1af9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/410a69ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/410a69ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 177b645..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/410a69ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,137 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.Blueprint; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class BPSetCathedral implements BlueprintSet { - boolean isAssigned = false; - - Blueprint dome = new BPCathedralDome(); - Blueprint hallway = new BPCathedralHallway(); - Blueprint hallwayEnd = new BPCathedralHallwayEnd(); - Blueprint hallwayEnt = new BPCathedralHallwayEntrance(); - Blueprint entrance = new BPCathedralEntrance(); - Blueprint west_tower = new BPCathedralWestTower(); - Blueprint east_tower = new BPCathedralEastTower(); - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return !isAssigned; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 2, dome.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 3, dome.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 4, hallwayEnt.getIdentifier(), - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.WestWall); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 1, hallway.getIdentifier(), - CellIndexDirection.EastWall); - - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.NorthWall); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 0, hallwayEnd.getIdentifier(),// - CellIndexDirection.EastWall); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 2, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 3, hallwayEnd.getIdentifier(), - CellIndexDirection.SouthWall); - - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 5, entrance.getIdentifier(),// entrance - CellIndexDirection.NorthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 5, entrance.getIdentifier(), - CellIndexDirection.NorthEastCorner); - applyBlueprintToCell(cells, buildCoords.x + 2, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthWestCorner); - applyBlueprintToCell(cells, buildCoords.x + 3, buildCoords.y + 6, entrance.getIdentifier(), - CellIndexDirection.SouthEastCorner); - - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 5, west_tower.getIdentifier(), // west_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 5, west_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 0, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 0][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 1, buildCoords.y + 6, west_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 1][buildCoords.y + 6].getHeight()); - - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 5, east_tower.getIdentifier(), // east_tower - CellIndexDirection.NorthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 5, east_tower.getIdentifier(), - CellIndexDirection.NorthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 5].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 4, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthWestCorner, cells[buildCoords.x + 4][buildCoords.y + 6].getHeight()); - applyBlueprintToCell(cells, buildCoords.x + 5, buildCoords.y + 6, east_tower.getIdentifier(), - CellIndexDirection.SouthEastCorner, cells[buildCoords.x + 5][buildCoords.y + 6].getHeight()); - isAssigned = true; - return true; - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection) { - applyBlueprintToCell(cellList, xCell, zCell, subBuildingID, cellDirection, 0); - } - - private void applyBlueprintToCell(MazeCell[][] cellList, int xCell, int zCell, String subBuildingID, - CellIndexDirection cellDirection, int heightIncrease) { - cellList[xCell][zCell].setBuildingProperties(getIdentifier().concat("-").concat(subBuildingID), cellDirection); - cellList[xCell][zCell].rawState = -1; - cellList[xCell][zCell].setHeight(cellList[xCell][zCell].getHeight() + heightIncrease); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String childBuildingID = buildingID.split("-")[1]; - if (childBuildingID != null) { - if (childBuildingID.equals(dome.getIdentifier())) { - return dome.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallway.getIdentifier())) { - return hallway.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnd.getIdentifier())) { - return hallwayEnd.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(hallwayEnt.getIdentifier())) { - return hallwayEnt.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(entrance.getIdentifier())) { - return entrance.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(west_tower.getIdentifier())) { - return west_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (childBuildingID.equals(east_tower.getIdentifier())) { - return east_tower.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - } - return null; - } - - @Override - public String getIdentifier() { - return "Cathedral"; - } - - @Override - public int getWeight() { - return 20; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/41b7e9a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/41b7e9a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5853d75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/41b7e9a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,211 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGiraffe; - -public class ModelGiraffe extends ModelBase { - ModelRenderer body; - ModelRenderer body2; - ModelRenderer body3; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer tail; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - private ModelRenderer HEADROT; - - public ModelGiraffe() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT1.neck1", 103, 36); - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - body = new ModelRenderer(this, 0, 24); - body.addBox(-7F, -16F, -23F, 14, 16, 24); - body.setRotationPoint(0F, 5F, 11F); - body.setTextureSize(128, 64); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 56, 12); - body2.addBox(-5F, -28F, 2F, 10, 21, 12); - body2.setRotationPoint(0F, 5F, 11F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 1.047198F, 0F, 0F); - body3 = new ModelRenderer(this, 92, 0); - body3.addBox(-4.5F, -26F, -23F, 11, 10, 6); - body3.setRotationPoint(-1F, 5F, 11F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 0, 0); - leg1.addBox(-2F, 0F, -2F, 4, 19, 4); - leg1.setRotationPoint(-5F, 5F, -9F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 18, 0); - leg2.addBox(-2F, 0F, -2F, 4, 19, 4); - leg2.setRotationPoint(5F, 5F, -9F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 36, 0); - leg3.addBox(-2F, 0F, -2F, 4, 19, 4); - leg3.setRotationPoint(-5F, 5F, 9F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 0, 24); - leg4.addBox(-2F, 0F, -2F, 4, 19, 4); - leg4.setRotationPoint(5F, 5F, 9F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - tail = new ModelRenderer(this, 54, 0); - tail.addBox(-1F, 0F, 0F, 2, 17, 2); - tail.setRotationPoint(0F, -8F, 12F); - tail.setTextureSize(128, 64); - tail.mirror = true; - setRotation(tail, 0F, 0F, 0F); - NECKROT1 = new ModelRenderer(this, "NECKROT1"); - NECKROT1.setRotationPoint(0F, -21F, -9F); - setRotation(NECKROT1, 0F, 0F, 0F); - NECKROT1.mirror = true; - NECKROT1.addBox("neck1", -3F, -3F, -3F, 6, 3, 6); - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - NECKROT1.addChild(NECKROT2); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - body.render(f5); - body2.render(f5); - body3.render(f5); - leg1.render(f5); - leg2.render(f5); - leg3.render(f5); - leg4.render(f5); - tail.render(f5); - NECKROT1.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -45), +30) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityGiraffe var5 = (EntityGiraffe) par1EntityLiving; - /* State Animation Rotations */ - tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg1.rotateAngleZ = (float) (0 * Math.PI / 180); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg2.rotateAngleZ = (float) (0 * Math.PI / 180); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - float minTime; - float maxTime; - if (var5.getAnimTime() > 0) { - minTime = var5.maxAnimTime * 0; - maxTime = var5.maxAnimTime; - - /* Left Side Legs */ - leg1.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg1.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-30 * Math.PI / 180)); - - /* Right Side Legs */ - leg2.rotateAngleX = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (-130 * Math.PI / 180)); - leg2.rotateAngleZ = ModelHelper.mapValueofSet1ToSet2(var5.getAnimTime(), minTime, maxTime, - (float) (0 * Math.PI / 180), (float) (30 * Math.PI / 180)); - } - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/50b143f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/50b143f8c42100141fce95f06aba7e85 deleted file mode 100644 index 3c77c02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/50b143f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.BoarDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.EagleDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FoxDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.FrogDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBeigeDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBlackDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseDarkBrownDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseGreyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.HorseWhiteDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MammothDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MimicDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.MummyDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; -import com.ngb.projectzulu.common.mobs.entitydefaults.VultureDeclaration; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Mobs extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.MobsModId; - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), - new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), - new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), - new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), - new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), - new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), - new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), - new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), - new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBeigeDeclaration(), - new HorseBlackDeclaration(), new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), - new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), - new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), - new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/51a7199fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/51a7199fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5b36d87..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/51a7199fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseBeige; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/812300f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/812300f9c42100141fce95f06aba7e85 deleted file mode 100644 index d44ca4f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/812300f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.ai.EntityAIBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericBreedable; - -public class EntityAIFollowParent extends EntityAIBase { - /** The child that is following its parent. */ - EntityGenericBreedable childAnimal; - EntityGenericBreedable parentAnimal; - float field_75347_c; - /* Follow attempt timer, counts from 10 to 0, when 0 entity will try to move to Parent */ - private int field_75345_d; - - public EntityAIFollowParent(EntityGenericBreedable par1EntityAnimal, float par2) { - this.childAnimal = par1EntityAnimal; - this.field_75347_c = par2; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } - else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); - EntityGenericBreedable var2 = null; - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - - while (var5.hasNext()) { - EntityGenericBreedable var6 = (EntityGenericBreedable)var5.next(); - - if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); - - if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - - if (var2 == null) { - return false; - } - else if (var3 < 9.0D) { - return false; - } - else { - this.parentAnimal = var2; - return true; - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if (!this.parentAnimal.isEntityAlive()) { - return false; - } - else { - double distanceToParent = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); - return distanceToParent >= 9.0D && distanceToParent <= 256.0D; - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.field_75345_d = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.parentAnimal = null; - } - - /** - * Updates the task - */ - public void updateTask() { - if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/901f97a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/901f97a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9359d2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/901f97a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,204 +0,0 @@ -package projectzulu.common.blocks.tombstone; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityTombstone extends TileEntity { - /* List of Items this Tombstone will Empty Upon Right-Clicking */ - private ArrayList deathItems = new ArrayList(); - public int experience = 0; - private EntityXPOrb xpOrb = null; - - public EntityXPOrb getEntityOrb() { - if (hasDrops()) { - if (xpOrb == null) { - xpOrb = new EntityXPOrb(worldObj, xCoord, yCoord, zCoord, worldObj.rand.nextInt(5) + 1); - } - return xpOrb; - } - return null; - } - - public boolean addDrop(ItemStack itemDrop) { - return deathItems.add(itemDrop); - } - - public boolean hasDrops() { - return !deathItems.isEmpty() || experience > 0; - } - - /* Give items in Tombstone to Player */ - public void giveItemsToPlayer(EntityPlayer player) { - player.addExperience(experience); - experience = 0; - - Iterator unSortIterator = deathItems.iterator(); - boolean itemAdded = true; - while (unSortIterator.hasNext() && itemAdded) { - ItemStack deathItem = unSortIterator.next(); - itemAdded = player.inventory.addItemStackToInventory(deathItem); - if (itemAdded) { - unSortIterator.remove(); - } - } - } - - /** An array of four strings storing the lines of text on the sign. */ - public String[] signText; - public final int maxLines = 7; - public final int maxcharPerLine = 13; - - /** - * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only - * really used when the > < are going to be visible. - */ - public int lineBeingEdited = -1; - private boolean isEditable = true; - - public TileEntityTombstone() { - signText = new String[maxLines]; - for (int i = 0; i < signText.length; i++) { - signText[i] = ""; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound tagCompound) { - super.writeToNBT(tagCompound); - for (int i = 0; i < signText.length; i++) { - if (signText[i].length() > 0) { - tagCompound.setString("Text" + (i + 1), signText[i]); - } - } - tagCompound.setInteger("Experience", experience); - addItemsToCompound(tagCompound, "DeathItems", deathItems); - } - - private void addItemsToCompound(NBTTagCompound tileCompound, String itemTagName, List items) { - NBTTagList itemsTag = new NBTTagList(); - for (ItemStack itemStack : items) { - NBTTagCompound tag = new NBTTagCompound(); - itemStack.writeToNBT(tag); - itemsTag.appendTag(tag); - } - tileCompound.setTag(itemTagName, itemsTag); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound tagCompound) { - this.isEditable = false; - super.readFromNBT(tagCompound); - for (int i = 0; i < signText.length; ++i) { - this.signText[i] = tagCompound.getString("Text" + (i + 1)); - if (this.signText[i].length() > maxcharPerLine) { - this.signText[i] = this.signText[i].substring(0, maxcharPerLine); - } - } - experience = tagCompound.hasKey("Experience") ? tagCompound.getInteger("Experience") : 0; - deathItems = readItemsFromCompound(tagCompound, "DeathItems"); - } - - public ArrayList readItemsFromCompound(NBTTagCompound tileCompound, String itemTagName) { - ArrayList items = new ArrayList(); - if (tileCompound.hasKey(itemTagName)) { - NBTTagList itemsTag = (NBTTagList) tileCompound.getTag(itemTagName); - for (int i = 0; i < itemsTag.tagCount(); i++) { - ItemStack itemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) itemsTag.getCompoundTagAt(i)); - if (itemStack != null) { - items.add(itemStack); - } - } - } - return items; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - public void setSignString(String inputString) { - String[] words = inputString.split(" "); - int startWord = 0; - for (int currentLine = 0; currentLine < signText.length; currentLine++) { - StringBuilder currentLineText = new StringBuilder(maxcharPerLine); - /* Add Words until Line is full */ - for (int i = startWord; i < words.length; i++) { - String currentWord = getFilteredWord(words[i]); - - if (currentLineText.length() + (currentLineText.length() != 0 ? 1 : 0) + currentWord.length() <= maxcharPerLine) { - if (currentLineText.length() != 0) { - currentLineText.append(" "); - } - currentLineText.append(currentWord); - /* If This is the last line, we want to write the text */ - if (i + 1 >= words.length) { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i + 1; - break; - } - } else { - signText[currentLine] = getFilteredWord(currentLineText.toString()); - currentLineText = new StringBuilder(maxcharPerLine); - startWord = i; - break; - } - } - } - } - - /** - * Handlers filtering word if it is invalid in some way, such as truncating a word that is too long. - */ - private String getFilteredWord(String word) { - return word.length() > maxcharPerLine ? word.substring(0, maxcharPerLine - 2).concat(".") : word; - } - - @SideOnly(Side.CLIENT) - public double getMaxRenderDistanceSquared() { - return 16384.0D; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/90fecffec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/90fecffec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index edead57..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/90fecffec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityCentipede; -import projectzulu.common.mobs.models.ModelCentipede; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CentipedeDeclaration extends SpawnableDeclaration { - - public CentipedeDeclaration() { - super("Centipede", 40, EntityCentipede.class, EnumCreatureType.monster); - setSpawnProperties(1, 35, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (77 << 16) + (22 << 8) + 17; - eggColor2 = (212 << 16) + (97 << 8) + 38; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 15); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Antennae.meta(), 1); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelCentipede(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "serpent.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.extremeHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.swampland.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozen = new HashSet(); - nonFrozen.addAll(typeToArray(Type.MOUNTAIN)); - nonFrozen.addAll(typeToArray(Type.FOREST)); - nonFrozen.addAll(typeToArray(Type.PLAINS)); - nonFrozen.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozen); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a02d1c00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a02d1c00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index baa8774..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a02d1c00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,247 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.core.packets.PacketStreamSound; -import projectzulu.common.core.packets.PacketTameParticle; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.mobs.packets.PacketAnimTime; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import projectzulu.common.mobs.packets.PacketNameSync; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a06ebcf9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a06ebcf9c42100141fce95f06aba7e85 deleted file mode 100644 index fcf9035..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a06ebcf9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,16 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraft.world.biome.BiomeGenBase; - -public class SpawnEntry { - public final BiomeGenBase biome; - public final int spawnRate; - public final int minInChunk; - public final int maxInChunk; - public SpawnEntry(BiomeGenBase biome, int spawnRate, int minInChunk, int maxInChunk) { - this.biome = biome; - this.spawnRate = spawnRate; - this.minInChunk = minInChunk; - this.maxInChunk = maxInChunk; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a2418bf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a2418bf8c42100141fce95f06aba7e85 deleted file mode 100644 index 4327108..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/a2418bf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericRideable; - -public class RenderMammoth extends RenderGenericLiving { - public final ResourceLocation snowSaddle; - public final ResourceLocation snowWild; - public final ResourceLocation wildSaddle; - - public RenderMammoth(ModelBase par1ModelBase, float shadowSize) { - super(par1ModelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - snowWild = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow.png"); - wildSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_saddle.png"); - snowSaddle = new ResourceLocation(DefaultProps.mobKey, "mammoth_snow_saddle.png"); - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (((EntityGenericRideable) entity).getSaddled()) { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowSaddle; - } else { - return wildSaddle; - } - - } else { - if (entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taiga - || entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ) == BiomeGenBase.taigaHills) { - return snowWild; - } else { - return livingTexture; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/d1217ba2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/d1217ba2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 658ee19..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/d1217ba2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,34 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthCobweb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if ((piecePos.posY == 0 || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if ((piecePos.posY == 1 || piecePos.posY == cellHeight - 2) && 10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.web, 0); - } else { - return new BlockWithMeta(Blocks.air); - } - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "labyrinthcobweb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/d1e07ca0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/d1e07ca0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 50e4038..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f3/d1e07ca0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.api.BlockList; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/51916de4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/51916de4c42100141fce95f06aba7e85 deleted file mode 100644 index f5aaff6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/51916de4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.item.ItemSlab; -import net.minecraft.item.ItemStack; - -public class ItemZuluSlab extends ItemSlab { - - private static BlockSlab halfBlock; - private static BlockSlab doubleSlab; - private final boolean isFullBlock; - - /** - * Setup the half/double Slab instances required by ItemSlab This is a workaround as Forge does not allow Blocks to - * registered with an instance of an itemClass but an Item.class which only allow itemID constructor - */ - public static void initialise(BlockSlab halfBlock, BlockSlab doubleSlab) { - ItemZuluSlab.halfBlock = halfBlock; - ItemZuluSlab.doubleSlab = doubleSlab; - } - - public ItemZuluSlab(Block block) { - super(block, (BlockSlab) halfBlock, (BlockSlab) doubleSlab, block == doubleSlab); - isFullBlock = block == doubleSlab; - } - - /** - * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have - * different names based on their damage or NBT. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) { - return isFullBlock ? doubleSlab.func_150002_b(par1ItemStack.getItemDamage()) : super - .getUnlocalizedName(par1ItemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/701e27baedac0014196dc3517d78505a b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/701e27baedac0014196dc3517d78505a new file mode 100644 index 0000000..0117b84 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/701e27baedac0014196dc3517d78505a @@ -0,0 +1,334 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelCamel extends ModelBase +{ + float heightToRaise = 33f; + float renderScale = 1.0f; + //fields + //fields + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer HEADbump; + ModelRenderer HEAD; + ModelRenderer neckTop; + ModelRenderer neckBase; + ModelRenderer humpMain; + ModelRenderer humpMain2; + ModelRenderer saddleBase; + ModelRenderer saddleHorn1; + ModelRenderer saddleHorn2; + ModelRenderer Body; + ModelRenderer hip1; + ModelRenderer Leg1toProt; + ModelRenderer Leg1BotRot; + ModelRenderer hip2; + ModelRenderer Leg2toProt; + ModelRenderer Leg2BotRot; + ModelRenderer hip3; + ModelRenderer Leg3toProt; + ModelRenderer Leg3BotRot; + ModelRenderer hip4; + ModelRenderer Leg4toProt; + ModelRenderer Leg4BotRot; + ModelRenderer tail; + + public ModelCamel() + { + textureWidth = 128; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -3F, -4F, 5, 4, 7); + HEAD.setRotationPoint(0F, 3F - heightToRaise, -15F); + HEAD.setTextureSize(128, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.2268928F, 0F, 0F); + HEADbump = new ModelRenderer(this, 105, 42); + HEADbump.addBox(-2F, -2F, -3F, 3, 2, 6); + //HEADbump.setRotationPoint(1F, 1.5F, -15.5F); + HEADbump.setRotationPoint(1F, -1.5F, -0.5F); + HEADbump.setTextureSize(128, 64); + HEADbump.mirror = true; + setRotation(HEADbump, 0.296706F, 0F, 0F); + HEAD.addChild(HEADbump); + earLeft = new ModelRenderer(this, 60, 6); + earLeft.addBox(0F, -3F, -1F, 1, 4, 1); + //earLeft.setRotationPoint(1.5F, 1F, -13F); + earLeft.setRotationPoint(1.5F, -1.0F, 2.5F); + earLeft.setTextureSize(128, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, 0.5235988F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 60, 1); + earRight.addBox(-1F, -3F, -1F, 1, 4, 1); + //earRight.setRotationPoint(-0.5F, 1F, -13F); + earRight.setRotationPoint(-0.5F, -1.0F, 2.5F); + earRight.setTextureSize(128, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, -0.5235988F); + HEAD.addChild(earRight); + + neckTop = new ModelRenderer(this, 29, 1); + neckTop.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + neckTop.setRotationPoint(0.5F, 1.8F - heightToRaise , -14F); + neckTop.setTextureSize(128, 64); + neckTop.mirror = true; + setRotation(neckTop, 0.6457718F, 0F, 0F); + neckBase = new ModelRenderer(this, 43, 1); + neckBase.addBox(-1.5F, 0F, -1.5F, 3, 6, 4); + neckBase.setRotationPoint(0.5F, 6F - heightToRaise, -11.5F); + neckBase.setTextureSize(128, 64); + neckBase.mirror = true; + setRotation(neckBase, 1.117011F, 0F, 0F); + humpMain = new ModelRenderer(this, 1, 41); + humpMain.addBox(-3.5F, -2F, -2F, 8, 4, 9); + humpMain.setRotationPoint(0F, 3F - heightToRaise, -0.5F); + humpMain.setTextureSize(128, 64); + humpMain.mirror = true; + setRotation(humpMain, 0F, 0F, 0F); + humpMain2 = new ModelRenderer(this, 37, 42); + humpMain2.addBox(-3F, -2F, -2F, 7, 4, 7); + humpMain2.setRotationPoint(0F, 0.75F - heightToRaise, 0.5F); + humpMain2.setTextureSize(128, 64); + humpMain2.mirror = true; + setRotation(humpMain2, 0F, 0F, 0F); + saddleBase = new ModelRenderer(this, 68, 52); + saddleBase.addBox(-3.5F, -2F, -2F, 6, 1, 5); + saddleBase.setRotationPoint(1F, 4F - heightToRaise, -5F); + saddleBase.setTextureSize(128, 64); + saddleBase.mirror = true; + setRotation(saddleBase, 0F, 0F, 0F); + saddleHorn1 = new ModelRenderer(this, 67, 1); + saddleHorn1.addBox(-1F, -3F, -1F, 1, 5, 1); + saddleHorn1.setRotationPoint(1F, 1F - heightToRaise, -6F); + saddleHorn1.setTextureSize(128, 64); + saddleHorn1.mirror = true; + setRotation(saddleHorn1, 0.3346075F, 0F, 0F); + saddleHorn2 = new ModelRenderer(this, 73, 5); + saddleHorn2.addBox(-2F, -1F, -1F, 4, 1, 1); + saddleHorn2.setRotationPoint(0.5F, 0F - heightToRaise, -7F); + saddleHorn2.setTextureSize(128, 64); + saddleHorn2.mirror = true; + setRotation(saddleHorn2, 0F, 0F, 0F); + Body = new ModelRenderer(this, 1, 14); + Body.addBox(-3.5F, -2F, -10F, 9, 9, 16); + Body.setRotationPoint(-0.5F, 5F - heightToRaise, 3F); + Body.setTextureSize(128, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + hip1 = new ModelRenderer(this, 68, 42); + hip1.addBox(-1F, -3F, -1F, 4, 4, 4); + hip1.setRotationPoint(-4F, 12F - heightToRaise, -5.5F); + hip1.setTextureSize(128, 64); + hip1.mirror = true; + setRotation(hip1, 0.0698132F, 0F, 0F); + Leg1toProt = new ModelRenderer(this, 65, 13); + Leg1toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg1toProt.setRotationPoint(-3F, 12F, -4.5F); + Leg1toProt.setRotationPoint(1F, 0F, 0.5F); + Leg1toProt.setTextureSize(128, 64); + Leg1toProt.mirror = true; + setRotation(Leg1toProt, 0.0698132F, 0F, 0F); + hip1.addChild(Leg1toProt); + Leg1BotRot = new ModelRenderer(this, 65, 25); + Leg1BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg1BotRot.setRotationPoint(-3F, 17F, -4F); + Leg1BotRot.setRotationPoint(0F, 6F, 0F); + Leg1BotRot.setTextureSize(128, 64); + Leg1BotRot.mirror = true; + setRotation(Leg1BotRot, -0.0698132F, 0F, 0F); + Leg1toProt.addChild(Leg1BotRot); + hip2 = new ModelRenderer(this, 68, 42); + hip2.addBox(-1F, -1F, -1F, 4, 4, 4); + hip2.setRotationPoint(3F, 10F - heightToRaise, -5.5F); + hip2.setTextureSize(128, 64); + hip2.mirror = true; + setRotation(hip2, 0.0698132F, 0F, 0F); + Leg2toProt = new ModelRenderer(this, 52, 13); + Leg2toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg2toProt.setRotationPoint(4F, 11F, -4.5F); + Leg2toProt.setRotationPoint(1F, 2F, 0.5F); + Leg2toProt.setTextureSize(128, 64); + Leg2toProt.mirror = true; + setRotation(Leg2toProt, 0.0698132F, 0F, 0F); + hip2.addChild(Leg2toProt); + Leg2BotRot = new ModelRenderer(this, 52, 25); + Leg2BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg2BotRot.setRotationPoint(4F, 17F, -4F); + Leg2BotRot.setRotationPoint(0F, 6F, 0F); + Leg2BotRot.setTextureSize(128, 64); + Leg2BotRot.mirror = true; + setRotation(Leg2BotRot, -0.0698132F, 0F, 0F); + Leg2toProt.addChild(Leg2BotRot); + hip3 = new ModelRenderer(this, 87, 42); + hip3.addBox(-1F, -1F, -1F, 4, 5, 4); + hip3.setRotationPoint(-4F, 9F - heightToRaise, 5F); + hip3.setTextureSize(128, 64); + hip3.mirror = true; + setRotation(hip3, 0.0698132F, 0F, 0F); + Leg3toProt = new ModelRenderer(this, 95, 13); + Leg3toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg3toProt.setRotationPoint(-3F, 12F, 6F); + Leg3toProt.setRotationPoint(1F, 2F, 1F); + Leg3toProt.setTextureSize(128, 64); + Leg3toProt.mirror = true; + setRotation(Leg3toProt, 0.0872665F, 0F, 0F); + hip3.addChild(Leg3toProt); + Leg3BotRot = new ModelRenderer(this, 95, 25); + Leg3BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg3BotRot.setRotationPoint(-3F, 17F, 6.5F); + Leg3BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg3BotRot.setTextureSize(128, 64); + Leg3BotRot.mirror = true; + setRotation(Leg3BotRot, -0.0698132F, 0F, 0F); + Leg3toProt.addChild(Leg3BotRot); + + hip4 = new ModelRenderer(this, 87, 42); + hip4.addBox(-1F, -1F, -1F, 4, 5, 4); + hip4.setRotationPoint(3F, 9F - heightToRaise, 5F); + hip4.setTextureSize(128, 64); + hip4.mirror = true; + setRotation(hip4, 0.0698132F, 0F, 0F); + Leg4toProt = new ModelRenderer(this, 81, 13); + Leg4toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg4toProt.setRotationPoint(4F, 12F, 6F); + Leg4toProt.setRotationPoint(1F, 2F, 1F); + Leg4toProt.setTextureSize(128, 64); + Leg4toProt.mirror = true; + setRotation(Leg4toProt, 0.0872665F, 0F, 0F); + hip4.addChild(Leg4toProt); + Leg4BotRot = new ModelRenderer(this, 81, 25); + Leg4BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg4BotRot.setRotationPoint(4F, 17F, 6.5F); + Leg4BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg4BotRot.setTextureSize(128, 64); + Leg4BotRot.mirror = true; + setRotation(Leg4BotRot, -0.0698132F, 0F, 0F); + Leg4toProt.addChild(Leg4BotRot); + tail = new ModelRenderer(this, 109, 13); + tail.addBox(-1F, -1F, 0F, 2, 7, 2); + tail.setRotationPoint(0F, 7F - heightToRaise, 7.6F); + tail.setTextureSize(128, 64); + tail.mirror = true; + setRotation(tail, 0.5585054F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + //Leg1toProt.render(f5); + //Leg1BotRot.render(f5); + hip2.render(renderScale * f5); + //Leg2toProt.render(f5); + //Leg2BotRot.render(f5); + hip3.render(renderScale * f5); + //Leg3toProt.render(f5); + //Leg3BotRot.render(f5); + hip4.render(renderScale * f5); + //Leg4toProt.render(f5); + //Leg4BotRot.render(f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + hip2.render(renderScale * f5); + hip3.render(renderScale * f5); + hip4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Tail Rotation */ + //NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 + //* MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + /* Tail Rotation */ + tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + /* Leg Animation */ + hip1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + hip2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + Leg1BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg2BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + hip3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + hip4.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + Leg3BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg4BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleX = f4 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + } + + } diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/711837f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/711837f6c42100141fce95f06aba7e85 deleted file mode 100644 index 3699547..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/711837f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; - -public class KeyParserLight extends KeyParserRange { - - public KeyParserLight(Key key) { - super(key); - } - - @Override - int getCurrent(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - return world.getBlockLightValue(xCoord, yCoord, zCoord); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/71cfcef7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/71cfcef7c42100141fce95f06aba7e85 deleted file mode 100644 index 48f404b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/71cfcef7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import com.ngb.projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/800f33f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/800f33f8c42100141fce95f06aba7e85 deleted file mode 100644 index eea800c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/800f33f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; - -public class TileEntityWithMeta extends BlockWithMeta { - - public TileEntity tileEntity; - - public TileEntityWithMeta(Block block, int meta, TileEntity tileEntity) { - super(block, meta); - this.tileEntity = tileEntity; - } - - public TileEntityWithMeta(Block block, TileEntity tileEntity) { - this(block, 0, tileEntity); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - world.setBlock(position.posX, position.posY, position.posZ, block, meta, 3); - world.setTileEntity(position.posX, position.posY, position.posZ, tileEntity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/80a6f4e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/80a6f4e5c42100141fce95f06aba7e85 deleted file mode 100644 index f781967..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/80a6f4e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b03547a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b03547a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5e1cb7b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/b03547a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/c1a014fac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/c1a014fac42100141fce95f06aba7e85 deleted file mode 100644 index dea3f3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/c1a014fac42100141fce95f06aba7e85 +++ /dev/null @@ -1,50 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.BlockCampfire; -import com.ngb.projectzulu.common.blocks.ItemCampFire; -import com.ngb.projectzulu.common.blocks.RenderCampFire; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -public class CampfireDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public CampfireDeclaration() { - super("Campfire"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Campfire Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.campfire = Optional.of(new BlockCampfire(renderID).setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.campfire.get(); - GameRegistry.registerBlock(block, ItemCampFire.class, name.toLowerCase()); - } - - @Override - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderCampFire()); - ProjectZuluLog.info("Campfire Render ID Registed to %s", renderID); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d0810ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d0810ef6c42100141fce95f06aba7e85 deleted file mode 100644 index 49f041a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d0810ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,102 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import com.ngb.projectzulu.common.blocks.util.StringHelper; - -public class ItemBlacklist { - - private List blacklist; - - private static interface Rule { - public boolean isMatch(ItemStack itemStack); - } - - private static class ItemIdMatch implements Rule { - public final String itemId; - - public ItemIdMatch(String itemId) { - this.itemId = itemId; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (itemStack == null) { - return false; - } - return itemId.equals(Item.itemRegistry.getNameForObject(itemStack.getItem())); - } - } - - private static class ItemMetaMatch extends ItemIdMatch { - public final int minItemDamage; - public final int maxItemDamage; - - public ItemMetaMatch(String itemId, int minItemDamage) { - this(itemId, minItemDamage, minItemDamage); - } - - public ItemMetaMatch(String itemId, int minItemDamage, int maxItemDamage) { - super(itemId); - this.minItemDamage = minItemDamage; - this.maxItemDamage = maxItemDamage; - } - - @Override - public boolean isMatch(ItemStack itemStack) { - if (super.isMatch(itemStack)) { - if (minItemDamage <= maxItemDamage) { - return (itemStack.getItemDamage() <= maxItemDamage && itemStack.getItemDamage() >= minItemDamage); - } else { - return !(itemStack.getItemDamage() < minItemDamage && itemStack.getItemDamage() > maxItemDamage); - } - } - return false; - } - } - - public void loadFromConfig(Configuration config) { - blacklist = new ArrayList(); - Property property = config.get("General Controls", "Tombstone drop blacklist", ""); - String[] itemStringEntries = property.getString().split(","); - for (String stringEntry : itemStringEntries) { - // : - String[] entryParts = stringEntry.split(":"); - if (entryParts.length < 1 || stringEntry.trim().equals("")) { - continue; - } - String itemID = entryParts[0]; - if (entryParts.length >= 2) { - String[] metaRangeParts = entryParts[1].split("-"); - if (metaRangeParts.length == 1) { - if ("*".equals(metaRangeParts[0])) { - blacklist.add(new ItemIdMatch(itemID)); - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta)); - } - } else { - int minMeta = StringHelper.parseInteger(metaRangeParts[0], "0123456789"); - int maxMeta = StringHelper.parseInteger(metaRangeParts[1], "0123456789"); - blacklist.add(new ItemMetaMatch(itemID, minMeta, maxMeta)); - } - } else { - blacklist.add(new ItemIdMatch(itemID)); - } - } - } - - public boolean isItemBlacklisted(ItemStack stack) { - for (Rule rule : blacklist) { - if (rule.isMatch(stack)) { - return true; - } - } - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d10817a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d10817a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 36bfbe4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/d10817a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,10 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.entity.Render; - -/** - * Interface to hide ClientSide Render in objects on Server when Side.Client is insufficient i.e. abstract methods - */ -public interface RenderWrapper { - public Render getRender(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/e1a0a4f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/e1a0a4f9c42100141fce95f06aba7e85 deleted file mode 100644 index 197bcf3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f4/e1a0a4f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,48 +0,0 @@ -package com.ngb.projectzulu.common.core; - - -/** - * For usage see: {@link Pair} - */ -public class PairFullShortName implements Comparable> { - private final K fullName; - private final V shortName; - - public static PairFullShortName createPair(K fullName, V shortName) { - return new PairFullShortName(fullName, shortName); - } - - public PairFullShortName(K fullName, V shortName) { - this.fullName = fullName; - this.shortName = shortName; - } - - public K getFullName() { - return fullName; - } - - public V getShortName() { - return shortName; - } - - @Override - public boolean equals(Object object){ - if (! (object instanceof PairFullShortName)) { return false; } - PairFullShortName pair = (PairFullShortName)object; - return fullName.equals(pair.fullName) && shortName.equals(pair.shortName); - } - - @Override - public int hashCode(){ - return 7 * fullName.hashCode() + 13 * shortName.hashCode(); - } - - @Override - public int compareTo(PairFullShortName otherPair) { - if(otherPair.equals(this)){ - return 0; - }else{ - return this.getShortName().compareTo(otherPair.getShortName()); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/00fb9aa1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/00fb9aa1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8bd43ee..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/00fb9aa1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,100 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.command.IEntitySelector; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class EntityAINearestAttackableTarget extends EntityAITarget{ - EntityLivingBase targetEntity; - Class targetClass; - int targetChance; - private final IEntitySelector entitySelector; - EnumSet setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/018d6b9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/018d6b9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c61a38a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/018d6b9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,124 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandSpawnEntity extends CommandBase{ - @Override - public String getCommandName(){ - return "spawnentity"; - } - - /** - * Return the required permission level for this command. - */ - public int getRequiredPermissionLevel(){ - return 2; - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender){ - return "commands.spawnentity.usage"; - } - - /** - * Command stringArgs : /spawnentity [targetPlayer] [entityName] - * Command stringArgs == 2: /spawnentity @p entityName - * Command stringArgs == 5: /spawnentity @p entityName - * Command stringArgs == 7: /spawnentity @p entityName - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs){ - if(stringArgs.length < 2){ - throw new WrongUsageException("commands.spawnentity.usage", new Object[0]); - }else{ - double spawnTargetX = 0; - double spawnTargetY = 0; - double spawnTargetZ = 0; - float rotYaw = 0; - float rotPitch = 0; - - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if(targetPlayer == null){ - throw new PlayerNotFoundException(); - } - - Entity spawnableEntity = EntityList.createEntityByName(stringArgs[1], targetPlayer.worldObj); - if(spawnableEntity == null){ - System.out.println("Entity is Null"); - throw new WrongUsageException("commands.spawnentity.noentity", new Object[0]); - } - - if(stringArgs.length == 2){ - spawnTargetX = (int)targetPlayer.posX; - spawnTargetY = (int)targetPlayer.posY; - spawnTargetZ = (int)targetPlayer.posZ; - }else if(stringArgs.length == 5 || stringArgs.length == 7){ - int indexOfPos = stringArgs.length - 3; - spawnTargetX = (int)parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - spawnTargetY = (int)parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, 0); - spawnTargetZ = (int)parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - if(stringArgs.length == 7){ - rotYaw = parseIntBounded(commandSender, stringArgs[2], 0, 360); - rotPitch = parseIntBounded(commandSender, stringArgs[3], 0, 360); - } - -// ProjectZuluLog.info("Placing Block at %s, %s, %s with Yaw %s and pitch %s", spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch ); - spawnableEntity.setLocationAndAngles(spawnTargetX, spawnTargetY, spawnTargetZ, rotYaw, rotPitch); - targetPlayer.worldObj.spawnEntityInWorld(spawnableEntity); - } - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr){ - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble){ - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, int lowerLimit, int upperLimit){ - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1){ - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords){ - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords){ - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0){ - if (targetPos < (double)lowerLimit){ - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(targetPos), Integer.valueOf(lowerLimit)}); - } - - if (targetPos > (double)upperLimit){ - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(targetPos), Integer.valueOf(upperLimit)}); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/1167b701c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/1167b701c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index e69462a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/1167b701c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world.dataobjects.ChestWithMeta; -import projectzulu.common.world.dataobjects.MimicWithMeta; -import projectzulu.common.world.terrain.PyramidFeature; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectBase; - -public class BPSetTreasureDeadEnd implements BlueprintSet, Blueprint { - - BlockWithMeta floorblock; - - public BPSetTreasureDeadEnd() { - floorblock = new BlockWithMeta(Blocks.sandstone); - } - - @Override - public String getIdentifier() { - return "deadend"; - } - - @Override - public int getWeight() { - return 50; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.Middle); - cells[buildCoords.x][buildCoords.y].rawState = 2; - return true; - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return cells[buildCoords.x][buildCoords.y].rawState == 0 && ArchitectBase.isDeadEnd(cells, buildCoords, 1, -1); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return floorblock; - } else if (piecePos.posY == 1) { - if (random.nextInt(5) == 0) { - PyramidFeature terrainFeature = (PyramidFeature) ProjectZulu_Core.featureGenerator - .getRegisteredStructure(PyramidFeature.PYRAMID); - return new ChestWithMeta(Blocks.chest, 0, new TileEntityChest(), terrainFeature.chestLootChance, - terrainFeature.chestMaxLoot); - - } else if (random.nextInt(4) == 0) { - return new MimicWithMeta(); - } - } - return new BlockWithMeta(Blocks.air); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20e3d1f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20e3d1f4c42100141fce95f06aba7e85 deleted file mode 100644 index 6f62f6c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/20e3d1f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,29 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import com.ngb.projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionIncendiary extends SubItemPotionGeneric { - - public SubItemPotionIncendiary(Item itemID, int subID) { - super(itemID, subID, "potion.incendiary"); - setSubItemBounds(1, 1, 4, 2); -// setEffectScale(20 * 5, 20 * 5, 20 * 10, 20 * 1, 2); - setEffectScale(0, 0, 0, 0, 2); - - /* Invert Regular Potion Names as Incendiary "Duration" is useless "Power" controls how long a Fire is Set */ - strengthPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - durationPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - - durationPostfixes = new String[] { "", "of Thickness", "of Strength", "of Fortification" }; - strengthPostfixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - } - - @Override - Optional getPotion() { - return PotionList.incendiary; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/403adeffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/403adeffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 3180cd9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/403adeffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WhiteClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public WhiteClothArmorDeclaration(int renderIndex) { - super(new String[] { "WhiteClothHelmet", "WhiteClothChest", "WhiteClothLegs", "WhiteClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.whiteClothHead = Optional.of(item); - return true; - case 1: - ItemList.whiteClothChest = Optional.of(item); - return true; - case 2: - ItemList.whiteClothLeg = Optional.of(item); - return true; - case 3: - ItemList.whiteClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.whiteClothHead.get(); - break; - case 1: - item = ItemList.whiteClothChest.get(); - break; - case 2: - item = ItemList.whiteClothLeg.get(); - break; - case 3: - item = ItemList.whiteClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/61767b9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/61767b9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 25e6fc5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/61767b9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,53 +0,0 @@ -package projectzulu.common.potion.effects; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.PotionEffect; - -public class PotionCurse extends PotionZulu { - - public PotionCurse(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(2, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - - /* Get Active Potion effect Collection from Entity */ - Collection potionEffects = effectedEntity.getActivePotionEffects(); - - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - /* Check if we Should Try to Get a PotionEffect, proportional to Potion Strength */ - if ((par2 + 1) * 25 + 25 - effectedEntity.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToAct = numOfElemenents > 0 ? effectedEntity.worldObj.rand.nextInt(numOfElemenents) : 0; - Iterator iterator = potionEffects.iterator(); - - /* Get Specific Element and assuming its not the Current Potion ID, mark it for Removal */ - int i = 0; - PotionEffect potionEffectToPerform = null; - while (iterator.hasNext() && i <= elementToAct) { - potionEffectToPerform = (PotionEffect) iterator.next(); - if (i == elementToAct && !effectedEntity.worldObj.isRemote && potionEffectToPerform != null - && potionEffectToPerform.getPotionID() != id) { - potionEffectToPerform.performEffect(effectedEntity); - break; - } - i++; - } - } - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/8041fbf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/8041fbf8c42100141fce95f06aba7e85 deleted file mode 100644 index 8854324..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/8041fbf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,100 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import java.util.Collections; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.command.IEntitySelector; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class EntityAINearestAttackableTarget extends EntityAITarget{ - EntityLivingBase targetEntity; - Class targetClass; - int targetChance; - private final IEntitySelector entitySelector; - EnumSet setOfValidStates; - - /** Instance of EntityAINearestAttackableTargetSorter. */ - private EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, false); - } - - public EntityAINearestAttackableTarget(EntityGenericCreature par1EntityLiving, EnumSet setOfValidStates, Class par2Class, float par3, int par4, boolean par5, boolean par6){ - this(par1EntityLiving, setOfValidStates, par2Class, par3, par4, par5, par6, (IEntitySelector)null); - } - - public EntityAINearestAttackableTarget(EntityLiving par1, EnumSet setOfValidStates, Class par2, float par3, int par4, boolean par5, boolean par6, IEntitySelector par7IEntitySelector){ - super(par1, par3, par5, par6); - this.setOfValidStates = setOfValidStates; - this.targetClass = par2; - this.targetDistance = par3; - this.targetChance = par4; - this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(this, par1); - this.entitySelector = par7IEntitySelector; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if(setOfValidStates != null && !setOfValidStates.contains(((EntityGenericCreature)taskOwner).getEntityState())){ - return false; - } - - if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0){ - return false; - } - else{ - if (this.targetClass == EntityPlayer.class){ - EntityPlayer var1 = this.taskOwner.worldObj.getClosestVulnerablePlayerToEntity(this.taskOwner, (double)this.targetDistance); - - if (this.isSuitableTarget(var1, false)){ - this.targetEntity = var1; - return true; - } - } - else{ - List var5 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand((double)this.targetDistance, 4.0D, (double)this.targetDistance), this.entitySelector); - Collections.sort(var5, this.theNearestAttackableTargetSorter); - Iterator var2 = var5.iterator(); - - while (var2.hasNext()){ - Entity var3 = (Entity)var2.next(); - EntityLiving var4 = (EntityLiving)var3; - - if (this.isSuitableTarget(var4, false)){ - - this.targetEntity = var4; - return true; - } - } - } - return false; - } - } - - @Override - public boolean continueExecuting() { - if( ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.attacking && ((EntityGenericCreature)taskOwner).getEntityState() != EntityStates.looking){ - return false; - } - return super.continueExecuting(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/901a00a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/901a00a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e4020a9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/901a00a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,84 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import projectzulu.common.core.PZPacket; -import projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream implements PZPacket { - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException; - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(ctx, data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short length = par0DataInputStream.readShort(); - if (length < 0) - return null; - else { - byte[] compressed = new byte[length]; - par0DataInputStream.readFully(compressed); - return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed)); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9040bfffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9040bfffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 99444c0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/9040bfffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class DiamondScaleArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public DiamondScaleArmorDeclaration(int renderIndex) { - super(new String[] { "DiamondScaleHelmet", "DiamondScaleChest", "DiamondScaleLegs", "DiamondScaleBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.diamondScaleMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.diamondScaleArmorHead = Optional.of(item); - return true; - case 1: - ItemList.diamondScaleArmorChest = Optional.of(item); - return true; - case 2: - ItemList.diamondScaleArmorLeg = Optional.of(item); - return true; - case 3: - ItemList.diamondScaleArmorBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.diamondScaleArmorHead.get(); - break; - case 1: - item = ItemList.diamondScaleArmorChest.get(); - break; - case 2: - item = ItemList.diamondScaleArmorLeg.get(); - break; - case 3: - item = ItemList.diamondScaleArmorBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a01c0401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a01c0401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 09eaa35..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/a01c0401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,188 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class EntityAITempt extends EntityAIBase{ - - /** The entity using this AI that is tempted by the player. */ - private EntityGenericCreature temptedEntity; - private float speed; - private double field_75283_c; - private double field_75280_d; - private double field_75281_e; - private double field_75278_f; - private double field_75279_g; - - private boolean shouldHop = false; - private int slimeJumpDelay = 0; - - /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; - - /** - * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always - * return false if delayTemptCounter is greater than 0. - */ - private int delayTemptCounter = 0; - private boolean field_75287_j; - - /** - * This field saves the ID of the items that can be used to breed entities with this behaviour. - */ - private Item breedingFood; - - /** - * Whether the entity using this AI will be scared by the tempter's sudden movement. - */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4) { - this.temptedEntity = par1EntityCreature; - this.speed = par2; - this.breedingFood = par3; - this.scaredByPlayerMovement = par4; - this.setMutexBits(3); - } - - public EntityAITempt(EntityGenericCreature par1EntityCreature, float par2, Item par3, boolean par4, boolean shouldHop) { - this(par1EntityCreature, par2, par3, par4); - this.shouldHop = shouldHop; - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } - else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); - - if (this.temptingPlayer == null) { - return false; - } - else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); - return var1 == null ? false : breedingFood.equals(var1.getItem()); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - if(shouldHop){ - tryToHop(); - } - - if (this.scaredByPlayerMovement) { - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { - if (this.temptingPlayer.getDistanceSq(this.field_75283_c, this.field_75280_d, this.field_75281_e) > 0.010000000000000002D) { - return false; - } - - if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } - else { - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - } - - this.field_75278_f = (double)this.temptingPlayer.rotationPitch; - this.field_75279_g = (double)this.temptingPlayer.rotationYaw; - } - - return this.shouldExecute(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(shouldHop){ - tryToHop(); - } - this.field_75283_c = this.temptingPlayer.posX; - this.field_75280_d = this.temptingPlayer.posY; - this.field_75281_e = this.temptingPlayer.posZ; - this.field_75287_j = true; - this.field_75286_m = this.temptedEntity.getNavigator().getAvoidsWater(); - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - - /** - * Resets the task - */ - public void resetTask() { - if(shouldHop){ - tryToHop(); - } - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); - this.delayTemptCounter = 100; - this.field_75287_j = false; - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - - /** - * Updates the task - */ - public void updateTask() { - - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); - - if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } - else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.speed); - } - - if(shouldHop){ - tryToHop(); - } - } - - public boolean func_75277_f() - { - return this.field_75287_j; - } - - public void tryToHop(){ - if(!temptedEntity.onGround){ - - }else - if (temptedEntity.onGround && this.slimeJumpDelay-- <= 0){ - this.slimeJumpDelay = this.getJumpDelay(); - -// if (var1 != null){ -// this.slimeJumpDelay /= 3; -// } - - temptedEntity.getJumpHelper().setJumping(); - temptedEntity.getNavigator().setSpeed(speed); - } - else{ - temptedEntity.getNavigator().setSpeed(0); - } - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay(){ - return temptedEntity.getRNG().nextInt(20) + 10; - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0821da0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0821da0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 52bd77a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/c0821da0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.api.ItemList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockWateredDirt extends Block { - public static final String[] imageSuffix = new String[] { "_d0", "_d1", "_d2", "_d3", "_s0", "_s1", "_s2", "_s3" }; - @SideOnly(Side.CLIENT) - private IIcon[] icons; - - public BlockWateredDirt() { - super(Material.sand); - setHardness(0.5f); - setResistance(1.0f); - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - if (par2 < 4) { - this.setStepSound(Block.soundTypeGravel); - } else { - this.setStepSound(Block.soundTypeSand); - } - return icons[par2]; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - this.icons = new IIcon[imageSuffix.length]; - for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = par1IconRegister.registerIcon(getTextureName() + imageSuffix[i]); - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - if (metadata < 3) { - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata == 3) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.dirt)); - return ret; - } - - if (metadata > 3 && metadata < 7) { - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - - if (metadata == 7) { - if (ItemList.waterDroplets.isPresent()) { - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - ret.add(new ItemStack(ItemList.waterDroplets.get())); - } - ret.add(new ItemStack(Blocks.sand)); - return ret; - } - return ret; - } - - /** - * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha - */ - @Override - @SideOnly(Side.CLIENT) - public int getRenderBlockPass() { - return 0; - } - - /** - * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two - * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. - */ - @Override - public boolean isOpaqueCube() { - return false; - } - - /** - * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) - */ - @Override - public boolean renderAsNormalBlock() { - return true; - } - - @Override - public int getRenderType() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/d16ae3a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/d16ae3a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 0b2adff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/d16ae3a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,26 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; - -import org.lwjgl.util.Point; - -public interface DataFields { - - public abstract boolean isEnabled(); - - public abstract void setIsEnabled(boolean isEnabled); - - public abstract DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize); - - public abstract void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID); - - public abstract void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner); - - public abstract boolean keyboardInput(char keyChar, int keyID); - - public abstract void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3); - - public abstract void mouseHover(int par1, int par2, int par3); - - public abstract void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/e0ca5b24c5ab00141ee9bf3050c1025b b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/e0ca5b24c5ab00141ee9bf3050c1025b new file mode 100644 index 0000000..e96e770 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f5/e0ca5b24c5ab00141ee9bf3050c1025b @@ -0,0 +1,117 @@ +package com.stek101.projectzulu.common; + +import java.io.File; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.core.CustomEntityManager; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.ChangeVanillaDrops; +import com.stek101.projectzulu.common.mobs.entitydefaults.AlligatorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ArmadilloDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.DuckEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.EagleDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ElephantDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishADeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FishBDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FollowerDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FoxDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.FrogDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiantRatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GiraffeDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GoatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GorillaDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.GreenFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RabbitDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RedFinchDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RhinoDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ProjectZulu_Mobs extends BaseModule { + private Configuration config; + private boolean bugRelease; + private boolean stickSpawn; + + @Override + public String getIdentifier() { + return DefaultProps.MobsModId; + } + + @Override + public void registration(CustomEntityManager manager) { + manager.addEntity(new ArmadilloDeclaration(), new SandwormDeclaration(), new LizardDeclaration(), + new LizardSpitDeclaration(), new PharaohDeclaration(), new MummyDeclaration(), + new VultureDeclaration(), new TreeEntDeclaration(), new MammothDeclaration(), new FoxDeclaration(), + new BoarDeclaration(), new MimicDeclaration(), new AlligatorDeclaration(), new FrogDeclaration(), + new PenguinDeclaration(), new BeaverDeclaration(), new BearBlackDeclaration(), + new BearBrownDeclaration(), new BearPolarDeclaration(), new OstrichDeclaration(), + new RhinoDeclaration(), new RabbitDeclaration(), new RedFinchDeclaration(), + new GreenFinchDeclaration(), new BlueFinchDeclaration(), new GorillaDeclaration(), + new GiraffeDeclaration(), new ElephantDeclaration(), new HorseBlackDeclaration(), + //new HorseBrownDeclaration(), new HorseDarkBlackDeclaration(), new HorseBeigeDeclaration(), + //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), + new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), + new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), + new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); + } + + @Override + public void preInit(FMLPreInitializationEvent event, File configDirectory) { + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + //displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + config.save(); + } + + @Override + public void init(FMLInitializationEvent event, File configDirectory) { + MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); + } +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/0017d29ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/0017d29ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ecaf279..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/0017d29ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,113 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityGorilla extends EntityGenericAnimal { - - public EntityGorilla(World par1World) { - super(par1World); - setSize(1.7f, 1.5f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Item.getItemFromBlock(Blocks.tallgrass), false)); - - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, true, - // IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 3; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "gorillahurt"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2D; - } - } - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.spider_eye || itemStack.getItem() == Item.getItemFromBlock(Blocks.tallgrass))) { - return true; - } - return super.isValidBreedingItem(itemStack); - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 9), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/20bdca00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/20bdca00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 25e44db..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/20bdca00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseBrown extends EntityHorseBase{ - - public EntityHorseBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/212df3a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/212df3a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5493676..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/212df3a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBiped; -import net.minecraft.entity.Entity; -import net.minecraft.util.MathHelper; - -public class ModelMummyPharaoh extends ModelBiped { - - /** - * Sets the models various rotation angles. - */ - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var7 = MathHelper.sin(this.onGround * (float) Math.PI); - float var8 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float) Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var7 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var7 * 0.6F; - this.bipedRightArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedLeftArm.rotateAngleX = -((float) Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var7 * 1.2F - var8 * 0.4F; - this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; - this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; - this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/312a20f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/312a20f5c42100141fce95f06aba7e85 deleted file mode 100644 index 2d2a6a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/312a20f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posX != 0 && piecePos.posZ == 2) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling-Floor */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - // Outide Wall Has Different 'floor' - if (piecePos.posX < 1) { - return woodenPlank; - } else { - return new BlockWithMeta(Blocks.stonebrick, 5, getStairMeta(cellIndexDirection)); - } - } - } - - /* Upper Room */ - if (slope > 0 && piecePos.posX > 1 && piecePos.posZ > 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX == 3 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && (piecePos.posX == 2 || piecePos.posZ == 3)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if ((topAarchSlope == 0 || botAarchSlope == 0) && piecePos.posX % 3 == 1 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posX > 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, - topAarchSlope == 0 ? true : false)); - } - } - - /* Outer Wall */ - if (piecePos.posX == 1 && piecePos.posZ > cellSize * 4 / 10) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Bottom Floor */ - if (piecePos.posY == 0 && piecePos.posX > 0 && piecePos.posZ > cellSize * 4 / 10) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX > 1 && piecePos.posX % 2 == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - case NorthEastCorner: - return 0; - case EastWall: - case SouthWestCorner: - return 1; - case SouthWall: - case NorthWestCorner: - return 3; - case NorthWall: - case SouthEastCorner: - default: - return 2; - } - } - - private int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return top ? 2 : 7; - case SouthWall: - case NorthWestCorner: - return top ? 3 : 6; - case WestWall: - case NorthEastCorner: - return top ? 0 : 5; - case EastWall: - case SouthWestCorner: - return top ? 1 : 4; - default: - return 0; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWall: - case SouthEastCorner: - return 3; - case SouthWall: - case NorthWestCorner: - return 2; - case WestWall: - case NorthEastCorner: - return 1; - case EastWall: - case SouthWestCorner: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallwayEnd"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/f06f0aa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/f06f0aa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ce0ed20..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f6/f06f0aa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,80 +0,0 @@ -package projectzulu.common.api; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.core.entitydeclaration.EntityProperties; - -public class CustomMobData { - public String mobName = ""; - public final HashMap customData = new HashMap(); - public int secondarySpawnRate = 100; - public boolean reportSpawningInLog = false; - public boolean shouldDespawn = true; - public int maxSpawnInChunk = 4; - public EnumCreatureType creatureType; - public EnumCreatureType spawnType; - public EntityProperties entityProperties; - - public int minDropNum = 0; - public int maxDropNum = 0; - - private List lootItems = new ArrayList(); - - public static class WeightedItemStack extends WeightedRandom.Item { - public final String itemID; - public final int itemDamage; - public final int stackSize; - - public WeightedItemStack(String itemID, int itemDamage, int stackSize, int weight) { - super(weight); - this.itemID = itemID; - this.itemDamage = itemDamage; - this.stackSize = stackSize; - } - } - - public CustomMobData(String mobName) { - this.mobName = mobName; - } - - public void addLootToMob(ItemStack itemStack, int weight) { - lootItems.add(new WeightedItemStack(Item.itemRegistry.getNameForObject(itemStack.getItem()), itemStack - .getItemDamage(), itemStack.stackSize, weight)); - } - - public void addLootToMob(String itemID, int itemDamage, int stackSize, int weight) { - lootItems.add(new WeightedItemStack(itemID, itemDamage, stackSize, weight)); - } - - public ItemStack getLootItem(Random rand) { - if (lootItems != null && !lootItems.isEmpty()) { - WeightedItemStack stack = ((WeightedItemStack) WeightedRandom.getRandomItem(rand, lootItems)); - Item item = (Item) Item.itemRegistry.getObject(stack.itemID); - if (item != null) { - return new ItemStack(item, stack.stackSize, stack.itemDamage); - } - } - return null; - } - - public Collection getLoot(Random rand, int extraDrops) { - final int numberOfItems = minDropNum + rand.nextInt(1 + maxDropNum - minDropNum + extraDrops); - List items = new ArrayList(numberOfItems); - for (int i = 0; i < numberOfItems; i++) { - ItemStack stack = getLootItem(rand); - if (stack != null) { - items.add(stack); - } - } - return items; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/1066f7f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/1066f7f7c42100141fce95f06aba7e85 deleted file mode 100644 index eb9f691..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/1066f7f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints.oasis; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithPalmTree; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPOasisTreeGrass implements Blueprint { - - BlockWithMeta sand = new BlockWithMeta(Blocks.sand); - BlockWithMeta grass = new BlockWithMeta(Blocks.grass); - BlockWithMeta sandstone = new BlockWithMeta(Blocks.sandstone); - BlockWithMeta air = new BlockWithMeta(Blocks.air); - List flowers = new ArrayList(); - - public BPOasisTreeGrass() { - flowers.add(new BlockWithMeta(Blocks.red_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.yellow_flower, 0, 1)); - flowers.add(new BlockWithMeta(Blocks.tallgrass, 1, 20)); - flowers.add(new BlockWithMeta(Blocks.air, 0, 4)); - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return sandstone; - } else if (piecePos.posY == 1) { - return sand; - } else if (piecePos.posY == 2) { - return grass; - } else if (piecePos.posY == 3) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithPalmTree(); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, flowers); - } - } - return air; - } - - @Override - public int getWeight() { - return 20; - } - - @Override - public String getIdentifier() { - return "TreeGrass"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/1175319fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/1175319fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8cc96e3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/1175319fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityVulture; -import projectzulu.common.mobs.models.ModelVulture; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/a11b2aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/a11b2aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index dacf718..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/a11b2aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; - -public class PotionHarm2 extends PotionZulu { - - public PotionHarm2(int par1, boolean par2) { - super(par1, par2, 4393481); - setIconIndex(3, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase entityLiving, int amplifier) { - if (!entityLiving.isEntityUndead()) { - entityLiving.attackEntityFrom(DamageSource.magic, amplifier * 3); - } else { - entityLiving.heal(amplifier * 3); - } - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int amplifier, - double par4) { - int damage = par4 < 0.5 ? (int) (0.5f * (amplifier * 3) + 1.0D) : (int) ((amplifier * 3) + 1.0D); - - if (!par2EntityLiving.isEntityUndead()) { - if (par1EntityLiving == null) { - par2EntityLiving.attackEntityFrom(DamageSource.magic, damage); - } else { - par2EntityLiving.attackEntityFrom( - DamageSource.causeIndirectMagicDamage(par2EntityLiving, par1EntityLiving), damage); - } - } else { - par2EntityLiving.heal(damage); - } - } - - /** - * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) - */ - @Override - public boolean isInstant() { - return true; - } - - /** - * checks if Potion effect is ready to be applied this tick. - */ - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/c19948f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/c19948f5c42100141fce95f06aba7e85 deleted file mode 100644 index bb689a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/c19948f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,159 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; - -public class ModelGorilla extends ModelBase { - ModelRenderer LEG4ROT; - ModelRenderer LEG3ROT; - ModelRenderer BODY2ROT; - private ModelRenderer BODY1ROT; - private ModelRenderer HEADROT; - private ModelRenderer LEG1TOPROT; - private ModelRenderer LEG1BOTROT; - private ModelRenderer LEG2TOPROT; - private ModelRenderer LEG2BOTROT; - private ModelRenderer BODY1OTHROT; - - public ModelGorilla() { - textureWidth = 64; - textureHeight = 64; - setTextureOffset("LEG4ROT.leg4", 38, 52); - setTextureOffset("LEG3ROT.leg3", 38, 39); - setTextureOffset("BODY2ROT.body2", 0, 22); - setTextureOffset("BODY1ROT.body1", 0, 0); - setTextureOffset("HEADROT.head", 38, 17); - setTextureOffset("HEADROT.ear1", 0, 0); - setTextureOffset("HEADROT.ear2", 0, 4); - setTextureOffset("HEADROT.nose", 47, 32); - setTextureOffset("LEG1TOPROT.leg1top", 0, 41); - setTextureOffset("LEG1BOTROT.leg1top", 0, 49); - setTextureOffset("LEG2TOPROT.leg2top", 19, 41); - setTextureOffset("LEG2BOTROT.leg2bot", 19, 49); - - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(3F, 16F, 8F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("leg4", -2F, 0F, -2F, 4, 8, 4); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-3F, 16F, 8F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("leg3", -2F, 0F, -2F, 4, 8, 4); - BODY2ROT = new ModelRenderer(this, "BODY2ROT"); - BODY2ROT.setRotationPoint(0F, 15F, 8F); - setRotation(BODY2ROT, 0F, 0F, 0F); - BODY2ROT.mirror = true; - BODY2ROT.addBox("body2", -5F, -7F, -7F, 10, 8, 10); - BODY1ROT = new ModelRenderer(this, "BODY1ROT"); - BODY1ROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1ROT, 1.178097F, 0F, 0F); - BODY1ROT.mirror = true; - BODY1ROT.addBox("body1", -6F, -15F, -3F, 12, 12, 9); - BODY2ROT.addChild(BODY1ROT); - BODY1OTHROT = new ModelRenderer(this, "BODY1OTHROT"); - BODY1OTHROT.setRotationPoint(0F, 0F, -3F); - setRotation(BODY1OTHROT, 0F, 0F, 0F); - BODY1OTHROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -8F, -12F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -7F, -3F, 7, 8, 6); - HEADROT.addBox("ear1", -4.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("ear2", 3.5F, -6F, -1F, 1, 2, 1); - HEADROT.addBox("nose", -2F, -3F, -4F, 4, 4, 1); - BODY1OTHROT.addChild(HEADROT); - LEG1TOPROT = new ModelRenderer(this, "LEG1TOPROT"); - LEG1TOPROT.setRotationPoint(-5F, -9F, -10F); - setRotation(LEG1TOPROT, 0F, 0F, 0.0174533F); - LEG1TOPROT.mirror = true; - LEG1TOPROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 8, 4); - LEG1BOTROT = new ModelRenderer(this, "LEG1BOTROT"); - LEG1BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG1BOTROT, 0F, 0F, 0F); - LEG1BOTROT.mirror = true; - LEG1BOTROT.addBox("leg1top", -2.5F, 0F, -2F, 5, 10, 4); - LEG1TOPROT.addChild(LEG1BOTROT); - BODY1OTHROT.addChild(LEG1TOPROT); - LEG2TOPROT = new ModelRenderer(this, "LEG2TOPROT"); - LEG2TOPROT.setRotationPoint(5F, -9F, -10F); - setRotation(LEG2TOPROT, 0F, 0F, 0F); - LEG2TOPROT.mirror = true; - LEG2TOPROT.addBox("leg2top", -2.5F, 0F, -2F, 5, 8, 4); - LEG2BOTROT = new ModelRenderer(this, "LEG2BOTROT"); - LEG2BOTROT.setRotationPoint(0F, 8F, 0F); - setRotation(LEG2BOTROT, 0F, 0F, 0F); - LEG2BOTROT.mirror = true; - LEG2BOTROT.addBox("leg2bot", -2.5F, 0F, -2F, 5, 10, 4); - LEG2TOPROT.addChild(LEG2BOTROT); - BODY1OTHROT.addChild(LEG2TOPROT); - BODY2ROT.addChild(BODY1OTHROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - GL11.glPopMatrix(); - } else { - LEG4ROT.render(f5); - LEG3ROT.render(f5); - BODY2ROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - /* Left Side Legs */ - LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - LEG2TOPROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -90), +90) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/d016d401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/d016d401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index d035140..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/d016d401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,130 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectPyramid; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.WalledMazeRandomizer; - -public class BuildingManagerPyramid extends BuildingManagerBase { - - int outside_height = 25; - int floor_height = 3; - - public ArchitectPyramid architect; - public Randomizer randomizer; - - List pyramidCells = new ArrayList(); - - public BuildingManagerPyramid(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectPyramid(world); - randomizer = new WalledMazeRandomizer(world); - - int xCells = 20; - int zCells = 20; - int cellSize = 2; - int cellHeight = 2 * cellSize; - int floors = (xCells > zCells ? xCells : zCells) / cellHeight + 1; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - Point numCells = new Point(xCells, zCells); - - for (int i = 0; i < floors; i++) { - if (numCells.x - i * 4 >= 2) { - pyramidCells.add(new MazeCell[numCells.x - i * 4][numCells.y - i * 4]); - } - } - - for (int i = 0; i < pyramidCells.size(); i++) { - initializeMazeCell(pyramidCells.get(i), new ChunkCoordinates(startingPos.posX + 2 * cellSize * i, - startingPos.posY + cellHeight * i, startingPos.posZ + 2 * cellSize * i), cellSize, cellHeight); - } - } - - private void initializeMazeCell(MazeCell[][] cells, ChunkCoordinates startingPos, int cellSize, int cellHeight) { - for (int i = 0; i < cells.length; i++) { - for (int j = 0; j < cells[0].length; j++) { - cells[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize * i, - startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - for (int i = 0; i < pyramidCells.size(); i++) { - markEdgesAsWalls(pyramidCells.get(i), 2); - randomizer.randomize(pyramidCells.get(i)); - } - } - - private void markEdgesAsWalls(MazeCell[][] cells, int depth) { - /* Along X */ - for (int i = 0; i < cells.length; i++) { - for (int k = 0; k < depth; k++) { - cells[i][k].rawState = 1; - } - - for (int k = cells[0].length - depth; k < cells[0].length; k++) { - cells[i][k].rawState = 1; - } - } - - /* Along Z */ - for (int k = 0; k < cells[0].length; k++) { - for (int i = 0; i < depth; i++) { - cells[i][k].rawState = 1; - } - - for (int i = cells.length - depth; i < cells.length; i++) { - cells[i][k].rawState = 1; - } - } - } - - @Override - protected void assignBlueprints(int pass, int maxPasses) { - if (pass == maxPasses) { - ProjectZuluLog.info("assignBlueprints"); - for (int i = 0; i < pyramidCells.size(); i++) { - assignBlueprints(pyramidCells.get(i), pass, maxPasses); - if (i > 0) { - architect.assignStairs(pyramidCells.get(i - 1), pyramidCells.get(i)); - } - } - } - } - - private void assignBlueprints(MazeCell[][] cells, int pass, int maxPasses) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - architect.assignBlueprint(cells, new Point(cellX, cellZ), pass, maxPasses); - } - } - } - - @Override - protected void construct() { - ProjectZuluLog.info("construct"); - for (int i = 0; i < pyramidCells.size(); i++) { - construct(pyramidCells.get(i)); - } - } - - private void construct(MazeCell[][] cells) { - for (int cellX = 0; cellX < cells.length; cellX++) { - for (int cellZ = 0; cellZ < cells[0].length; cellZ++) { - MazeCell currentCell = cells[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/d1e50ffac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/d1e50ffac42100141fce95f06aba7e85 deleted file mode 100644 index 86f1e45..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/d1e50ffac42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.blocks.ItemCoconutShell; -import com.ngb.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class CoconutShellDeclaration extends ItemDeclaration { - - public CoconutShellDeclaration() { - super("CoconutShell"); - } - - @Override - protected boolean createItem() { - ItemList.coconutShell = Optional.of(new ItemCoconutShell(false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.coconutShell.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/e26676a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/e26676a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 973398f..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/e26676a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetDoorway; -import projectzulu.common.world2.blueprint.BPSetHallway; -import projectzulu.common.world2.blueprint.BPSetHallwaySpawner; -import projectzulu.common.world2.blueprint.BPSetPyramidEdge; -import projectzulu.common.world2.blueprint.BPSetStairs; -import projectzulu.common.world2.blueprint.BPSetTreasureDeadEnd; -import projectzulu.common.world2.blueprint.BPSetWall; -import projectzulu.common.world2.blueprint.BlueprintSet; - -public class ArchitectPyramid extends ArchitectBase { - - public final BPSetStairs stairSet = new BPSetStairs(); - public final BPSetPyramidEdge edge = new BPSetPyramidEdge(); - public final BPSetDoorway door = new BPSetDoorway(); - - public ArchitectPyramid(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetWall()); - stockpile.addBlueprintSet(new BPSetTreasureDeadEnd()); - stockpile.addBlueprintSet(new BPSetHallway()); - stockpile.addBlueprintSet(new BPSetHallwaySpawner()); - stockpile.addBlueprintSet(stairSet); - stockpile.addBlueprintSet(edge); - stockpile.addBlueprintSet(door); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - /* If is Wall, use Wall Cell */ - BlueprintSet set; - if (door.isApplicable(cells, buildCoords, random)) { - set = door; - } else if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - public void assignStairs(MazeCell[][] bottomCells, MazeCell[][] topCells) { - for (int topX = 0; topX < topCells.length; topX++) { - for (int topZ = 0; topZ < topCells[0].length; topZ++) { - Point buildCoords = new Point(topX, topZ); - if (stairSet.attemptAssignBlueprint(bottomCells, topCells, buildCoords, random)) { - return; - } - } - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/f18635f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/f18635f5c42100141fce95f06aba7e85 deleted file mode 100644 index 352bfdf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f7/f18635f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,222 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -public class ModelPenguin extends ModelBase { - private ModelRenderer BODYROT; - private ModelRenderer TAILROT; - private ModelRenderer HEADROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer WINGLEFROT; - private ModelRenderer LEGLEFROT; - private ModelRenderer FOOTLEFROT; - private ModelRenderer TOELEF2ROT; - private ModelRenderer TOELEF1ROT; - private ModelRenderer TOELEF3ROT; - private ModelRenderer LEGRIGROT; - private ModelRenderer FOOTRIGROT; - private ModelRenderer TOERIG2ROT; - private ModelRenderer TOERIG1ROT; - private ModelRenderer TOERIG3ROT; - - public ModelPenguin() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 13); - setTextureOffset("BODYROT.bodydec", 37, 0); - setTextureOffset("HEADROT.head", 0, 0); - setTextureOffset("HEADROT.beaktop", 24, 0); - setTextureOffset("HEADROT.beakbot", 24, 5); - setTextureOffset("TAILROT.tail3", 50, 11); - setTextureOffset("TAILROT.tail2", 40, 11); - setTextureOffset("TAILROT.tail1", 30, 11); - setTextureOffset("WINGRIGROT.wingrig", 44, 15); - setTextureOffset("WINGLEFROT.winglef", 30, 15); - setTextureOffset("LEGLEFROT.leglef", 52, 0); - setTextureOffset("TOELEF2ROT.toelefbase2", 56, 7); - setTextureOffset("TOELEF2ROT.toelefclaw2", 60, 19); - setTextureOffset("TOELEF2ROT.toeleftop2", 58, 16); - setTextureOffset("TOELEF1ROT.toelefbase1", 56, 7); - setTextureOffset("TOELEF1ROT.toelefclaw1", 60, 19); - setTextureOffset("TOELEF1ROT.toeleftop1", 58, 16); - setTextureOffset("TOELEF3ROT.toelefbase3", 56, 7); - setTextureOffset("TOELEF3ROT.toelefclaw3", 60, 19); - setTextureOffset("TOELEF3ROT.toeleftop3", 58, 16); - setTextureOffset("LEGRIGROT.legrig", 52, 0); - setTextureOffset("TOERIG2ROT.toerigbase2", 56, 7); - setTextureOffset("TOERIG2ROT.toerigclaw2", 60, 19); - setTextureOffset("TOERIG2ROT.toerigtop2", 58, 16); - setTextureOffset("TOERIG1ROT.toerigbase1", 56, 7); - setTextureOffset("TOERIG1ROT.toerigclaw1", 60, 19); - setTextureOffset("TOERIG1ROT.toerigtop1", 58, 16); - setTextureOffset("TOERIG3ROT.toerigbase3", 56, 7); - setTextureOffset("TOERIG3ROT.toerigclaw3", 60, 19); - setTextureOffset("TOERIG3ROT.toerigtop3", 58, 16); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17F, 0F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -4.5F, -10F, -4F, 9, 13, 6); - BODYROT.addBox("bodydec", -3F, -7.5F, -5F, 6, 9, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -10F, -1.5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3F, -5F, -3F, 6, 5, 6); - HEADROT.addBox("beaktop", -1F, -2.5F, -7F, 2, 1, 4); - HEADROT.addBox("beakbot", -0.5F, -1.5F, -6F, 1, 1, 3); - BODYROT.addChild(HEADROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 0F, 3F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - // tail3.mirror = true; - TAILROT.addBox("tail3", -1F, 1F, 2F, 2, 1, 3); - // tail3.mirror = false; - TAILROT.addBox("tail2", -1.5F, 0F, 0F, 3, 2, 2); - TAILROT.addBox("tail1", -2F, -1F, -1F, 4, 3, 1); - BODYROT.addChild(TAILROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(4.5F, -10F, -1F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGRIGROT); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-4.5F, -10F, -1F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -3F, 1, 11, 6); - BODYROT.addChild(WINGLEFROT); - LEGLEFROT = new ModelRenderer(this, "LEGLEFROT"); - LEGLEFROT.setRotationPoint(-3F, 3F, -0.5F); - setRotation(LEGLEFROT, 0F, 0F, 0F); - LEGLEFROT.mirror = true; - LEGLEFROT.addBox("leglef", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTLEFROT = new ModelRenderer(this, "FOOTLEFROT"); - FOOTLEFROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTLEFROT, 0F, 0F, 0F); - FOOTLEFROT.mirror = true; - TOELEF2ROT = new ModelRenderer(this, "TOELEF2ROT"); - TOELEF2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOELEF2ROT, 0F, 0F, 0F); - TOELEF2ROT.mirror = true; - TOELEF2ROT.addBox("toelefbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF2ROT.addBox("toelefclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF2ROT.addBox("toeleftop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF2ROT); - TOELEF1ROT = new ModelRenderer(this, "TOELEF1ROT"); - TOELEF1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOELEF1ROT, 0F, 0F, 0F); - TOELEF1ROT.mirror = true; - TOELEF1ROT.addBox("toelefbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF1ROT.addBox("toelefclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF1ROT.addBox("toeleftop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF1ROT); - TOELEF3ROT = new ModelRenderer(this, "TOELEF3ROT"); - TOELEF3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOELEF3ROT, 0F, 0F, 0F); - TOELEF3ROT.mirror = true; - TOELEF3ROT.addBox("toelefbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOELEF3ROT.addBox("toelefclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOELEF3ROT.addBox("toeleftop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTLEFROT.addChild(TOELEF3ROT); - LEGLEFROT.addChild(FOOTLEFROT); - BODYROT.addChild(LEGLEFROT); - LEGRIGROT = new ModelRenderer(this, "LEGRIGROT"); - LEGRIGROT.setRotationPoint(3F, 3F, -0.5F); - setRotation(LEGRIGROT, 0F, 0F, 0F); - LEGRIGROT.mirror = true; - LEGRIGROT.addBox("legrig", -1.5F, 0F, -1.5F, 3, 4, 3); - FOOTRIGROT = new ModelRenderer(this, "FOOTRIGROT"); - FOOTRIGROT.setRotationPoint(0F, 3.5F, -1F); - setRotation(FOOTRIGROT, 0F, 0F, 0F); - FOOTRIGROT.mirror = true; - TOERIG2ROT = new ModelRenderer(this, "TOERIG2ROT"); - TOERIG2ROT.setRotationPoint(0F, 0F, -0.5F); - setRotation(TOERIG2ROT, 0F, 0F, 0F); - TOERIG2ROT.mirror = true; - TOERIG2ROT.addBox("toerigbase2", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG2ROT.addBox("toerigclaw2", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG2ROT.addBox("toerigtop2", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG2ROT); - TOERIG1ROT = new ModelRenderer(this, "TOERIG1ROT"); - TOERIG1ROT.setRotationPoint(-2F, 0F, 0F); - setRotation(TOERIG1ROT, 0F, 0F, 0F); - TOERIG1ROT.mirror = true; - TOERIG1ROT.addBox("toerigbase1", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG1ROT.addBox("toerigclaw1", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG1ROT.addBox("toerigtop1", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG1ROT); - TOERIG3ROT = new ModelRenderer(this, "TOERIG3ROT"); - TOERIG3ROT.setRotationPoint(2F, 0F, 0F); - setRotation(TOERIG3ROT, 0F, 0F, 0F); - TOERIG3ROT.mirror = true; - TOERIG3ROT.addBox("toerigbase3", -1F, -0.5F, -2F, 2, 1, 2); - TOERIG3ROT.addBox("toerigclaw3", -0.5F, -0.5F, -3F, 1, 1, 1); - TOERIG3ROT.addBox("toerigtop3", -0.5F, -1.5F, -2F, 1, 1, 2); - FOOTRIGROT.addChild(TOERIG3ROT); - LEGRIGROT.addChild(FOOTRIGROT); - BODYROT.addChild(LEGRIGROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - BODYROT.render(f5); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -20), +20) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - LEGRIGROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - - BODYROT.rotateAngleZ = MathHelper.cos(par2 * 0.6662F * 2f) * 0.1F * par3; - - TAILROT.rotateAngleX = (float) (-20 * Math.PI / 180 + (MathHelper.cos(par2 * 0.6662F * 2f) * 0.5F * par3)); - - WINGRIGROT.rotateAngleZ = -Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - WINGLEFROT.rotateAngleZ = Math.abs(MathHelper.cos(par2 * 0.6662F * 2f) * 1.0F * par3); - - TOELEF1ROT.rotateAngleY = (float) (10 * Math.PI / 180); - TOERIG3ROT.rotateAngleY = (float) (-10 * Math.PI / 180); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00e5099ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00e5099ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cdb30bc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/00e5099ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,29 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemFoodProjectZulu; -import projectzulu.common.core.itemblockdeclaration.ItemDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class WaterDropletDeclaration extends ItemDeclaration { - - public WaterDropletDeclaration() { - super("WaterDroplet"); - } - - @Override - protected boolean createItem() { - ItemList.waterDroplets = Optional.of(new ItemFoodProjectZulu(1, 0.6f, false, name.toLowerCase())); - return true; - } - - @Override - protected void registerItem() { - GameRegistry.registerItem(ItemList.waterDroplets.get(), name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/014e2df9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/014e2df9c42100141fce95f06aba7e85 deleted file mode 100644 index 204c1eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/014e2df9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,340 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumDifficulty; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.Properties; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; - -/** - * Universal AI Structure for Project Zulu Entities - * - * Entities are assumed to be functioning using the "new AI", some legacy AI is working but is not guaranteed functional - */ -public class EntityGenericAnimal extends EntityGenericTameable { - - /* Fixed Variables */ - public int maxAnimTime = 20; - public boolean forceDespawn = false; - /* Chance Entity will Flee when attacked */ - private float flightChance; - - public EntityGenericAnimal(World par1World) { - super(par1World); - experienceValue = 3; - } - - /** - * This looks to be used for Setting the default values for certain Attributes. - * - * See {@link#EntityDragon} which sets health to 200 - */ - @Override - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // Register Damage Attribute - this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); - - // Set Base values of attributes - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue( - entityEntry.modData.get().entityProperties.maxHealth); - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue( - entityEntry.modData.get().entityProperties.moveSpeed); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue( - entityEntry.modData.get().entityProperties.followRange); - this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue( - entityEntry.modData.get().entityProperties.knockbackResistance); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue( - entityEntry.modData.get().entityProperties.attackDamage); - flightChance = entityEntry.modData.get().entityProperties.flightChance; - } - } - - @Override - protected void entityInit() { - super.entityInit(); - /* Entity State */ - this.dataWatcher.addObject(20, Short.valueOf((short) 0)); - } - - protected void updateDWEntityState(EntityStates entityState) { - this.dataWatcher.updateObject(20, (short) (entityState.index)); - } - - public int getDWEntityState() { - return this.dataWatcher.getWatchableObjectShort(20); - } - - @Override - protected void updateAITasks() { - updateAIState(); - super.updateAITasks(); - if (shouldAttack) { - this.setAngerLevel(3); - } - updateDWEntityState(entityState); - } - - public void updateAIState() { - if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL && Properties.despawnInPeaceful && !isTamed()) { - this.setDead(); - } - /* AI Updates are done Before UpdateTasks such that some states can be manually triggered */ - if (fleeingTick > 0) { - entityState = EntityStates.fleeing; - } else if (loveTimer > 0) { - entityState = EntityStates.inLove; - } else if (angerLevel > 0 && (getAttackTarget() != null || getAITarget() != null)) { - entityState = EntityStates.attacking; - } else if (angerLevel > 0) { - entityState = EntityStates.looking; - } else if (isSitting()) { - entityState = EntityStates.sitting; // TODO add Check that if Player doesn't Exists, it should Sit. Should I - // do this? I'm Favoring Not. - } else if (shouldFollow) { - entityState = EntityStates.following; - } else { - entityState = EntityStates.idle; - } - } - - @Override - public void onLivingUpdate() { - // rotationYaw = rotationYawHead; - super.onLivingUpdate(); - animTime = Math.max(animTime - 1, 0); - entityState = EntityStates.getEntityByIndex(getDWEntityState()); - } - - @Override - protected boolean canDespawn() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && !isTamed()) { - return forceDespawn || entityEntry.modData.get().shouldDespawn; - } else { - return super.canDespawn(); - } - } - - @Override - public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (forSpawnCount && entityEntry != null) { - return entityEntry.modData.get().spawnType != null ? entityEntry.modData.get().spawnType.equals(type) - : false; - } else if (entityEntry != null) { - return entityEntry.modData.get().creatureType != null ? entityEntry.modData.get().creatureType.equals(type) - : super.isCreatureType(type, forSpawnCount); - } else { - return super.isCreatureType(type, forSpawnCount); - } - } - - @Override - public boolean attackEntityAsMob(Entity targetEntity) { - if (targetEntity.boundingBox.maxY > this.boundingBox.minY - && targetEntity.boundingBox.minY < this.boundingBox.maxY) { - animTime = maxAnimTime; - if (!worldObj.isRemote) { - PZPacket packet = new PacketAnimTime().setPacketData(getEntityId(), animTime); - ProjectZulu_Core.getPipeline() - .sendToAllAround(packet, new TargetPoint(dimension, posX, posY, posZ, 30)); - } - - float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int knockbackScale = 0; - - if (targetEntity instanceof EntityLivingBase) { - damage += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase) targetEntity); - knockbackScale += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase) targetEntity); - } - - boolean attackedSucceded = targetEntity.attackEntityFrom(DamageSource.causeMobDamage(this), damage); - - if (attackedSucceded) { - if (knockbackScale > 0) { - targetEntity.addVelocity((double) (-MathHelper.sin(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * (float) Math.PI / 180.0F) - * (float) knockbackScale * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int fireScale = EnchantmentHelper.getFireAspectModifier(this); - - if (fireScale > 0) { - targetEntity.setFire(fireScale * 4); - } - - if (targetEntity instanceof EntityLivingBase) { - EnchantmentHelper.func_151384_a((EntityLivingBase)targetEntity, this); - } - EnchantmentHelper.func_151385_b(this, targetEntity); - - } - return attackedSucceded && super.attackEntityAsMob(targetEntity); - } - return false; - } - - @Override - public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - if (super.attackEntityFrom(par1DamageSource, par2)) { - if (par1DamageSource.getEntity() != null && par1DamageSource.getEntity() instanceof EntityPlayer) { - EntityPlayer attackingPlayer = (EntityPlayer) par1DamageSource.getEntity(); - - if (shouldNotifySimilar(attackingPlayer)) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, - this.boundingBox.expand(20.0D, 20.0D, 20.0D)); - Iterator nearbyEntityIterator = var4.iterator(); - - while (nearbyEntityIterator.hasNext()) { - Entity nearbyEntity = (Entity) nearbyEntityIterator.next(); - if (nearbyEntity.getClass().equals(this.getClass())) { - EntityGenericAnimal nearbyAlly = (EntityGenericAnimal) nearbyEntity; - nearbyAlly.entityAttackedReaction(attackingPlayer); - } - } - } - entityAttackedReaction(attackingPlayer); - return true; - } - } - return false; - } - - protected void entityAttackedReaction(EntityPlayer attackingPlayer) { - if (this.isTamed()) { - - } else { - if (shouldPanic()) { - setFleeTick(80); - } else { - setAngerLevel(400); - } - } - } - - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return false; - } - - /** - * Function that determines if the Fight/Flight reaction of the animal on attack - */ - protected boolean shouldPanic() { - return !(worldObj.rand.nextFloat() * 100 >= flightChance); - } - - @Override - protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - if (isTamed()) { - return 0; - } else { - if (this instanceof IMob || getEntityState() == EntityStates.attacking - || getEntityState() == EntityStates.looking) { - return 5; - } else { - return rand.nextInt(2) + 1; - } - } - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int xCoord = MathHelper.floor_double(this.posX); - int yCoord = MathHelper.floor_double(this.boundingBox.minY); - int zCoord = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity == null) { - ProjectZuluLog - .severe("Entity %s is Trying to Spawn but does not exist in the CustomEntityList. It will not spawn, please report this to Modder.", - this.getClass().toString()); - return false; - } - - if (customEntity.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && isValidLightLevel(worldObj, xCoord, yCoord, zCoord) - && isValidLocation(worldObj, xCoord, yCoord, zCoord)) { - wasSuccesful = true; - } - - if (customEntity.modData.get().reportSpawningInLog) { - if (wasSuccesful) { - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(), xCoord, yCoord, - zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } else { - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable", - getCommandSenderName(), xCoord, yCoord, zCoord, worldObj.getBiomeGenForCoords(xCoord, zCoord)); - } - } - return wasSuccesful; - } - - protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; - } - - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return true; - } - - /** - * Drop 0-2 items of this living's type - */ - @Override - protected void dropFewItems(boolean par1, int par2) { - CustomEntityList customEntity = CustomEntityList.getByEntity(this); - if (customEntity != null) { - Collection loot = customEntity.modData.get().getLoot(rand, par2); - Iterator lootIterator = loot.iterator(); - while (lootIterator.hasNext()) { - ItemStack itemStack = lootIterator.next(); - if (itemStack != null) { - entityDropItem(itemStack, 1); - } - } - } - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setBoolean("ForceDespawn", forceDespawn); - - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - forceDespawn = par1nbtTagCompound.getBoolean("ForceDespawn"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/11112cf5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/11112cf5c42100141fce95f06aba7e85 deleted file mode 100644 index 2b12be2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/11112cf5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,34 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; -//package com.ngb.projectzulu.common.mobs; -// -//import net.minecraft.src.Entity; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.MathHelper; -//import net.minecraft.src.ModelBase; -//import net.minecraft.src.ModelRenderer; -// -//public class ModelZulu extends ModelBase -//{ -// -// public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.render(entity, f, f1, f2, f3, f4, f5); -// setRotationAngles(f, f1, f2, f3, f4, f5); -// if(this.isChild){ -// HEADROT.render(f5); -// BODYROT.render(f5); -// } -// -// } -// public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) -// { -// super.setRotationAngles(f, f1, f2, f3, f4, f5); -// } -// -// -// -// @Override -// public void setLivingAnimations(EntityLiving par1EntityLiving, float par2, float par3, float par4) { -// super.setLivingAnimations(par1EntityLiving, par2, par3, par4); -// } -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/21ddbaf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/21ddbaf8c42100141fce95f06aba7e85 deleted file mode 100644 index 3c26f4d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/21ddbaf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,15 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.entity.Entity; - -public class ModelBrownBear extends ModelBear { - - public ModelBrownBear() { - super(7); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, 1.4f * f5); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/30ee12e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/30ee12e4c42100141fce95f06aba7e85 deleted file mode 100644 index 37275a0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/30ee12e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,166 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelBirdHead extends ModelBase{ - ModelRenderer Body; - ModelRenderer wingrig; - ModelRenderer winglef; - ModelRenderer tail; - ModelRenderer LEGRIGTOPROT; - ModelRenderer LEGLEFTOPROT; - ModelRenderer HEADROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer BEAKROT; - private ModelRenderer BODY; - private ModelRenderer WINGLEFROT; - private ModelRenderer WINGRIGROT; - private ModelRenderer TAILROT; - - public ModelBirdHead(){ - textureWidth = 32; - textureHeight = 32; - setTextureOffset("BODY.Body", 0, 0); - setTextureOffset("WINGLEFROT.winglef", 22, 0); - setTextureOffset("WINGRIGROT.wingrig", 13, 0); - setTextureOffset("TAILROT.tail", 14, 8); - setTextureOffset("HEADROT.Head", 0, 7); - setTextureOffset("BEAKROT.beak", 9, 9); - setTextureOffset("LEGLEFTOPROT.legtoplef", 3, 12); - setTextureOffset("LEGLEFBOTROT.legbotlef", 7, 15); - setTextureOffset("LEGRIGTOPROT.lefrigtop", 0, 12); - setTextureOffset("LEGRIGBOTROT.legbotrig", 0, 15); - - BODY = new ModelRenderer(this, "BODY"); - BODY.setRotationPoint(0F, 21F, 0F); - setRotation(BODY, 0F, 0F, 0F); - BODY.mirror = true; - BODY.addBox("Body", -1F, -1F, -2F, 2, 2, 4); - WINGLEFROT = new ModelRenderer(this, "WINGLEFROT"); - WINGLEFROT.setRotationPoint(-1F, -0.7F, 0F); - setRotation(WINGLEFROT, 0F, 0F, 0F); - WINGLEFROT.mirror = true; - WINGLEFROT.addBox("winglef", -1F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGLEFROT); - WINGRIGROT = new ModelRenderer(this, "WINGRIGROT"); - WINGRIGROT.setRotationPoint(1F, -0.7F, 0F); - setRotation(WINGRIGROT, 0F, 0F, 0F); - WINGRIGROT.mirror = true; - WINGRIGROT.addBox("wingrig", 0F, 0F, -1.5F, 1, 1, 3); - BODY.addChild(WINGRIGROT); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -0.2F, 1F); - setRotation(TAILROT, 0.3346145F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("tail", -0.4666667F, 0F, 0F, 1, 0, 3); - BODY.addChild(TAILROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1.2F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -1F, -1F, -1F, 2, 2, 2); - BEAKROT = new ModelRenderer(this, "BEAKROT"); - BEAKROT.setRotationPoint(0F, 0F, 0F); - setRotation(BEAKROT, -0.7801622F, 0F, 0F); - BEAKROT.mirror = true; - BEAKROT.addBox("beak", -0.5333334F, 0.3F, -0.9F, 1, 1, 1); - HEADROT.addChild(BEAKROT); - BODY.addChild(HEADROT); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-0.5F, 1.3F, 1F); - setRotation(LEGLEFTOPROT, -0.6702064F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legtoplef", -0.5F, 0F, 0F, 1, 2, 0); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0.6702064F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("legbotlef", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODY.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(0.5F, 1.3F, 1F); - setRotation(LEGRIGTOPROT, -0.6684611F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("lefrigtop", -0.5F, 0F, 0F, 1, 2, 0); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0.6702064F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legbotrig", -0.5F, -0.4F, -2.3F, 1, 0, 2); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODY.addChild(LEGRIGTOPROT); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5){ - // super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - // float field_78145_g = 8.0F; - // float field_78151_h = 4.0F; - // - // if (this.isChild){ - // float var8 = 2.0F; - // GL11.glPushMatrix(); - // GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - // HEADROT.render(f5); - // GL11.glPopMatrix(); - // GL11.glPushMatrix(); - // GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - // GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - // Body.render(f5); - // Body.render(f5); - // wingrig.render(f5); - // winglef.render(f5); - // tail.render(f5); - // LEGRIGTOPROT.render(f5); - // LEGLEFTOPROT.render(f5); - // GL11.glPopMatrix(); - // }else{ -// Body.render(f5); -// wingrig.render(f5); -// winglef.render(f5); -// tail.render(f5); -// LEGRIGTOPROT.render(f5); -// LEGLEFTOPROT.render(f5); -// HEADROT.render(f5); - BODY.render(f5); - // } - // - } - - public void renderHead(float f5){ - Body.render(f5); - wingrig.render(f5); - winglef.render(f5); - tail.render(f5); - LEGRIGTOPROT.render(f5); - LEGLEFTOPROT.render(f5); - HEADROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) - { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - BODY.rotateAngleY = f3 / (180F / (float)Math.PI); - -// Body.rotateAngleY = f3 / (180F / (float)Math.PI); -// wingrig.rotateAngleY = f3 / (180F / (float)Math.PI); -// winglef.rotateAngleY = f3 / (180F / (float)Math.PI); -// tail.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGRIGTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// LEGLEFTOPROT.rotateAngleY = f3 / (180F / (float)Math.PI); -// HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/30fc54a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/30fc54a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 697fbaf..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/30fc54a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,245 +0,0 @@ -//package projectzulu.common.temperature; -// -//import java.util.EnumSet; -// -//import net.minecraft.client.Minecraft; -//import net.minecraft.client.gui.FontRenderer; -//import net.minecraft.client.gui.ScaledResolution; -//import net.minecraft.client.renderer.Tessellator; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.src.ModLoader; -//import net.minecraft.util.MathHelper; -// -//import org.lwjgl.opengl.GL11; -// -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class DisplayTemperatureTicker implements ITickHandler{ -// -// protected float zLevel = 10.0F; -// public static long inGameTicks = 0; -// private float playerTemp = 0; -// private float enviroTemp = 0; -// @Override -// public void tickStart(EnumSet type, Object... tickData) {} -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// -// /* Handle Display of Temperature on Client, TickType = Render*/ -// if(ModLoader.getMinecraftInstance().thePlayer != null){ -// -// Minecraft mc = ModLoader.getMinecraftInstance(); -// EntityPlayer player = ModLoader.getMinecraftInstance().thePlayer; -// -// FontRenderer var2 = mc.fontRenderer; -// ScaledResolution var3 = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); -// String textureLocation = "/mods/icons/temperature_icon.png"; -// int scalewidth = var3.getScaledWidth(); -// int scaleHeight = var3.getScaledHeight(); -// -// if( TemperatureTicker.getPlayerTemperature(player) != null && inGameTicks % 80 == 0){ -// playerTemp = TemperatureTicker.getPlayerTemperature(player); -// } -// if(TemperatureTicker.getPlayerLocTemperature(player) != null && inGameTicks % 80 == 0){ -// enviroTemp = TemperatureTicker.getPlayerLocTemperature(player); -// } -// int playerTempIconValue = (int) mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120); -// int playerTempHumanReadable = 80 - playerTempIconValue; -// int verticalOffsetFromTopY = 120; -// int horizontalOffsetFromRightX = 0; -// int iconXCoord = 0; -// int iconYCoord = 0; -// -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture( textureLocation )); -// -// scalewidth = 0; -// scaleHeight = scaleHeight/2; -// horizontalOffsetFromRightX = -(26+10); -// verticalOffsetFromTopY -= 50; -// if( (120 - playerTempIconValue) < 20){ -// /* Draw Very Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 150; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// -// }else if( (120 - playerTempIconValue) < 30 ){ -// /* Draw Medium Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 125; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// /* Draw Ice Overlay */ -// if(mc.currentScreen == null){ -// scalewidth = var3.getScaledWidth(); -// scaleHeight = var3.getScaledHeight(); -// GL11.glDisable(GL11.GL_DEPTH_TEST); -// GL11.glDepthMask(false); -// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// GL11.glDisable(GL11.GL_ALPHA_TEST); -// GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/mods/icons/IceBlur2.png")); -// Tessellator tessellator = Tessellator.instance; -// tessellator.startDrawingQuads(); -// tessellator.addVertexWithUV(0.0D, (double)scaleHeight, -90.0D, 0.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, (double)scaleHeight, -90.0D, 1.0D, 1.0D); -// tessellator.addVertexWithUV((double)scalewidth, 0.0D, -90.0D, 1.0D, 0.0D); -// tessellator.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); -// tessellator.draw(); -// GL11.glDepthMask(true); -// GL11.glEnable(GL11.GL_DEPTH_TEST); -// GL11.glEnable(GL11.GL_ALPHA_TEST); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// } -// -// }else if ( (120 - playerTempIconValue) < 40 ){ -// /* Draw Little Cold */ -// /* Draw Blue Frame */ -// iconXCoord = 100; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Blue Inside */ -// iconXCoord = 175; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 100 ){ -// /* Draw High Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 50; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 90 ){ -// /* Draw Medium Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 25; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else if( (120 - playerTempIconValue) > 80 ){ -// /* Draw Little Heat */ -// /* Draw Fire Frame */ -// iconXCoord = 0; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY), iconXCoord, iconYCoord, 25, 120); -// -// /* Draw Fire Red Inside */ -// iconXCoord = 75; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// -// }else{ -// /* Draw Frame */ -// iconXCoord = 0; -// iconYCoord = 0; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-12), iconXCoord, iconYCoord, 15, 105); -// -// /* Draw Red Inside */ -// iconXCoord = 200; -// iconYCoord = 105; -// this.drawTexturedModalRect(scalewidth-(16+horizontalOffsetFromRightX+10), scaleHeight-(8+verticalOffsetFromTopY-playerTempIconValue), iconXCoord, iconYCoord+playerTempIconValue, 25, 120-playerTempIconValue); -// } -// -// /* Draw Marker */ -// iconXCoord = 30; -// iconYCoord = 94; -// int playerLocTemp = MathHelper.floor_float((mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120)) ); -// playerLocTemp = playerLocTemp > 116 ? 116 : playerLocTemp < 14 ? 14 : playerLocTemp; -// -// this.drawTexturedModalRect(scalewidth-(14+horizontalOffsetFromRightX+0), scaleHeight-(8+verticalOffsetFromTopY-playerLocTemp+4), iconXCoord, iconYCoord, 4, 8); -// scalewidth = var3.getScaledWidth(); -// horizontalOffsetFromRightX = 0; -// -// -// -// -// /* Write Temp String TO Top Of Screen, Mostly For Debugging For Now*/ -// byte var8 = 12; -// String var9 = "Current Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(playerTemp, 3.5f, -2.5f, 0, 120))); -// String var10 = "Max Temp: ".concat(Float.toString(120- mapValueofSet1ToSet2(enviroTemp, 3.5f, -2.5f, 0, 120))); -// -//// var2.drawStringWithShadow(var10, scalewidth / 2 - var2.getStringWidth(var10) / 2, var8 - 10, 16711935); -//// var2.drawStringWithShadow(var9, scalewidth / 2 - var2.getStringWidth(var9) / 2, var8 + 10, 16711935); -// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -// -// inGameTicks++; -// } -// -// } -// -// private void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6){ -// float var7 = 0.00390625F; -// float var8 = 0.00390625F; -// -// Tessellator var9 = Tessellator.instance; -// var9.startDrawingQuads(); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -// var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -// var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); -// var9.draw(); -// } -// -// private float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of( TickType.RENDER); } -// -// @Override -// public String getLabel() { -// return null; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/319d5ba0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/319d5ba0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 628bb47..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/319d5ba0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSlab; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockZuluSlab; -import projectzulu.common.blocks.ItemZuluSlab; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSlabDeclaration extends BlockDeclaration { - - public PalmTreeSlabDeclaration() { - super("PalmTreeSlab", 1); - } - - @Override - protected boolean createBlock() { - if (BlockList.palmTreePlank.isPresent()) { - BlockList.palmTreeSlab = Optional.of((new BlockZuluSlab(BlockList.palmTreePlank.get())).setBlockName( - name.toLowerCase()).setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - return false; - } - - @Override - protected void registerBlock() { - if (BlockList.palmTreeDoubleSlab.isPresent() && BlockList.palmTreeSlab.isPresent()) { - Block block = BlockList.palmTreeSlab.get(); - ItemZuluSlab.initialise((BlockSlab) BlockList.palmTreeSlab.get(), - (BlockSlab) BlockList.palmTreeDoubleSlab.get()); - GameRegistry.registerBlock(block, ItemZuluSlab.class, name.toLowerCase()); - OreDictionary.registerOre("slabWood", new ItemStack(block)); - OreDictionary.registerOre("slabPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/70d4da9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/70d4da9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index da42b04..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/70d4da9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,240 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetPyramidEdge implements BlueprintSet { - - final OuterEdge outerWall = new OuterEdge(); - final InnerEdge innerWall = new InnerEdge(); - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - String buildName = getIdentifier(); - if (buildCoords.x == 0 || buildCoords.y == 0 || buildCoords.x == cells.length - 1 - || buildCoords.y == cells[0].length - 1) { - buildName = buildName.concat("-").concat(outerWall.getIdentifier()); - } else { - buildName = buildName.concat("-").concat(innerWall.getIdentifier()); - } - - cells[buildCoords.x][buildCoords.y].setBuildingProperties(buildName, getDirection(cells, buildCoords)); - cells[buildCoords.x][buildCoords.y].rawState = -1; - return true; - } - - private CellIndexDirection getDirection(MazeCell[][] cells, Point buildCoords) { - if (buildCoords.x == 0 && buildCoords.y == 0 || buildCoords.x == 1 && buildCoords.y == 1) { - return CellIndexDirection.NorthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == 0 || buildCoords.x == cells.length - 2 - && buildCoords.y == 1) { - return CellIndexDirection.NorthEastCorner; - } else if (buildCoords.x == 0 && buildCoords.y == cells[0].length - 1 || buildCoords.x == 1 - && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWestCorner; - } else if (buildCoords.x == cells.length - 1 && buildCoords.y == cells[0].length - 1 - || buildCoords.x == cells.length - 2 && buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthEastCorner; - } - - if (buildCoords.x == 0) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 1) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 0) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 1) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x == 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x == cells.length - 2) { - return CellIndexDirection.EastWall; - } else if (buildCoords.y == 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y == cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - - if (buildCoords.x <= 1) { - return CellIndexDirection.WestWall; - } else if (buildCoords.x >= cells.length - 2) { - return CellIndexDirection.EastWall; - } - - if (buildCoords.y <= 1) { - return CellIndexDirection.NorthWall; - } else if (buildCoords.y >= cells[0].length - 2) { - return CellIndexDirection.SouthWall; - } - return null; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - String blueprintID = buildingID.split("-")[1]; - if (blueprintID.equals(outerWall.getIdentifier())) { - return outerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } else if (blueprintID.equals(innerWall.getIdentifier())) { - return innerWall.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - throw new IllegalArgumentException("Blueprint ID parsed from " + buildingID + " does not exist."); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.x <= 1 || buildCoords.y <= 1 || buildCoords.x >= cells.length - 2 - || buildCoords.y >= cells[0].length - 2) { - return cells[buildCoords.x][buildCoords.y].rawState >= 0; - } - return false; - } - - @Override - public String getIdentifier() { - return "PyramidEdge"; - } - - @Override - public int getWeight() { - return 0; - } - - private class OuterEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 0; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "OuterWall"; - } - } - - private class InnerEdge implements Blueprint { - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - Random random, CellIndexDirection cellIndexDirection) { - int index = 1; - if (cellIndexDirection.isCorner()) { - int posX = piecePos.posX; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.SouthWestCorner) { - posX = (cellSize - 1) - piecePos.posX; - } - - int posZ = piecePos.posZ; - if (cellIndexDirection != CellIndexDirection.NorthWestCorner - && cellIndexDirection != CellIndexDirection.NorthEastCorner) { - posZ = (cellSize - 1) - piecePos.posZ; - } - - if (piecePos.posY > posZ + index * cellSize || piecePos.posY > posX + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == posZ + index * cellSize || piecePos.posY == posX + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } else { - int pos = -1; - switch (cellIndexDirection) { - case NorthWall: - pos = piecePos.posZ; - break; - case SouthWall: - pos = (cellSize - 1) - piecePos.posZ; - break; - case WestWall: - pos = piecePos.posX; - break; - case EastWall: - pos = (cellSize - 1) - piecePos.posX; - break; - default: - pos = -1; - break; - } - - if (pos > -1) { - if (piecePos.posY > pos + index * cellSize) { - return new BlockWithMeta(Blocks.air); - } else if (piecePos.posY == pos + index * cellSize) { - return new BlockWithMeta(Blocks.sandstone); - } - } - } - return new BlockWithMeta(Blocks.sandstone); - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String getIdentifier() { - return "InnerWall"; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/8037ebf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/8037ebf4c42100141fce95f06aba7e85 deleted file mode 100644 index 71a9aa4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/8037ebf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,123 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -/** - * Helper Classes to Parse Generic Potion properties form damage. - * - * Note the only damage values Guaranteed to work for any given SubItemPotion is subID and Splash. Any other bits are up - * to individual subItem to parse and may not conform to standard. - */ -public class PotionParser { - - public static int readID(int value) { - byte lowByte = (byte) (value & getLeastBitMask(4)); - return lowByte & 0xFF; - } - - public static int setID(int iD, int value) { - if (iD < 0 || iD > 15) { - iD = iD < 0 ? 0 : 15; - } - return setBitRange(value, iD, 0, 4); - } - - public static int readLevel(int value) { - byte lowByte = (byte) ((value >> 4) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setLevel(int level, int value) { - if (level < 0 || level > 3) { - level = level < 0 ? 0 : 3; - } - return setBitRange(value, level, 4, 2); - } - - public static int readPower(int value) { - byte lowByte = (byte) ((value >> 6) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setPower(int power, int value) { - if (power < 0 || power > 3) { - power = power < 0 ? 0 : 3; - } - return setBitRange(value, power, 6, 2); - } - - public static int readDuration(int value) { - byte lowByte = (byte) ((value >> 8) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setDuration(int duration, int value) { - if (duration < 0 || duration > 3) { - duration = duration < 0 ? 0 : 3; - } - return setBitRange(value, duration, 8, 2); - } - - public static int readContainer(int value) { - byte lowByte = (byte) ((value >> 10) & getLeastBitMask(2)); - return lowByte & 0xFF; - } - - public static int setContainer(int container, int value) { - if (container < 0 || container > 3) { - container = container < 0 ? 0 : 3; - } - return setBitRange(value, container, 10, 2); - } - - public static boolean isSplash(int value) { - return isBitSet(value, 14); - } - - public static int setSplash(int value) { - return setBit(value, 14); - } - - /** - * Sets Range of Bits in origValue to bits in ValueToSet starting from staringBitToSet for bitsToSet number of bits - * - * @param origValue - * @param valueToSet - * @param startingBitToSet - * @param bitsToSet - * @return - */ - private static int setBitRange(int origValue, int valueToSet, int startingBitToSet, int bitsToSet) { - for (int i = 0; i < bitsToSet; i++) { - if (isBitSet(origValue, startingBitToSet + i) == !isBitSet(valueToSet, i)) { - origValue = flipBit(origValue, startingBitToSet + i); - } - } - return origValue; - } - - private static boolean isBitSet(int value, int index) { - return (value & (1L << index)) != 0; - } - - private static int setBit(int value, int index) { - return value | (1 << index); - } - - private static int unSetBit(int value, int index) { - return value & ~(1 << index); - } - - private static int flipBit(int value, int index) { - return value ^ (1 << index); - } - - /** - * Returns a Mask to be & with a value to get the specified number of least significant bits - * - * @param value - * @param numBits Number of Least Significant bits desired - * @return - */ - private static int getLeastBitMask(int numBits) { - return ((1 << numBits) - 1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/90a213a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/90a213a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 48d5627..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/90a213a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserDespawnAge extends KeyParserBase { - - public KeyParserDespawnAge(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseDespawnAge(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b2d6bea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b2d6bea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index afea021..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/b2d6bea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseGrey; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c0477201c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c0477201c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9c1304e..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c0477201c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,143 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -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.ItemPotion; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.potion.subitem.SubItemPotion; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemPZPotion extends ItemPotion { - - @SideOnly(Side.CLIENT) - private IIcon splashIcon; - @SideOnly(Side.CLIENT) - private IIcon regularIcon; - @SideOnly(Side.CLIENT) - private IIcon contentIcon; - - public ItemPZPotion(String name) { - super(); - setCreativeTab(ProjectZulu_Core.projectZuluPotionTab); - setMaxStackSize(3); - setUnlocalizedName(DefaultProps.blockKey + ":" + name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - /** - * Gets an icon index based on an item's damage value - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) { - return isSplash(par1) ? splashIcon : regularIcon; - } - - @Override - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value and the given render pass - */ - public IIcon getIconFromDamageForRenderPass(int par1, int par2) { - return par2 == 0 ? contentIcon : getIconFromDamage(par1); - } - - // TODO: Get Rid Staticness and Check if it can be safely used instead of ItemPotion static isSplash - public static boolean isSplash(int par0) { - return PotionParser.isSplash(par0); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean isEffectInstant(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.isEffectInstant(damageMeta) : false; - } - - @Override - public String getItemStackDisplayName(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getDisplayName(itemStack) : "Unknown Concoction"; - } - - @Override - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onEaten(itemStack, world, player) : super.onEaten(itemStack, world, player); - } - - @Override - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.onItemRightClick(itemStack, world, player) : super.onItemRightClick(itemStack, - world, player); - } - - @Override - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - if (potion != null) { - potion.addInformation(itemStack, player, list, par4); - } else { - super.addInformation(itemStack, player, list, par4); - } - } - - @Override - public List getEffects(int damageMeta) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(this, PotionParser.readID(damageMeta)); - return potion != null ? potion.getPotionEffects(damageMeta) : Collections. emptyList(); - } - - @Override - public List getEffects(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.getPotionEffects(itemStack) : Collections. emptyList(); - } - - @Override - @SideOnly(Side.CLIENT) - public boolean hasEffect(ItemStack itemStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(itemStack); - return potion != null ? potion.hasPotionEffects(itemStack) : false; - } - - /** - * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) - */ - @Override - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs creativeTabs, List list) { - Collection potion = SubItemPotionRegistry.INSTANCE.getPotions(item); - for (SubItemPotion subItemPotion : potion) { - subItemPotion.getSubItems(item, creativeTabs, list); - } - } - - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - SubItemPotion potion = SubItemPotionRegistry.INSTANCE.getPotion(brewingStack); - return potion != null ? potion.getPotionResult(ingredient, brewingStack) : null; - } - - @Override - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconRegister) { - this.regularIcon = iconRegister.registerIcon("potion_bottle_drinkable"); - this.splashIcon = iconRegister.registerIcon("potion_bottle_splash"); - this.contentIcon = iconRegister.registerIcon("potion_overlay"); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c06e39ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c06e39ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 1b532f4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c06e39ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,164 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.blocks.CreeperBlossomPrimedDefault; -import projectzulu.common.blocks.FurPeltDeclaration; -import projectzulu.common.blocks.ItemBlockRecipeManager; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AloeVeraSeedsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.AnkhDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BlueClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandSingleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.BrewingStandTripleDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CactusArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CampfireDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutItem; -import projectzulu.common.blocks.itemblockdeclarations.CoconutMilkFragmentDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutSeedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CoconutShellDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.CreeperBlossomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.DiamondScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.FurArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GenericCraftingItemsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GoldScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.GreenClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.IronScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.JasperDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.MobSkullsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.NightBloomDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeDoubleSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLeavesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeLogDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreePlankDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSapling; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeSlabDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.PalmTreeStairsDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.QuickSandDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.RedClothArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleArmorDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WaterDropletDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WateredDirtDeclaration; -import projectzulu.common.blocks.itemblockdeclarations.WhiteClothArmorDeclaration; -import projectzulu.common.blocks.terrain.AloeVeraFeature; -import projectzulu.common.blocks.terrain.CreeperBlossomFeature; -import projectzulu.common.blocks.terrain.NightBloomFeature; -import projectzulu.common.blocks.terrain.PalmTreeFeature; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.dungeon.PotionEvents; -import projectzulu.common.potion.EventHandleNullPotions; -import projectzulu.common.potion.PZExtraPotionDeclaration; -import projectzulu.common.potion.PZVanillaPotionDeclaration; -import projectzulu.common.potion.PotionManager; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_Blocks extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.BlocksModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new PZExtraPotionDeclaration(), new PZVanillaPotionDeclaration()); - - manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), - new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), - new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), - new PalmTreeLeavesDeclaration(), new PalmTreeSapling(), new CoconutDeclaration(), - new QuickSandDeclaration(), new NightBloomDeclaration(), new CreeperBlossomDeclaration(), - new SpikesDeclaration(), new CampfireDeclaration(), new MobSkullsDeclaration(), - new TombstoneDeclaration(), new UniversalFlowerPotDeclaration(), new BrewingStandSingleDeclaration(), - new BrewingStandTripleDeclaration()); - - manager.addItemBlock(new AnkhDeclaration(), new AloeVeraSeedsDeclaration(), new WaterDropletDeclaration(), - new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), - new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), - new CoconutItem(), new ScrapMeatDeclaration()); - - manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), - new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), - new IronScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("ironscale")), - new DiamondScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("diamondscale")), new WhiteClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("whitedesertcloth")), new RedClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("reddesertcloth")), new GreenClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("greendesertcloth")), new BlueClothArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("bluedesertcloth")), new CactusArmorDeclaration( - ProjectZulu_Core.proxy.addArmor("cactusarmor")), - new FurArmorDeclaration(ProjectZulu_Core.proxy.addArmor("mammothfur"))); - } - - @Override - public void registration(CustomEntityManager manager) { - manager.addEntity(new CreeperBlossomPrimedDefault()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new AloeVeraFeature(), new CreeperBlossomFeature(), new NightBloomFeature(), - new PalmTreeFeature()); - } - - @Override - public void preInit(FMLPreInitializationEvent event, File configDirectory) { - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - zuluConfig.load(); - ProjectZuluLog.info("Starting Potion Init "); - PotionManager.loadSettings(zuluConfig); - ProjectZuluLog.info("Finsished Potion Init "); - zuluConfig.save(); - } - - @Override - public void postInit(FMLPostInitializationEvent event, File configDirectory) { - ItemBlockRecipeManager.setupBlockModuleRecipies(); - - if (!PotionManager.potionModuleEnabled) { - ProjectZuluLog.info("Skipping Potion Setup, Potion Module Disabled"); - } else { - ProjectZuluLog.info("Starting Potion Setup "); - PotionManager.setupAndRegisterPotions(); - MinecraftForge.EVENT_BUS.register(new PotionEvents()); - ProjectZuluLog.info("Finsished Potion Setup "); - } - - /* Turn on NullPotionHandler */ - if (PotionManager.enableNullPotionHandler) { - MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); - } - } - - @Override - public void serverStarting(FMLServerStartingEvent event, File configDirectory) { - /* Add Custom GameRules */ - GameRules gameRule = event.getServer().worldServerForDimension(0).getGameRules(); - /* Add Does Campfire Burn GameRule: Only if not Present */ - String ruleName = "doesCampfireBurn"; - if (!gameRule.hasRule(ruleName)) { - gameRule.addGameRule(ruleName, "false"); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c0f31fa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c0f31fa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 8de057b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/c0f31fa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,12 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockStairs; -import net.minecraft.init.Blocks; - -public class BlockZuluStairs extends BlockStairs { - public BlockZuluStairs(Block par2Block, int par3) { - super(par2Block, par3); - setLightOpacity(0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/d19ae79ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/d19ae79ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index bec4df7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/d19ae79ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,112 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityPelican extends EntityGenericAnimal { - - public EntityPelican(World par1World) { - super(par1World); - this.setSize(1.5f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 15; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false, 2f * 2f)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - this.tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "pelicanhurt"; - } - - @Override - protected void updateAITasks() { - - /* Handle Landing */ - if (!isEntityGrounded() && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && rand.nextInt(200) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 1)); - } - - /* Handle Takeoff */ - if (isEntityGrounded() && rand.nextInt(800) == 0 && !worldObj.isRemote) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - /* Take Off If Falling Off Cliff */ - if (isEntityGrounded() && !worldObj.isRemote - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 1, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 2, (int) this.posZ) - && worldObj.isAirBlock((int) this.posX, (int) this.posY - 3, (int) this.posZ)) { - this.dataWatcher.updateObject(17, Byte.valueOf((byte) 0)); - } - super.updateAITasks(); - } - - /** - * Will return how many at most can spawn in a chunk at once. - */ - @Override - public int getMaxSpawnedInChunk() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/d1bfb5fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/d1bfb5fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 655c27d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/d1bfb5fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,155 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -/* This AI is Compatible with both Flying and Ground Entities */ -public class EntityAIAttackOnCollide extends EntityAIBase -{ - World worldObj; - EntityGenericCreature attacker; - EntityLivingBase entityTarget; - - /** - * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. - */ - int attackTick; - float moveSpeed; - boolean continuousPathing; - - /** The PathEntity of our entity. */ - PathEntity entityPathEntity; - Class classTarget; - private int changeDirectionCooldown; - - float attackDistanceSq; - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4, float attackDistanceSq) { - this.attackTick = 0; - this.attacker = par1EntityLiving; - this.worldObj = par1EntityLiving.worldObj; - this.moveSpeed = par3; - this.continuousPathing = par4; - this.setMutexBits(3); - - this.classTarget = par2Class; - this.attackDistanceSq = attackDistanceSq; - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, Class par2Class, float par3, boolean par4) { - this(par1EntityLiving, par2Class, par3, par4, par1EntityLiving.width * 2.0F * par1EntityLiving.width * 2.0F); - } - - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, null, par2, par3); - } - public EntityAIAttackOnCollide(EntityGenericCreature par1EntityLiving, float par2, boolean par3, float attackDistanceSq ) { - this(par1EntityLiving, null, par2, par3, attackDistanceSq); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - - if (var1 == null){ - return false; - } - else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())){ - return false; - } - else{ - this.entityTarget = var1; - if(attacker.isEntityGrounded()){ - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(this.entityTarget); - return this.entityPathEntity != null; - }else{ - return this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)entityTarget.posY, (int)entityTarget.posZ)); - } - } - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - if(var1 == null || !this.entityTarget.isEntityAlive()){ - return false; - }else if(!this.continuousPathing){ - if(attacker.isEntityGrounded()){ - return !this.attacker.getNavigator().noPath(); - }else{ - return !attacker.atTargetPosition() && attacker.isTargetPositionValid(); - } - }else{ - return this.attacker.isWithinHomeDistance( - MathHelper.floor_double(this.entityTarget.posX), - MathHelper.floor_double(this.entityTarget.posY), - MathHelper.floor_double(this.entityTarget.posZ)); - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().setPath(this.entityPathEntity, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - this.changeDirectionCooldown = 0; - - } - - /** - * Resets the task - */ - public void resetTask() { - this.entityTarget = null; - this.attacker.getNavigator().clearPathEntity(); - } - - /** - * Updates the task - */ - public void updateTask() { - this.attacker.getLookHelper().setLookPositionWithEntity(this.entityTarget, 30.0F, 30.0F); - - /* Check if Entity can See Target and if ChangeDirectionCooldown is down so we should Search for a new Path */ - if ((this.continuousPathing || this.attacker.getEntitySenses().canSee(this.entityTarget)) && --this.changeDirectionCooldown <= 0) { - this.changeDirectionCooldown = 4 + this.attacker.getRNG().nextInt(7); - if(attacker.isEntityGrounded()){ - this.attacker.getNavigator().tryMoveToEntityLiving(this.entityTarget, this.moveSpeed); - }else{ - this.attacker.setTargetPosition(new ChunkCoordinates((int)entityTarget.posX, (int)(entityTarget.posY+1.0), (int)entityTarget.posZ)); - } - } - - - /* Decrement attackTick and Try to Attack if Target is Close Enough*/ - this.attackTick = Math.max(this.attackTick - 1, 0); - double var1 = (double)(attackDistanceSq); - if (this.attacker.getDistanceSq(this.entityTarget.posX, this.entityTarget.boundingBox.minY, this.entityTarget.posZ) <= var1) { - if (this.attackTick <= 0) - { - this.attackTick = 20; - - if (this.attacker.getHeldItem() != null) - { - this.attacker.swingItem(); - } - - this.attacker.attackEntityAsMob(this.entityTarget); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/e0c354f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/e0c354f4c42100141fce95f06aba7e85 deleted file mode 100644 index 11ecf91..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/e0c354f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,186 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.BoundaryPair; -import com.ngb.projectzulu.common.world2.CellHelper; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralHallway implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - piecePos = applyRotation(piecePos, cellSize, cellIndexDirection); - piecePos = applyMirror(piecePos, cellSize, cellIndexDirection); - - return getWallBlock(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - private ChunkCoordinates applyRotation(ChunkCoordinates piecePos, int cellSize, - CellIndexDirection cellIndexDirection) { - return CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall); - } - - private ChunkCoordinates applyMirror(ChunkCoordinates piecePos, int cellSize, CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.WestWall) { - piecePos = CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.NorthWestCorner); - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - return CellHelper.mirrorCellTo(piecePos, cellSize, CellIndexDirection.SouthWestCorner); - } - return piecePos; - } - - public BlockWithMeta getWallBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta woodenStair = new BlockWithMeta(Blocks.spruce_stairs); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - /* Ceiling Top */ - if (piecePos.posY > cellHeight - cellSize) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(0, cellSize * 2 - 8), cellHeight - cellSize / 3); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return woodenPlank; - } - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - /* Outer Wall */ - if (piecePos.posZ == cellSize * 4 / 10) { - // - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Mid Ceiling */ - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 3, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 2, 1, - BoundaryPair.createPair(1, cellSize * 2 - 8), cellHeight - cellSize); - if (slope == 0) { - if (slope != slopeBelow) { - return new BlockWithMeta(woodenStair.block, getStairMeta(cellIndexDirection)); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Upper Hallway */ - if (slope > 0 && piecePos.posZ > 2) { - if ((piecePos.posX == 0 || piecePos.posX == cellSize - 1) && piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posZ == cellSize - 1 && piecePos.posX % 3 == 2 && slope == 1) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - - if (slope < 4 && piecePos.posZ == 3) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - - /* Arches */ - int topAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 0, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (topAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, true)); - } - } - - int botAarchSlope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ + 1, 1, - BoundaryPair.createPair(1, cellSize * 2), cellHeight - cellSize); - if (botAarchSlope == 0 && piecePos.posX % 3 == 1) { - // only inside cathedral wall - if (piecePos.posZ > cellSize * 4 / 10) { - return new BlockWithMeta(woodenStair.block, getArchStairMeta(cellIndexDirection, false)); - } - } - - /* Pews */ - if (piecePos.posY == 1 && piecePos.posX % 2 == 1) { - if (piecePos.posZ == cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.oak_stairs, getPewStairMeta(cellIndexDirection)); - } else if (piecePos.posZ > cellSize * 4 / 10 + 2) { - return new BlockWithMeta(Blocks.wooden_slab); - } - } - - if (piecePos.posZ > cellSize * 4 / 10 && piecePos.posY == 0) { - if (piecePos.posZ == cellSize * 4 / 10 + 1) { - return new BlockWithMeta(Blocks.cobblestone); - } else { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - return new BlockWithMeta(Blocks.air); - } - - private int getStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 0; - case EastWall: - return 1; - case SouthWall: - return 3; - case NorthWall: - default: - return 2; - } - } - - public int getArchStairMeta(CellIndexDirection cellIndexDirection, boolean top) { - switch (cellIndexDirection) { - case WestWall: - return top ? 0 : 5; - case EastWall: - return top ? 1 : 4; - default: - return 2; - } - } - - private int getPewStairMeta(CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case WestWall: - return 1; - case EastWall: - return 0; - default: - return 0; - } - } - - @Override - public String getIdentifier() { - return "BPCathedralHallway"; - } - - @Override - public int getWeight() { - return 0; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f026a2a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f026a2a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c2a9162..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f8/f026a2a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,186 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.entity.ai.attributes.IAttributeInstance; -import net.minecraft.entity.passive.EntityTameable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.pathfinding.PathPoint; -import net.minecraft.util.MathHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public abstract class EntityAITarget extends EntityAIBase { - - /** The entity that this task belongs to */ - protected EntityLiving taskOwner; - protected float targetDistance; - - /** - * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. - */ - protected boolean shouldCheckSight; - /* - * I believe This Toggles whether the final point in the path is evaluated to ensure the Entity can Reach Its - * Destination : Can be Wonky on Larger Entities - */ - private boolean field_75303_a; - /* Controls if Path is Valid, 0:SearchForPath, 1:ValidPath, 2:InvalidPath */ - private int pathState; // 0 : Check if Path, 1 : - private int pathCheckCooldown; - private int field_75298_g; - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3) { - this(par1EntityLiving, par2, par3, false); - } - - public EntityAITarget(EntityLiving par1EntityLiving, float par2, boolean par3, boolean par4) { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - this.taskOwner = par1EntityLiving; - this.targetDistance = par2; - this.shouldCheckSight = par3; - this.field_75303_a = par4; - } - - /** - * Returns whether an in-progress EntityAIBase should continue executing - */ - public boolean continueExecuting() { - EntityLivingBase attackTarget = this.taskOwner.getAttackTarget(); - - if (attackTarget == null) { - return false; - } else if (!attackTarget.isEntityAlive()) { - return false; - } else if (this.taskOwner.getDistanceSqToEntity(attackTarget) > (double) (this.targetDistance * this.targetDistance)) { - return false; - } else { - double followDistance = getFollowDistance(); - if (taskOwner.getDistanceSqToEntity(attackTarget) > followDistance * followDistance) { - return false; - } else if (this.shouldCheckSight) { - if (this.taskOwner.getEntitySenses().canSee(attackTarget)) { - this.field_75298_g = 0; - } else if (++this.field_75298_g > 60) { - return false; - } - } - return true; - } - } - - protected double getFollowDistance() { - IAttributeInstance attributeinstance = this.taskOwner.getEntityAttribute(SharedMonsterAttributes.followRange); - return attributeinstance == null ? 16.0D : attributeinstance.getAttributeValue(); - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting() { - this.pathState = 0; - this.pathCheckCooldown = 0; - this.field_75298_g = 0; - } - - /** - * Resets the task - */ - public void resetTask() { - this.taskOwner.setAttackTarget(null); - } - - /** - * A method used to see if an entity is a suitable target through a number of checks. - */ - protected boolean isSuitableTarget(EntityLivingBase par1EntityLiving, boolean par2) { - if (par1EntityLiving == null) { - return false; - } else if (par1EntityLiving == this.taskOwner) { - return false; - } else if (!par1EntityLiving.isEntityAlive()) { - return false; - } else if (!this.taskOwner.canAttackClass(par1EntityLiving.getClass())) { - return false; - } else { - if (this.taskOwner instanceof EntityTameable && ((EntityTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityTameable && ((EntityTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (this.taskOwner instanceof EntityGenericTameable - && ((EntityGenericTameable) this.taskOwner).isTamed()) { - if (par1EntityLiving instanceof EntityGenericTameable - && ((EntityGenericTameable) par1EntityLiving).isTamed()) { - return false; - } - - if (par1EntityLiving == ((EntityGenericTameable) this.taskOwner).getOwner()) { - return false; - } - } else if (par1EntityLiving instanceof EntityPlayer && !par2 - && ((EntityPlayer) par1EntityLiving).capabilities.disableDamage) { - return false; - } - - if (this.taskOwner instanceof EntityGenericCreature - && !((EntityGenericCreature) taskOwner).isWithinHomeDistance( - MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.taskOwner instanceof EntityCreature - && !((EntityCreature) taskOwner).isWithinHomeDistance(MathHelper.floor_double(par1EntityLiving.posX), - MathHelper.floor_double(par1EntityLiving.posY), - MathHelper.floor_double(par1EntityLiving.posZ))) { - return false; - } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLiving)) { - return false; - } else { - if (this.field_75303_a) { - if (--this.pathCheckCooldown <= 0) { - this.pathState = 0; - } - - if (this.pathState == 0) { - this.pathState = this.func_75295_a(par1EntityLiving) ? 1 : 2; - } - - if (this.pathState == 2) { - return false; - } - } - - return true; - } - } - } - - private boolean func_75295_a(EntityLivingBase par1EntityLiving) { - this.pathCheckCooldown = 10 + this.taskOwner.getRNG().nextInt(5); - PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLiving); - - if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); - - if (var3 == null) { - return false; - } else { - int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLiving.posX); - int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLiving.posZ); - return (double) (var4 * var4 + var5 * var5) <= 2.25D; - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/00441df5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/00441df5c42100141fce95f06aba7e85 deleted file mode 100644 index 6937438..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/00441df5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,27 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.entity.Entity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class RenderSnow extends RenderGenericLiving { - public final ResourceLocation snowTexture; - - public RenderSnow(ModelBase modelBase, float shadowSize, ResourceLocation livingLocation, - ResourceLocation snowTexture) { - super(modelBase, shadowSize, livingLocation); - this.snowTexture = snowTexture; - } - - @Override - protected ResourceLocation getEntityTexture(Entity entity) { - if (BiomeDictionary.isBiomeOfType(entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ), - Type.FROZEN)) { - return snowTexture; - } else { - return livingTexture; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/01035f00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/01035f00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6488219..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/01035f00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserMaxHeight extends KeyParserBase { - - public KeyParserMaxHeight(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseSingleInteger(pieces, -1, key.key)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Integer maxSpawnHeight = (Integer) typeValuePair.getValue(); - return yCoord > maxSpawnHeight ? true : false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/1009c2f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/1009c2f8c42100141fce95f06aba7e85 deleted file mode 100644 index 8cad7cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/1009c2f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,76 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityVulture; -import com.ngb.projectzulu.common.mobs.models.ModelVulture; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericLiving; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class VultureDeclaration extends SpawnableDeclaration { - - public VultureDeclaration() { - super("Vulture", 6, EntityVulture.class, EnumCreatureType.monster); - setSpawnProperties(2, 5, 1, 3); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (78 << 16) + (72 << 8) + 56; - eggColor2 = (120 << 16) + (110 << 8) + 86; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - customMobData.customData.put("maxTargetHealth", - config.get("MOB CONTROLS." + mobName, "Max Target Health To Attack", 20).getInt(20)); - - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.chicken, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Talon.meta(), 4); - customMobData.entityProperties = new EntityProperties(14f, 3.0f, 0.18f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelVulture(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "vulture.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.add("Wasteland"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.DESERT)); - nonFrozenForest.addAll(typeToArray(Type.WASTELAND)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/124fd3fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/124fd3fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f8b3bc2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/124fd3fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; -import projectzulu.common.potion.brewingstands.BlockBrewingStandTriple; -import projectzulu.common.potion.brewingstands.RenderBrewingStandSingle; -import projectzulu.common.potion.brewingstands.TileEntityBrewingStandRenderer; -import projectzulu.common.potion.brewingstands.TileEntityBrewingTriple; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BrewingStandTripleDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public BrewingStandTripleDeclaration() { - super("BrewingStandTriple"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Brewing Stand Triple Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.brewingStandTriple = Optional.of(new BlockBrewingStandTriple(renderID).setBlockName("brewingtriple") - .setBlockTextureName(DefaultProps.blockKey + ":brewingtriple")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.brewingStandTriple.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerTileEntity(TileEntityBrewingTriple.class, "TileEntityBrewingTriple"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderBrewingStandSingle()); - ProjectZuluLog.info("Brewing Stand Triple Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBrewingTriple.class, - new TileEntityBrewingStandRenderer()); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/2092929dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/2092929dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index be62ca8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/2092929dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,79 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.item.Item; - -import com.google.common.base.Optional; - -public enum ItemList { - instance; - /* Items */ - public static Optional ankh = Optional.absent(); - public static Optional scaleItem = Optional.absent(); - public static Optional furPelt = Optional.absent(); - - public static Optional aloeVeraSeeds = Optional.absent(); - public static Optional waterDroplets = Optional.absent(); - - public static Optional coconutItem = Optional.absent(); - public static Optional coconutSeed = Optional.absent(); - public static Optional coconutShell = Optional.absent(); - public static Optional coconutMilkFragment = Optional.absent(); - - public static Optional genericCraftingItems = Optional.absent(); - public static Optional scrapMeat = Optional.absent(); - public static Optional structurePlacer = Optional.absent(); - public static Optional potionIngredients = Optional.absent(); - public static Optional customPotions = Optional.absent(); - public static Optional vanillaPotions = Optional.absent(); - - /* Armor */ - public static Optional scaleArmorHead = Optional.absent(); - public static Optional scaleArmorChest = Optional.absent(); - public static Optional scaleArmorLeg = Optional.absent(); - public static Optional scaleArmorBoots = Optional.absent(); - - public static Optional goldScaleArmorHead = Optional.absent(); - public static Optional goldScaleArmorChest = Optional.absent(); - public static Optional goldScaleArmorLeg = Optional.absent(); - public static Optional goldScaleArmorBoots = Optional.absent(); - - public static Optional ironScaleArmorHead = Optional.absent(); - public static Optional ironScaleArmorChest = Optional.absent(); - public static Optional ironScaleArmorLeg = Optional.absent(); - public static Optional ironScaleArmorBoots = Optional.absent(); - - public static Optional diamondScaleArmorHead = Optional.absent(); - public static Optional diamondScaleArmorChest = Optional.absent(); - public static Optional diamondScaleArmorLeg = Optional.absent(); - public static Optional diamondScaleArmorBoots = Optional.absent(); - - public static Optional whiteClothHead = Optional.absent(); - public static Optional whiteClothChest = Optional.absent(); - public static Optional whiteClothLeg = Optional.absent(); - public static Optional whiteClothBoots = Optional.absent(); - - public static Optional redClothHead = Optional.absent(); - public static Optional redClothChest = Optional.absent(); - public static Optional redClothLeg = Optional.absent(); - public static Optional redClothBoots = Optional.absent(); - - public static Optional greenClothHead = Optional.absent(); - public static Optional greenClothChest = Optional.absent(); - public static Optional greenClothLeg = Optional.absent(); - public static Optional greenClothBoots = Optional.absent(); - - public static Optional blueClothHead = Optional.absent(); - public static Optional blueClothChest = Optional.absent(); - public static Optional blueClothLeg = Optional.absent(); - public static Optional blueClothBoots = Optional.absent(); - - public static Optional cactusArmorHead = Optional.absent(); - public static Optional cactusArmorChest = Optional.absent(); - public static Optional cactusArmorLeg = Optional.absent(); - public static Optional cactusArmorBoots = Optional.absent(); - - public static Optional furArmorHead = Optional.absent(); - public static Optional furArmorChest = Optional.absent(); - public static Optional furArmorLeg = Optional.absent(); - public static Optional furArmorBoots = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/21a917e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/21a917e4c42100141fce95f06aba7e85 deleted file mode 100644 index 2a7d9b5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/21a917e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,127 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGiraffeHead extends ModelBase{ - - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - - public ModelGiraffeHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, 24F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - NECKROT2.render(f5); - } -// null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - // NECKROT1.rotateAngleX = (float) (75*Math.PI/180); - switch ((int)skullState) { - case 0: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - case 1: - NECKROT2.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) ( 5*Math.PI/180); - break; - default: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - } - NECKROT2.rotateAngleY = f3 / (180F / (float)Math.PI); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/21e75da0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/21e75da0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a09c2b4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/21e75da0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.ItemList; -import projectzulu.common.blocks.ItemZuluArmor; -import projectzulu.common.core.itemblockdeclaration.ItemSetDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class RedClothArmorDeclaration extends ItemSetDeclaration { - - public final int renderIndex; - - public RedClothArmorDeclaration(int renderIndex) { - super(new String[] { "RedClothHelmet", "RedClothChest", "RedClothLegs", "RedClothBoots" }); - this.renderIndex = renderIndex; - } - - @Override - protected boolean createItem(int partIndex) { - Item item = new ItemZuluArmor(ProjectZulu_Core.desertClothMaterial, renderIndex, partIndex, - name[partIndex].toLowerCase()); - - switch (partIndex) { - case 0: - ItemList.redClothHead = Optional.of(item); - return true; - case 1: - ItemList.redClothChest = Optional.of(item); - return true; - case 2: - ItemList.redClothLeg = Optional.of(item); - return true; - case 3: - ItemList.redClothBoots = Optional.of(item); - return true; - } - return false; - } - - @Override - protected void registerItem(int partIndex) { - Item item = null; - switch (partIndex) { - case 0: - item = ItemList.redClothHead.get(); - break; - case 1: - item = ItemList.redClothChest.get(); - break; - case 2: - item = ItemList.redClothLeg.get(); - break; - case 3: - item = ItemList.redClothBoots.get(); - break; - } - GameRegistry.registerItem(item, name[partIndex]); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/408f4bfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/408f4bfac42100141fce95f06aba7e85 deleted file mode 100644 index d49e6a2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/408f4bfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,17 +0,0 @@ -package com.ngb.projectzulu.common.api; - -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public enum PotionList { - INSTANCE; - public static Optional bubbling = Optional.absent(); - public static Optional incendiary = Optional.absent(); - public static Optional slowfall = Optional.absent(); - public static Optional cleansing = Optional.absent(); - public static Optional curse = Optional.absent(); - public static Optional thorn = Optional.absent(); - public static Optional heal2 = Optional.absent(); - public static Optional harm2 = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/5110b9fdc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/5110b9fdc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9ea1302..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/5110b9fdc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/70b29301c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/70b29301c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9f03fea..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/70b29301c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; - -import projectzulu.common.blocks.itemblockdeclarations.StructurePlacerDeclaration; -import projectzulu.common.core.CustomEntityManager; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemBlockManager; -import projectzulu.common.core.terrain.FeatureGenerator; -import projectzulu.common.world.terrain.CathedralFeature; -import projectzulu.common.world.terrain.CemetaryFeature; -import projectzulu.common.world.terrain.LabyrinthFeature; -import projectzulu.common.world.terrain.OasisFeature; -import projectzulu.common.world.terrain.PyramidFeature; -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.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; - -public class ProjectZulu_World extends BaseModule { - - @Override - public String getIdentifier() { - return DefaultProps.WorldModId; - } - - @Override - public void registration(ItemBlockManager manager) { - manager.addItemBlock(new StructurePlacerDeclaration()); - } - - @Override - public void registration(FeatureGenerator manager) { - manager.registerStructure(new PyramidFeature(), new LabyrinthFeature(), new CemetaryFeature(), - new OasisFeature(), new CathedralFeature()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/911db8e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/911db8e6c42100141fce95f06aba7e85 deleted file mode 100644 index b528480..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/911db8e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,382 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.temperature.ITempBlock; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BlockCampfire extends Block implements ITempBlock { - public enum Type { - Wood(0, "Wood Campfire"), Stone(1, "Stone Campfire"), WoodFire(2, "Lit Campfire"), StoneFire(3, - "Lit Stone Campfire"); - - private int meta; - private final String displayName; - @SideOnly(Side.CLIENT) - private IIcon icon; - - Type(int meta, String displayName) { - this.meta = meta; - this.displayName = displayName; - } - - public int meta() { - return meta; - } - - public String displayName() { - return displayName; - } - - public void setIcon(IIcon icon) { - this.icon = icon; - } - - public IIcon getIcon() { - return icon; - } - - public static Type getTypeByMeta(int meta) { - for (Type type : Type.values()) { - if (type.meta == meta) { - return type; - } - } - return null; - } - } - - public final int renderID; - - public BlockCampfire(int renderID) { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setTickRandomly(true); - setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); - setHardness(0.5F); - setStepSound(Block.soundTypeStone); - this.renderID = renderID; - } - - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(int par1, int par2) { - return BlockCampfire.Type.getTypeByMeta(par2).getIcon(); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) { - for (Type type : Type.values()) { - type.setIcon(par1IconRegister.registerIcon(getTextureName() + "_" + type.toString().toLowerCase())); - } - } - - @Override - public void onBlockAdded(World par1World, int par2, int par3, int par4) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - this.setLightLevel(1.0f); - } else { - this.setLightLevel(0); - } - super.onBlockAdded(par1World, par2, par3, par4); - } - - @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) { - if (world.getBlockMetadata(x, y, z) > 1) { - return 15; - } else { - return 0; - } - } - - @Override - public int getRenderType() { - return renderID; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } - - @Override - public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int meta = par1World.getBlockMetadata(par2, par3, par4); - - /* Handle Fire Spreading, if Stone only Upwards, if Wood adjacent and upwards */ - if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { - - if (meta > 1) { - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.UP)) { - par1World.setBlock(par2, par3 + 1, par4, Blocks.fire); - } - } - - if (meta == 2) { - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - par1World.setBlock(par2, par3, par4 + 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - par1World.setBlock(par2, par3, par4 - 1, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - par1World.setBlock(par2 + 1, par3, par4, Blocks.fire); - } else if (canBlockCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.EAST)) { - par1World.setBlock(par2 - 1, par3, par4, Blocks.fire); - } - } - - } - super.updateTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been - * cleared to be reused) - */ - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - //return AxisAlignedBB.getAABBPool().getAABB(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - // par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - return AxisAlignedBB.getBoundingBox(par2 + this.minX, par3 + this.minY, par4 + this.minZ, - par2 + this.maxX, par3 + 0.3, par4 + this.maxZ); - } - - /** - * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides - */ - @Override - public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { - - if (par5 != 1) { - return false; - } - - return this.canPlaceBlockAt(par1World, par2, par3, par4); - } - - @SideOnly(Side.CLIENT) - @Override - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { - for (Type type : Type.values()) { - par3List.add(new ItemStack(this, 1, type.meta)); - } - } - - @Override - public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, - int par6, float par7, float par8, float par9) { - - /* Make sure Player Item is not Null */ - if (par5EntityPlayer.getCurrentEquippedItem() != null) { - /* If Fire is not Lit and Coal is in Hand, Light Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.coal)) { - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) + 2, 3); - return true; - } - - /* If Fire is Lit and Water is in Hand, Put out Fire */ - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.water_bucket) { - - if (!par5EntityPlayer.capabilities.isCreativeMode) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, - new ItemStack(Items.bucket)); - } - par1World.setBlockMetadataWithNotify(par2, par3, par4, - par1World.getBlockMetadata(par2, par3, par4) - 2, 3); - return true; - } - } - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - - if (par1World.getBlockMetadata(par2, par3, par4) > 1) { - if (par5Random.nextInt(24) == 0) { - par1World.playSound(par2 + 0.5F, par3 + 0.5F, par4 + 0.5F, "fire.fire", 1.0F + par5Random.nextFloat(), - par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; - if (!World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4) - && !canBlockCatchFire(par1World, par2, par3 - 1, par4, ForgeDirection.UP)) { - if (Blocks.fire.canCatchFire(par1World, par2 - 1, par3, par4, ForgeDirection.UP)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2 + 1, par3, par4, ForgeDirection.WEST)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + 1 - par5Random.nextFloat() * 0.1F; - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat(); - var9 = par4 + 1 - par5Random.nextFloat() * 0.1F; - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - if (canBlockCatchFire(par1World, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - for (var6 = 0; var6 < 2; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + 1 - par5Random.nextFloat() * 0.1F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - } else { - for (var6 = 0; var6 < 3; ++var6) { - var7 = par2 + par5Random.nextFloat(); - var8 = par3 + par5Random.nextFloat() * 0.5F + 0.5F; - var9 = par4 + par5Random.nextFloat(); - par1World.spawnParticle("largesmoke", var7, var8, var9, 0.0D, 0.0D, 0.0D); - } - } - - } - - super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param face The side the fire is coming from - * @return True if the face can catch fire. - */ - public boolean canBlockCatchFire(IBlockAccess world, int x, int y, int z, ForgeDirection face) { - Block block = world.getBlock(x, y, z); - if (block != null) { - return block.isFlammable(world, x, y, z, face); - } - return false; - } - - /** - * Side sensitive version that calls the block function. - * - * @param world The current world - * @param x X Position - * @param y Y Position - * @param z Z Position - * @param oldChance The previous maximum chance. - * @param face The side the fire is coming from - * @return The chance of the block catching fire, or oldChance if it is higher - */ - public int getChanceToEncourageFire(World world, int x, int y, int z, int oldChance, ForgeDirection face) { - int newChance = 0; - Block block = world.getBlock(x, y, z); - if (block != null) { - newChance = block.getFireSpreadSpeed(world, x, y, z, face); - } - return (newChance > oldChance ? newChance : oldChance); - } - - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - if (par1World.getBlockMetadata(par2, par3, par4) > 1 - && par1World.getGameRules().getGameRuleBooleanValue("doesCampfireBurn")) { - par5Entity.setFire(1); - } - super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); - } - - @Override - public float getAddToPlayTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - return 0.0f; - } - - @Override - public float getAddToLocTempByNearbyBlock(EntityPlayer player, int blockPosX, int blockPosY, int blockPosZ, - Float playerTemp, float playerLocationTemp) { - if (player.worldObj.getBlockMetadata(blockPosX, blockPosY, blockPosZ) > 1) { - return 0.1f; - } - return 0.00f; - } - - @Override - public float getAddToHeatTransferByBlock(EntityPlayer player, float playerTemp, float playerLocationTemp, - float currentHeatRate) { - return 0.0f; - } - - @Override - public boolean getBooleanCauseFastHeatTransferByBlock(EntityPlayer player, float playerTemp, - float playerLocationTemp, float currentHeatRate) { - if (playerLocationTemp > playerTemp) { - return true; - } else { - return false; - } - } - - @Override - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { - ArrayList ret = new ArrayList(); - ret.add(new ItemStack(this, 1, metadata)); - return ret; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/91952cfac42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/91952cfac42100141fce95f06aba7e85 deleted file mode 100644 index 96a43af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/91952cfac42100141fce95f06aba7e85 +++ /dev/null @@ -1,168 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelElephantHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARLEFROT; - private ModelRenderer EARRIGROT; - private ModelRenderer TRUNK1ROT; - private ModelRenderer TRUNK2ROT; - private ModelRenderer TRUNK3ROT; - private ModelRenderer TRUNK4ROT; - private ModelRenderer TRUNK5ROT; - private ModelRenderer TRUNK6ROT; - private ModelRenderer TRUNK7ROT; - private ModelRenderer TUSKRIGROT; - private ModelRenderer TUSKLEFROT; - - - public ModelElephantHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.Head", 92, 0); - setTextureOffset("HEADROT.nosebase1", 77, 20); - setTextureOffset("HEADROT.nosebase2", 77, 33); - setTextureOffset("HEADROT.nosebase3", 102, 33); - setTextureOffset("HEADROT.nosebase4", 113, 43); -// setTextureOffset("EARLEFROT.earlef", 55, 41); -// setTextureOffset("EARRIGROT.earrig", 55, 41); - setTextureOffset("TRUNK1ROT.trunk1", 97, 53); - setTextureOffset("TRUNK2ROT.trunk2", 97, 51); - setTextureOffset("TRUNK3ROT.trunk3", 97, 49); - setTextureOffset("TRUNK4ROT.trunk4", 97, 47); - setTextureOffset("TRUNK5ROT.trunk5", 97, 45); - setTextureOffset("TRUNK6ROT.trunk6", 97, 43); - setTextureOffset("TRUNK7ROT.trunk7", 97, 41); - setTextureOffset("TUSKRIGROT.tuskrig", 60, 55); - setTextureOffset("TUSKLEFROT.tusklef", 60, 55); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 12F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -6F, 8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -6F, -7F, -6F, 12, 14, 6); - HEADROT.addBox("nosebase1", -6F, -3F, -8F, 12, 9, 2); - HEADROT.addBox("nosebase2", -5F, -2F, -9F, 10, 7, 1); - HEADROT.addBox("nosebase3", -4F, 0F, -10F, 8, 7, 1); - HEADROT.addBox("nosebase4", -3F, 2F, -11F, 6, 7, 1); -// EARLEFROT = new ModelRenderer(this, "EARLEFROT"); -// EARLEFROT.setRotationPoint(-7F, -0.5F, -4F); -// setRotation(EARLEFROT, 0F, 1.22173F, 0F); -// EARLEFROT.mirror = true; -// EARLEFROT.addBox("earlef", -11F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARLEFROT); -// EARRIGROT = new ModelRenderer(this, "EARRIGROT"); -// EARRIGROT.setRotationPoint(7F, -0.5F, -4F); -// setRotation(EARRIGROT, 0F, -1.22173F, 0F); -// EARRIGROT.mirror = true; -// EARRIGROT.addBox("earrig", 0F, -5.5F, 0F, 11, 11, 2); -// HEADROT.addChild(EARRIGROT); - TRUNK1ROT = new ModelRenderer(this, "TRUNK1ROT"); - TRUNK1ROT.setRotationPoint(0F, 4F, -10.5F); - setRotation(TRUNK1ROT, 0F, 0F, 0F); - TRUNK1ROT.mirror = true; - TRUNK1ROT.addBox("trunk1", -2F, 0F, -1F, 4, 2, 2); - TRUNK2ROT = new ModelRenderer(this, "TRUNK2ROT"); - TRUNK2ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK2ROT, 0F, 0F, 0F); - TRUNK2ROT.mirror = true; - TRUNK2ROT.addBox("trunk2", -2F, 0F, -1F, 4, 2, 2); - TRUNK3ROT = new ModelRenderer(this, "TRUNK3ROT"); - TRUNK3ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK3ROT, 0F, 0F, 0F); - TRUNK3ROT.mirror = true; - TRUNK3ROT.addBox("trunk3", -2F, 0F, -1F, 4, 2, 2); - TRUNK4ROT = new ModelRenderer(this, "TRUNK4ROT"); - TRUNK4ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK4ROT, 0F, 0F, 0F); - TRUNK4ROT.mirror = true; - TRUNK4ROT.addBox("trunk4", -2F, 0F, -1F, 4, 2, 2); - TRUNK5ROT = new ModelRenderer(this, "TRUNK5ROT"); - TRUNK5ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK5ROT, 0F, 0F, 0F); - TRUNK5ROT.mirror = true; - TRUNK5ROT.addBox("trunk5", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT = new ModelRenderer(this, "TRUNK6ROT"); - TRUNK6ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK6ROT, 0F, 0F, 0F); - TRUNK6ROT.mirror = true; - TRUNK6ROT.addBox("trunk6", -2F, 0F, -1F, 4, 2, 2); - TRUNK7ROT = new ModelRenderer(this, "TRUNK7ROT"); - TRUNK7ROT.setRotationPoint(0F, 2F, 0F); - setRotation(TRUNK7ROT, 0F, 0F, 0F); - TRUNK7ROT.mirror = true; - TRUNK7ROT.addBox("trunk7", -2F, 0F, -1F, 4, 2, 2); - TRUNK6ROT.addChild(TRUNK7ROT); - TRUNK5ROT.addChild(TRUNK6ROT); - TRUNK4ROT.addChild(TRUNK5ROT); - TRUNK3ROT.addChild(TRUNK4ROT); - TRUNK2ROT.addChild(TRUNK3ROT); - TRUNK1ROT.addChild(TRUNK2ROT); - HEADROT.addChild(TRUNK1ROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(4.5F, 2F, -8F); - setRotation(TUSKRIGROT, 0.8028515F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKRIGROT); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-5.5F, 2F, -8F); - setRotation(TUSKLEFROT, 0.8028515F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tusklef", 0F, 0F, -8F, 1, 1, 8); - HEADROT.addChild(TUSKLEFROT); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - - TRUNK1ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK2ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK3ROT.rotateAngleX = (float) (0.0*Math.PI/180); - TRUNK4ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK5ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK6ROT.rotateAngleX = (float) (45*Math.PI/180); - TRUNK7ROT.rotateAngleX = (float) (45*Math.PI/180); - -// switch ((int)skullState) { -// case 1: -// NECKROT1.rotateAngleX = (float)(+0*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+30*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+40*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-60*Math.PI/180f); -// break; -// -// default: -// NECKROT1.rotateAngleX = (float)(+90*Math.PI/180f); -// NECKROT2.rotateAngleX = (float)(+10*Math.PI/180f); -// NECKROT3.rotateAngleX = (float)(+10*Math.PI/180f); -// HEADROT.rotateAngleX = (float)(-80*Math.PI/180f); -// break; -// } - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b00e12e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b00e12e5c42100141fce95f06aba7e85 deleted file mode 100644 index 82e5329..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b00e12e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,85 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFlyingWander; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; - -public class EntityEagle extends EntityGenericAnimal { - - public EntityEagle(World par1World) { - super(par1World); - this.setSize(1.0f, 1.4f); - - float moveSpeed = 0.22f; - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { - // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? - moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; - } - - this.maxFlightHeight = 30; - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); - this.tasks.addTask(6, new EntityAIFlyingWander(this, moveSpeed)); - - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); - this.targetTasks.addTask(2, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - } - - @Override - public boolean defaultGrounded() { - return false; - } - - /** - * Called when the mob is falling. Calculates and applies fall damage. - */ - @Override - protected void fall(float par1) { - } - - /** - * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance - * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround - */ - @Override - protected void updateFallState(double par1, boolean par3) { - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eagleliving"; - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "eaglehurt"; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - return false; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b090b4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b090b4f7c42100141fce95f06aba7e85 deleted file mode 100644 index 8f30501..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b090b4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,127 +0,0 @@ -package com.ngb.projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelGiraffeHead extends ModelBase{ - - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - ModelRenderer NECKROT1; - private ModelRenderer NECKROT2; - private ModelRenderer NECKROT3; - private ModelRenderer NECKROT4; - private ModelRenderer NECKROT5; - private ModelRenderer NECKROT6; - private ModelRenderer NECKROT7; - - public ModelGiraffeHead(){ - textureWidth = 128; - textureHeight = 64; - setTextureOffset("NECKROT2.neck2", 103, 33); - setTextureOffset("NECKROT3.neck3", 103, 30); - setTextureOffset("NECKROT4.neck4", 103, 27); - setTextureOffset("NECKROT5.neck5", 103, 24); - setTextureOffset("NECKROT6.neck6", 103, 21); - setTextureOffset("NECKROT7.neck7", 103, 18); - setTextureOffset("HEADROT.head", 81, 46); - setTextureOffset("HEADROT.horn1", 82, 52); - setTextureOffset("HEADROT.horn2", 115, 52); - - NECKROT2 = new ModelRenderer(this, "NECKROT2"); - NECKROT2.setRotationPoint(0F, 24F, 0F); - setRotation(NECKROT2, 0F, 0F, 0F); - NECKROT2.mirror = true; - NECKROT2.addBox("neck2", -3F, -3F, -3F, 6, 3, 6); - NECKROT3 = new ModelRenderer(this, "NECKROT3"); - NECKROT3.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT3, 0F, 0F, 0F); - NECKROT3.mirror = true; - NECKROT3.addBox("neck3", -3F, -3F, -3F, 6, 3, 6); - NECKROT4 = new ModelRenderer(this, "NECKROT4"); - NECKROT4.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT4, 0F, 0F, 0F); - NECKROT4.mirror = true; - NECKROT4.addBox("neck4", -3F, -3F, -3F, 6, 3, 6); - NECKROT5 = new ModelRenderer(this, "NECKROT5"); - NECKROT5.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT5, 0F, 0F, 0F); - NECKROT5.mirror = true; - NECKROT5.addBox("neck5", -3F, -3F, -3F, 6, 3, 6); - NECKROT6 = new ModelRenderer(this, "NECKROT6"); - NECKROT6.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT6, 0F, 0F, 0F); - NECKROT6.mirror = true; - NECKROT6.addBox("neck6", -3F, -3F, -3F, 6, 3, 6); - NECKROT7 = new ModelRenderer(this, "NECKROT7"); - NECKROT7.setRotationPoint(0F, -3F, 0F); - setRotation(NECKROT7, 0F, 0F, 0F); - NECKROT7.mirror = true; - NECKROT7.addBox("neck7", -3F, -3F, -3F, 6, 3, 6); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("head", -3.5F, -6F, -9F, 7, 6, 12); - HEADROT.addBox("horn1", -2F, -8F, 1F, 1, 2, 1); - HEADROT.addBox("horn2", 1F, -8F, 1F, 1, 2, 1); - NECKROT7.addChild(HEADROT); - NECKROT6.addChild(NECKROT7); - NECKROT5.addChild(NECKROT6); - NECKROT4.addChild(NECKROT5); - NECKROT3.addChild(NECKROT4); - NECKROT2.addChild(NECKROT3); - - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float skullState, float f5){ - setRotationAngles(f, f1, f2, f3, skullState, f5, entity); - NECKROT2.render(f5); - } -// null, 0.0F, 0.0F, 0.0F, rotation, skullState, scale - private void setRotation(ModelRenderer model, float x, float y, float z){ - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float skullState, float f5, Entity par7Entity){ - // NECKROT1.rotateAngleX = (float) (75*Math.PI/180); - switch ((int)skullState) { - case 0: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - case 1: - NECKROT2.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) ( 5*Math.PI/180); - break; - default: - NECKROT2.rotateAngleX = (float) (90*Math.PI/180); - NECKROT3.rotateAngleX = (float) ( 0*Math.PI/180); - NECKROT4.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT5.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT6.rotateAngleX = (float) ( -30*Math.PI/180); - NECKROT7.rotateAngleX = (float) ( 0*Math.PI/180); - HEADROT.rotateAngleX = (float) (0*Math.PI/180); - break; - } - NECKROT2.rotateAngleY = f3 / (180F / (float)Math.PI); - - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b09878e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b09878e5c42100141fce95f06aba7e85 deleted file mode 100644 index 4af4a31..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/b09878e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,49 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EggableDeclaration; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.mobs.entity.EntityMinotaur; -import projectzulu.common.mobs.models.ModelMinotaur; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class MinotaurDeclaration extends EggableDeclaration { - - public MinotaurDeclaration() { - super("Minotaur", 38, EntityMinotaur.class, EnumCreatureType.monster); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (255 << 16) + (255 << 8) + 255; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.Ectoplasm.meta(), 4); - customMobData.entityProperties = new EntityProperties(30f, 3.0f, 0.25f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelMinotaur(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "minotaur.png")); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/c0a87ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/c0a87ef6c42100141fce95f06aba7e85 deleted file mode 100644 index 9a8ecc6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/c0a87ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,28 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.world.World; - -public class TerrainFeatureHelper { - - /** - * Method to evaluate the terrain variation. Compares the height along each point of an X to the center. - * If greater than provided difference return false; - * @param world - * @param Xcoord - * @param Ycoord - * @param Zcoord - * @param maxDifference - * @param squareLength - * @return - */ - public static boolean doesTerrainFluctuate(World world, int Xcoord, int Ycoord, int Zcoord, int maxDifference, int squareLength){ - if( Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord+squareLength) - Ycoord) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord-squareLength, Zcoord+squareLength) - Ycoord ) < maxDifference - && Math.abs( world.getTopSolidOrLiquidBlock(Xcoord+squareLength, Zcoord-squareLength) - Ycoord ) < maxDifference){ - return false; - } - - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/d24eb3fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/d24eb3fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a6d1c0b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/d24eb3fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,99 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIWander; -import cpw.mods.fml.common.Loader; - -public class EntityTreeEnt extends EntityGenericAnimal implements IAnimals { - - public EntityTreeEnt(World par1World) { - super(par1World); - setSize(1.7f, 3.0f); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); - - // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); - // tasks.addTask(6, new EntityAITempt(this, moveSpeed, Blocks.tallgrass, false)); - // tasks.addTask(7, new EntityAIFollowParent(this, moveSpeed)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - return 6; - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "treeentliving"; - } - - @Override - public void knockBack(Entity par1Entity, float par2, double par3, double par5) { - if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; - float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; - this.motionX -= par3 / var7 * var8 * 0.2; - this.motionY += var8; - this.motionZ -= par5 / var7 * var8 * 0.2; - - if (this.motionY > 0.2000000059604645D) { - this.motionY = 0.2000000059604645D; - } - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 15), 1); - } - super.dropRareDrop(par1); - } - -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e05a139ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e05a139ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6f198ab..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e05a139ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,22 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.item.Item; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.core.DefaultProps; - -public class ItemCoconutShell extends Item { - - public ItemCoconutShell(boolean full3D, String name) { - super(); - maxStackSize = 12; - setMaxDamage(5); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = full3D; - setUnlocalizedName(name.toLowerCase()); - setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); - } - - public int getMetadata(int par1) { - return par1; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e09b11a0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e09b11a0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9e6f0b3..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e09b11a0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,73 +0,0 @@ -package projectzulu.common.blocks; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBush; -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.world.World; -import projectzulu.common.ProjectZulu_Core; - -public class BlockCreeperBlossom extends BlockBush { - - public BlockCreeperBlossom() { - super(Material.tnt); - this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(0.5F); - setStepSound(Block.soundTypeGrass); - } - - /** - * Returns the quantity of items to drop on block destruction. - */ - @Override - public int quantityDropped(Random par1Random) { - return 1; - } - - /** - * Called upon the block being destroyed by an explosion - */ - public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4) { - if (!par1World.isRemote) { - EntityCreeperBlossomPrimed var5 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8; - par1World.spawnEntityInWorld(var5); - } - } - - /** - * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity - */ - @Override - public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - - if (par5Entity instanceof EntityPlayer && !par1World.isRemote && !((EntityPlayer) par5Entity).isSneaking()) { - EntityCreeperBlossomPrimed var6 = new EntityCreeperBlossomPrimed(par1World, par2 + 0.5F, par3 + 0.5F, - par4 + 0.5F); - par1World.spawnEntityInWorld(var6); - par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F); - par1World.setBlock(par2, par3, par4, Blocks.air); - } - } - - @Override - protected boolean canPlaceBlockOn(Block block) { - return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.log; - } - - /** - * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage - * and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. - */ - @Override - protected ItemStack createStackedBlock(int par1) { - return null; - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e0fbfee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e0fbfee4c42100141fce95f06aba7e85 deleted file mode 100644 index 5e1cb7b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e0fbfee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; - -public class TileEntityLimitedMobSpawnData extends WeightedRandom.Item { - public final NBTTagCompound properties; - public final String type; - public final String spawnSound; - public final String optionalParameters; - public final OptionalSettingsSpawning optionalSpawning; - - final TileEntityLimitedMobSpawner tileEntityMobSpawner; - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound nbtTagCompound) { - super(nbtTagCompound.getInteger("Weight")); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = nbtTagCompound.getCompoundTag("Properties"); - this.type = nbtTagCompound.getString("Type"); - this.spawnSound = nbtTagCompound.getString("SpawnSound"); - this.optionalParameters = nbtTagCompound.getString("OptionalParameter"); - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public TileEntityLimitedMobSpawnData(TileEntityLimitedMobSpawner tileEntityLimitedMobSpawner, - NBTTagCompound properties, String type, String spawnSound, String optionalParameters) { - super(1); - this.tileEntityMobSpawner = tileEntityLimitedMobSpawner; - this.properties = properties; - this.type = type; - this.spawnSound = spawnSound; - this.optionalParameters = optionalParameters != null ? optionalParameters : ""; - optionalSpawning = new OptionalSettingsSpawning(optionalParameters != null ? optionalParameters : ""); - } - - public NBTTagCompound getNBT() { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setTag("Properties", this.properties); - nbt.setString("Type", this.type); - nbt.setInteger("Weight", this.itemWeight); - nbt.setString("SpawnSound", this.spawnSound); - nbt.setString("OptionalParameter", this.optionalParameters); - return nbt; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e1a528ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e1a528ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 01ae497..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/f9/e1a528ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; - -import com.google.common.base.Optional; - -public class SubItemPotionCurse extends SubItemPotionGeneric { - - public SubItemPotionCurse(Item item, int subID) { - super(item, subID, "potion.curse"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.curse; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/216721f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/216721f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0d59bc0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/216721f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,11 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.DefaultProps; - -public class EntityHorseBeige extends EntityHorseBase{ - - public EntityHorseBeige(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/21f1a5f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/21f1a5f4c42100141fce95f06aba7e85 deleted file mode 100644 index 495b847..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/21f1a5f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,473 +0,0 @@ -//package com.ngb.projectzulu.common.temperature; -// -//import java.io.ByteArrayOutputStream; -//import java.io.DataInputStream; -//import java.io.DataOutputStream; -//import java.io.IOException; -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.block.Block; -//import net.minecraft.block.material.Material; -//import net.minecraft.entity.EntityLiving; -//import net.minecraft.entity.EntityLivingBase; -//import net.minecraft.entity.player.EntityPlayer; -//import net.minecraft.entity.player.EntityPlayerMP; -//import net.minecraft.nbt.NBTTagCompound; -//import net.minecraft.network.packet.Packet250CustomPayload; -//import net.minecraft.potion.Potion; -//import net.minecraft.potion.PotionEffect; -//import net.minecraft.world.World; -//import net.minecraft.world.biome.BiomeGenBase; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -//import cpw.mods.fml.common.network.PacketDispatcher; -//import cpw.mods.fml.common.network.Player; -// -//public class TemperatureTicker implements ITickHandler, IPlayerTracker{ -// -// /* Temperature Used When Changint Dimensions or Loading into a World for the First Time */ -// private static float defaultTemperature = 0; -// /* Player Tempurature, Used to Calculate Effects and Display */ -// private static float playerTemperature = 0; -// private static Map temperatureMap = new HashMap(); -// /* Last World the Player was in, Used to Determine if the player has Switched worlds or Just Loaded Minecraft */ -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// /* Used For Displaying the Environment Temperature around a player, used in DisplayTemperatureTicker to mark the Temp. the Player Trending Towards in */ -// private static Map playerLocTempMap = new HashMap(); -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private short DirtyFlag = 0; -// public TemperatureTicker(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( temperatureMap.containsKey( player.getEntityName() ) ){ -// playerTemperature = temperatureMap.get( player.getEntityName() ); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP ){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// /* Read From File */ -// if ( HasPendingRead() ){ -// readNBTFromFile(player); -// ClearPendingRead(); -// } -// } -// -// /* Get Outside Temperature */ -// float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// float unTouchedPlayerLocationTemperature; -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// unTouchedPlayerLocationTemperature = playerLocTempMap.get(player.getEntityName()); -// }else { -// unTouchedPlayerLocationTemperature = playerLocationTemperature; -// } -// float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -// playerLocationTemperature += item.getLocationTemperatureFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getPlayerTempContributionFromCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// if(item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// if(currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate)){ -// useFastHeatTransfer = true; -// } -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 3)); -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 1)); -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLivingBase)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Save Temperature To Map*/ -// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -// if(player instanceof EntityPlayerMP){ -// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -// DataOutputStream data = new DataOutputStream(bytes); -//// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -// -// /* Write PacketID into Packet */ -// try { -// data.writeInt(1); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// /* Write Temperature Into Packet*/ -// try { -// data.writeFloat(playerTemperature); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// -// -// Packet250CustomPayload packet = new Packet250CustomPayload(); -// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -// packet.data = bytes.toByteArray(); -// packet.length = packet.data.length; -// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -//// System.out.println( player.getEntityName().concat("Sent Packet ")); -// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// nbttagcompound.setFloat(player.getEntityName().concat("Player Temperature"), playerTemperature); -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// if (nbttagcompound.hasKey( player.getEntityName().concat("Player Temperature") )){ -// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("Player Temperature") ); -// } -// } -// -// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -// -// /* Get Relevent Data From DataStream */ -// float tempTemp = playerTemperature; -// try { -// tempTemp = data.readFloat(); -// } catch (IOException e) { -// e.printStackTrace(); -// } -// -// /* Make Sure Player Exists, then Assign data to map */ -// if(temperatureMap.containsKey(sender.getEntityName())){ -// temperatureMap.put(sender.getEntityName(), tempTemp); -// } -// -// -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -// temperatureMap.put(player.getEntityName(), 0.0f); -// lastWorldNameMap.put(player.getEntityName(), ""); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// } -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// setPlayerToDefaultTemp(player); -// } -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -// setPlayerToDefaultTemp(player); -// } -// -// public void setPlayerToDefaultTemp(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(temperatureMap.containsKey(player.getEntityName())){ -// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/312a7ae6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/312a7ae6c42100141fce95f06aba7e85 deleted file mode 100644 index 765b683..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/312a7ae6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; - -public class BPSetGenericEdge implements BlueprintSet { - - Blueprint blueprint; - public BPSetGenericEdge(Blueprint blueprint) { - this.blueprint = blueprint; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (buildCoords.y == 0) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.NorthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - } - return true; - } else if (buildCoords.y == cells[0].length - 1) { - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWestCorner); - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthEastCorner); - } else { - cells[buildCoords.x][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - } - return true; - } - - if (buildCoords.x == 0) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - return true; - } else if (buildCoords.x == cells.length - 1) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - return true; - } - return false; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - return blueprint.getBlockFromBlueprint(piecePos, cellSize, cellHeight, random, cellIndexDirection); - } - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - return buildCoords.x == 0 || buildCoords.x == cells.length - 1 || buildCoords.y == 0 - || buildCoords.y == cells[0].length - 1; - } - - @Override - public String getIdentifier() { - return blueprint.getIdentifier(); - } - - @Override - public int getWeight() { - return blueprint.getWeight(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40c9dbffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40c9dbffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 742fce2..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/40c9dbffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,61 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.ItemUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.BlockUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.RenderUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; -import projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPotRenderer; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class UniversalFlowerPotDeclaration extends BlockDeclaration { - - private int renderID = -1; - - public UniversalFlowerPotDeclaration() { - super("UniversalFlowerPot"); - } - - @Override - protected void preCreateLoadConfig(Configuration config) { - renderID = config.get("Do Not Touch", "Universal Flower Pot Render ID", renderID).getInt(renderID); - renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; - } - - @Override - protected boolean createBlock() { - BlockList.universalFlowerPot = Optional.of(new BlockUniversalFlowerPot(renderID).setBlockName("uniFlowerPot") - .setBlockTextureName("flower_pot")); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.universalFlowerPot.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - GameRegistry.registerItem(new ItemUniversalFlowerPot(block), name); - GameRegistry.registerTileEntity(TileEntityUniversalFlowerPot.class, "TileEntityUniversalFlowerPot"); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - RenderingRegistry.registerBlockHandler(renderID, new RenderUniversalFlowerPot()); - ProjectZuluLog.info("Universal Flower Pot Render ID Registed to %s", renderID); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityUniversalFlowerPot.class, - new TileEntityUniversalFlowerPotRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/611ed9f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/611ed9f9c42100141fce95f06aba7e85 deleted file mode 100644 index f8a3966..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/611ed9f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,86 +0,0 @@ -package com.ngb.projectzulu.common.blocks.terrain; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; - -public class NightBloomFeature extends BiomeFeature { - private int density = 2; - - public NightBloomFeature() { - super("Night Bloom", Size.TINY); - } - - @Override - public boolean isEnabled() { - return BlockList.nightBloom.isPresent() && super.isEnabled(); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 1; - chunksPerSpawn = 2; - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - density = config.get("Feature." + getFeatureSize() + "." + getFeatureName() + ".General", "Density", density) - .getInt(density); - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.river.biomeName }); - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - ChunkCoordinates[] coordinates = new ChunkCoordinates[density]; - for (int i = 0; i < density; i++) { - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - coordinates[i] = new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), zCoord); - } - return coordinates; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.isAirBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ)) { - Block iDBelow = world.getBlock(genBlockCoords.posX, genBlockCoords.posY - 1, genBlockCoords.posZ); - if (iDBelow == Blocks.farmland || iDBelow == Blocks.dirt || iDBelow == Blocks.grass - || (BlockList.aloeVera.isPresent() && iDBelow == BlockList.aloeVera.get())) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - world.setBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ, BlockList.nightBloom.get()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/704f0b9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/704f0b9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 371792d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/704f0b9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,81 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBrownBear; -import projectzulu.common.mobs.models.ModelBrownBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBrownDeclaration extends SpawnableDeclaration { - - public BearBrownDeclaration() { - super("Brown Bear", 17, EntityBrownBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (51 << 16) + (34 << 8) + 8; - eggColor2 = (63 << 16) + (42 << 8) + 10; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 4.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBrownBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearbrown.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/70bd3aa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/70bd3aa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c9fa6dd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/70bd3aa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.potion.subitem; - -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import projectzulu.common.potion.PotionParser; - -public abstract class SubItemPotion { - - public final Item item; - public final int subID; - public final String baseName; - - SubItemPotion(Item item, int subID, String baseName) { - this.subID = subID; - this.item = item; - this.baseName = baseName; - } - - public String getDisplayName(ItemStack itemStack) { - return StatCollector.translateToLocal(baseName).trim() + " Potion"; - } - - public abstract void register(); - - public abstract boolean hasPotionEffects(ItemStack itemStack); - - /** - * Potion Result between Ingredient and Brewing Stack. Return null if no result is viable. - * - * @param ingredient Ingredient that is being brewed with potion - * @param brewingStack Current Potion - * @return Resulting Potion, null if Items should not be brewed - */ - public ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public abstract List getPotionEffects(int damageMeta); - - /** - * - * @return Return Collections.emptyList if No PotionEffects are relevent - */ - public List getPotionEffects(ItemStack itemStack) { - return getPotionEffects(itemStack.getItemDamage()); - } - - public abstract void getSubItems(Item itemID, CreativeTabs creativeTab, List list); - - public abstract boolean isEffectInstant(int damageMeta); - - public abstract void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4); - - public ItemStack onEaten(ItemStack itemStack, World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - if (!world.isRemote) { - List list = getPotionEffects(itemStack); - - if (list != null) { - Iterator iterator = list.iterator(); - - while (iterator.hasNext()) { - PotionEffect potioneffect = iterator.next(); - player.addPotionEffect(new PotionEffect(potioneffect)); - } - } - } - if (!player.capabilities.isCreativeMode) { - if (itemStack.stackSize <= 0) { - return new ItemStack(Items.glass_bottle); - } - - player.inventory.addItemStackToInventory(new ItemStack(Items.glass_bottle)); - } - return itemStack; - } - - public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { - if (PotionParser.isSplash(itemStack.getItemDamage())) { - if (!player.capabilities.isCreativeMode) { - --itemStack.stackSize; - } - world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); - - if (!world.isRemote) { - world.spawnEntityInWorld(getEntityPotion(itemStack, world, player)); - } - return itemStack; - } else { - player.setItemInUse(itemStack, itemStack.getItem().getMaxItemUseDuration(itemStack)); - return itemStack; - } - } - - /** - * Gets an Instance of The Entity Potion used for Throwing. - * - * @param itemStack - * @param world - * @param player - * @return ? extends EntityPotion. Does not Return Null - */ - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPotion(world, player, itemStack); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/718b72a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/718b72a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index cb6b027..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/718b72a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,11 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; - -public class EntityHorseDarkBrown extends EntityHorseBase{ - - public EntityHorseDarkBrown(World par1World) { - super(par1World); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80305be6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80305be6c42100141fce95f06aba7e85 deleted file mode 100644 index 6650835..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80305be6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world.dataobjects; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.mobs.entity.EntityHauntedArmor; - -public class HauntedArmorWithMeta extends BlockWithMeta { - - public HauntedArmorWithMeta() { - super(Blocks.air); - } - - @Override - public void placeBlock(World world, ChunkCoordinates position, Random random) { - if (!world.isRemote) { - /* Place Air cause we don't want to spawn Inside something */ - world.setBlock(position.posX, position.posY, position.posZ, block); - - /* Spawn Mimic */ - EntityHauntedArmor mob = new EntityHauntedArmor(world, position.posX + 0.5, position.posY, - position.posZ + 0.5, true); - mob.onSpawnWithEgg(null); - mob.setPersistenceRequired(true); - world.spawnEntityInWorld(mob); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/804efcf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/804efcf4c42100141fce95f06aba7e85 deleted file mode 100644 index 7a7f9b1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/804efcf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,53 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import java.util.Collection; -import java.util.Iterator; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.potion.PotionEffect; - -public class PotionCurse extends PotionZulu { - - public PotionCurse(int par1, boolean par2, int par3) { - super(par1, par2, par3); - - setIconIndex(2, 0); - setEffectiveness(0.25D); - } - - @Override - public void performEffect(EntityLivingBase effectedEntity, int par2) { - - /* Get Active Potion effect Collection from Entity */ - Collection potionEffects = effectedEntity.getActivePotionEffects(); - - /* Get Number of potion Effects, then get a random number between 0 - num */ - int numOfElemenents = potionEffects.size(); - /* Check if we Should Try to Get a PotionEffect, proportional to Potion Strength */ - if ((par2 + 1) * 25 + 25 - effectedEntity.getRNG().nextInt(100) >= 0) { - - /* Element to Erase */ - int elementToAct = numOfElemenents > 0 ? effectedEntity.worldObj.rand.nextInt(numOfElemenents) : 0; - Iterator iterator = potionEffects.iterator(); - - /* Get Specific Element and assuming its not the Current Potion ID, mark it for Removal */ - int i = 0; - PotionEffect potionEffectToPerform = null; - while (iterator.hasNext() && i <= elementToAct) { - potionEffectToPerform = (PotionEffect) iterator.next(); - if (i == elementToAct && !effectedEntity.worldObj.isRemote && potionEffectToPerform != null - && potionEffectToPerform.getPotionID() != id) { - potionEffectToPerform.performEffect(effectedEntity); - break; - } - i++; - } - } - } - - @Override - public boolean isReady(int par1, int par2) { - int var3 = 25 >> par2; - return var3 > 0 ? par1 % var3 == 0 : true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80a3c7f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80a3c7f7c42100141fce95f06aba7e85 deleted file mode 100644 index c37a2eb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80a3c7f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,55 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import com.ngb.projectzulu.common.api.ItemList; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; - -public class CoconutCraftingHandler { - - @SubscribeEvent - public void onCrafting(ItemCraftedEvent event) { - ItemStack item = event.crafting; - IInventory craftMatrix = event.craftMatrix; - // FMLCommonHandler.instance().bus().register(this); - /* - * This onCrafting Handle is for Sword and Coconut Recipe 0-1-2 3-4-5 6-7-8 - */ - /* Check if Result is leather */ - boolean isResultDesired = item.getItem() == ItemList.coconutSeed.get(); - if (!isResultDesired) - return; - - boolean inventoryValidSize = craftMatrix.getSizeInventory() > 4; - if (!inventoryValidSize) - return; - - ItemStack shouldBeSword = craftMatrix.getStackInSlot(1); - ItemStack shouldBeCoconut = craftMatrix.getStackInSlot(4); - - if (shouldBeSword != null - && shouldBeCoconut != null - && (shouldBeSword.getItem() == Items.wooden_sword || shouldBeSword.getItem() == Items.stone_sword - || shouldBeSword.getItem() == Items.iron_sword || shouldBeSword.getItem() == Items.golden_sword || shouldBeSword - .getItem() == Items.diamond_sword) && ItemList.coconutItem.isPresent() - && shouldBeCoconut.getItem() == ItemList.coconutItem.get()) { - /* Stacksize of placed must not be 1, as the 'recipe' will consume 1 of whatever item is present in matrix */ - /* Increase Sword */ - shouldBeSword.setItemDamage(shouldBeSword.getItemDamage() + 1); - shouldBeSword.stackSize += 1; - - /* Place Coconut Milk */ - if (ItemList.coconutMilkFragment.isPresent()) { - ItemStack tempMilk = new ItemStack(ItemList.coconutMilkFragment.get(), 2); - craftMatrix.setInventorySlotContents(3, tempMilk); - } - /* Place Coconut Shell */ - if (ItemList.coconutShell.isPresent()) { - ItemStack tempShell = new ItemStack(ItemList.coconutShell.get(), 2); - craftMatrix.setInventorySlotContents(5, tempShell); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80ad53ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80ad53ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index c46fe74..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/80ad53ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,38 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.util.Random; - -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; - -public class BlueprintLabyrinthRandomWall implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - - if ((piecePos.posY == 0)) {// || piecePos.posY == cellHeight - 1)) { - return new BlockWithMeta(Blocks.stonebrick, 0); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 2); - } else if (10 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.stonebrick, 1); - } else if (5 - random.nextInt(100) >= 0) { - return new BlockWithMeta(Blocks.air); - } else { - return new BlockWithMeta(Blocks.stonebrick, 0); - } - } - - @Override - public int getWeight() { - return 4; - } - - @Override - public String getIdentifier() { - return "labyrinthrandomwall"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/8197bee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/8197bee4c42100141fce95f06aba7e85 deleted file mode 100644 index 7717a0a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/8197bee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,345 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.ai.attributes.ServersideAttributeMap; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ObfuscationHelper; -import projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.CharMatcher; - -public class CreatureFields implements DataFields { - private boolean isEnabled = true; - private GuiSaveableTextField creatureNameField; - private GuiSaveableTextField soundNameField; - private GuiSaveableTextField weightedChanceField; - private GuiSaveableTextField optionalParameter; - - private GUIEditNodeTextField selectedTagField; - - /* Holds Data Loaded From Entity in the Spawner System Passed */ - private NBTTagCompound loadedNBT = null; - private GuiButton searchForEntity; - private GuiButton searchForSound; - - private GuiButton resetNBTList; - private GuiButton saveCurNBT; - private GuiButton discardCurNBT; - - private GUINBTList nbtList; - private NBTTree nbtTree; - public Minecraft mc; - Point screenSize; - Point backgroundSize; - - public static final ResourceLocation CREATURE_LIST = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - CreatureFields(Minecraft mc) { - this.mc = mc; - } - - @Override - public DataFields createFields(Minecraft mc, int screenWidth, int screenHeight, Point backgroundSize) { - if (creatureNameField == null) { - creatureNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(mc.fontRenderer, 2, new Point(screenWidth, screenHeight), - backgroundSize, new Point(206, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(mc.fontRenderer, 60, new Point(screenWidth, screenHeight), - backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(mc.fontRenderer, 2400, new Point(screenWidth, screenHeight), - backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } else { - creatureNameField = new GuiSaveableTextField(creatureNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 30 - 3), new Point(116, 18)); - soundNameField = new GuiSaveableTextField(soundNameField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(82, 55 - 6), new Point(116, 18)); - weightedChanceField = new GuiSaveableTextField(weightedChanceField, mc.fontRenderer, 2, new Point( - screenWidth, screenHeight), backgroundSize, new Point(205, 39 + 42 - 9), new Point(20, 18)); - selectedTagField = new GUIEditNodeTextField(selectedTagField, mc.fontRenderer, 60, new Point(screenWidth, - screenHeight), backgroundSize, new Point(8, 181), new Point(116, 18)); - optionalParameter = new GuiSaveableTextField(optionalParameter, mc.fontRenderer, 2400, new Point( - screenWidth, screenHeight), backgroundSize, new Point(34, 39 + 42 - 9), new Point(116, 18)); - } - - searchForEntity = new GuiButton(1, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 - 15 - 3, 20, 20, "..."); - searchForSound = new GuiButton(2, (screenWidth - backgroundSize.getX()) / 2 + 201, - (screenHeight - backgroundSize.getY()) / 2 + 38 + 10 - 6, 20, 20, "..."); - resetNBTList = new GuiButton(3, (screenWidth - backgroundSize.getX()) / 2 + 78, - (screenHeight - backgroundSize.getY()) / 2 + 219, 70, 20, "Recreate NBT"); - - saveCurNBT = new GuiButton(4, (screenWidth - backgroundSize.getX()) / 2 + 151, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Save"); - discardCurNBT = new GuiButton(5, (screenWidth - backgroundSize.getX()) / 2 + 187, - (screenHeight - backgroundSize.getY()) / 2 + 175, 34, 20, "Abort"); - - if (nbtList != null) { - nbtList = new GUINBTList(this, mc, nbtTree, 214, new Point(screenWidth, screenHeight), backgroundSize); - } - this.screenSize = new Point(screenWidth, screenHeight); - this.backgroundSize = backgroundSize; - return this; - } - - @Override - public void loadFromTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner, int elementID) { - if (limitedMobSpawner.getSpawnList() != null && limitedMobSpawner.getSpawnList().size() > elementID - 1) { - TileEntityLimitedMobSpawnData spawnEntryData = (limitedMobSpawner.getSpawnList().get(elementID - 1)); - if (spawnEntryData.type.length() > 0) { - creatureNameField.setText(spawnEntryData.type); - weightedChanceField.setText(Integer.toString(spawnEntryData.itemWeight)); - optionalParameter.setText(spawnEntryData.optionalParameters); - loadedNBT = (NBTTagCompound) spawnEntryData.properties.copy(); - if (loadedNBT != null) { - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - soundNameField.setText(spawnEntryData.spawnSound); - setIsEnabled(true); - } - } - } - - @Override - public void saveToTileEntity(TileEntityLimitedMobSpawner limitedMobSpawner) { - if (isEnabled() && isEntryValid()) { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("Type", creatureNameField.getText()); - nbt.setInteger("Weight", Integer.parseInt(weightedChanceField.getText())); - nbt.setTag("Properties", nbtTree.toNBTTagCompound()); - nbt.setString("SpawnSound", soundNameField.getText()); - nbt.setString("OptionalParameter", optionalParameter.getText()); - limitedMobSpawner.getSpawnList().add(new TileEntityLimitedMobSpawnData(limitedMobSpawner, nbt)); - } - } - - private boolean isEntryValid() { - if (nbtTree == null) { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid NBT data"); - return false; - } else if (creatureNameField.getText().length() > 0 - && EntityList.stringToClassMapping.containsKey(creatureNameField.getText()) - && weightedChanceField.getText().length() > 0) { - return true; - } else { - ProjectZuluLog.info("Rejecting Mob Spawner Entry due to Invalid data"); - return false; - } - } - - public void setDataFromList(String data, ListType listType) { - switch (listType) { - case Creature: - creatureNameField.setText(data); - resetNBTList(); - break; - case Sound: - soundNameField.setText(data); - break; - default: - break; - } - } - - private void resetNBTList() { - EntityLivingBase desiredEntity = (EntityLivingBase) EntityList.createEntityByName(creatureNameField.getText(), - Minecraft.getMinecraft().theWorld); - if (desiredEntity != null) { - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_110155_d", EntityLivingBase.class, - desiredEntity, true, new ServersideAttributeMap()); - } catch (Exception e) { - ObfuscationHelper.setFieldUsingReflection("attributeMap", EntityLivingBase.class, desiredEntity, true, - new ServersideAttributeMap()); - } - ObfuscationHelper.invokeMethod("applyEntityAttributes", "func_110147_ax", EntityLivingBase.class, - desiredEntity); - loadedNBT = new NBTTagCompound(); - desiredEntity.writeToNBT(loadedNBT); - nbtTree = new NBTTree(loadedNBT, "Properties"); - nbtList = new GUINBTList(this, mc, nbtTree, 214, screenSize, backgroundSize); - } - } - - public void setSelectedCurentNode(NBTNode tag) { - selectedTagField.setSelectedNode(tag); - } - - @Override - public void setIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - } - - @Override - public boolean isEnabled() { - return isEnabled; - } - - @Override - public boolean keyboardInput(char keyChar, int keyID) { - if (isEnabled) { - if (creatureNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (weightedChanceField.textboxKeyTyped(keyChar, keyID)) { - String originalString = weightedChanceField.getText(); - String newString = CharMatcher.anyOf("0123456789").retainFrom(weightedChanceField.getText()); - if (!originalString.equals(newString)) { - weightedChanceField.setText(newString); - } - return true; - } else if (soundNameField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (selectedTagField.textboxKeyTyped(keyChar, keyID)) { - return true; - } else if (optionalParameter.textboxKeyTyped(keyChar, keyID)) { - return true; - } - } - return false; - } - - @Override - public void mouseClicked(GuiLimitedMobSpawner spawnerGUI, Minecraft mc, int par1, int par2, int par3) { - if (isEnabled) { - creatureNameField.mouseClicked(par1, par2, par3); - weightedChanceField.mouseClicked(par1, par2, par3); - soundNameField.mouseClicked(par1, par2, par3); - selectedTagField.mouseClicked(par1, par2, par3); - optionalParameter.mouseClicked(par1, par2, par3); - - if (par3 == 0 && searchForEntity.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Creature) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Creature); - } - // Used to random.click, leaving this as note during porting in case gui.button.press is wrong - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.8F)); - } - - if (par3 == 0 && searchForSound.mousePressed(mc, par1, par2)) { - if (spawnerGUI.currentListType == ListType.Sound) { - spawnerGUI.closeList(); - } else { - spawnerGUI.openList(ListType.Sound); - } - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - - if (par3 == 0 && resetNBTList.mousePressed(mc, par1, par2)) { - resetNBTList(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - if (par3 == 0 && saveCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled() && nbtTree != null) { - selectedTagField.saveAndClear(nbtTree); - nbtList.recreateNodeList(); - loadedNBT = nbtTree.toNBTTagCompound(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - if (par3 == 0 && discardCurNBT.mousePressed(mc, par1, par2)) { - if (selectedTagField.isEnabled()) { - selectedTagField.clear(); - this.mc.getSoundHandler().playSound( - PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } - } - - @Override - public void mouseHover(int par1, int par2, int par3) { - if (isEnabled) { - - } - } - - @Override - public void render(Minecraft mc, int par1, int par2, float par3, Point screenSize, Point backgroundSize) { - if (nbtList != null) { - nbtList.drawScreen(screenSize, backgroundSize, par1, par2, par3); - } - - resetNBTList.drawButton(mc, par1, par2); - saveCurNBT.drawButton(mc, par1, par2); - discardCurNBT.drawButton(mc, par1, par2); - searchForEntity.drawButton(mc, par1, par2); - searchForSound.drawButton(mc, par1, par2); - - mc.fontRenderer.drawString("Name", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 - 15 - 3, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Sound", (screenSize.getX() - backgroundSize.getX()) / 2 + 48, - (screenSize.getY() - backgroundSize.getY()) / 2 + 48 + 10 - 6, 4210752); // White: 16777215 - mc.fontRenderer.drawString("Weight", (screenSize.getX() - backgroundSize.getX()) / 2 + 168, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - mc.fontRenderer.drawString("Tags", (screenSize.getX() - backgroundSize.getX()) / 2 + 6, - (screenSize.getY() - backgroundSize.getY()) / 2 + 74, 4210752); - - bindTexture(mc); - drawBackgroundBox(new Point(80, 20), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(80, 42), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - drawBackgroundBox(new Point(201, 48 + 25 - 9), screenSize, backgroundSize, new Point(236, 0), new Point(20, 20)); - drawBackgroundBox(new Point(32, 48 + 25 - 9), screenSize, backgroundSize, new Point(136, 66), - new Point(120, 20)); - if (selectedTagField.isEnabled()) { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 66), new Point(120, 20)); - } else { - drawBackgroundBox(new Point(6, 175), screenSize, backgroundSize, new Point(136, 89), new Point(120, 20)); - } - - creatureNameField.drawTextBox(); - soundNameField.drawTextBox(); - weightedChanceField.drawTextBox(); - selectedTagField.drawTextBox(); - optionalParameter.drawTextBox(); - } - - private void bindTexture(Minecraft mc) { - mc.renderEngine.bindTexture(CREATURE_LIST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - - private void drawBackgroundBox(Point position, Point screenSize, Point backgroundSize, Point imageLocation, - Point imageSize) { - int xCoord = (screenSize.getX() - backgroundSize.getX()) / 2 + position.getX(); - int yCoord = (screenSize.getY() - backgroundSize.getY()) / 2 + position.getY(); - this.drawTexturedModalRect(xCoord, yCoord, imageLocation.getX(), imageLocation.getY(), imageSize.getX(), - imageSize.getY()); - } - - /** - * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height - */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - float zLevel = 0; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - var9.addVertexWithUV(par1 + 0, par2 + par6, zLevel, (par3 + 0) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + par6, zLevel, (par3 + par5) * var7, (par4 + par6) * var8); - var9.addVertexWithUV(par1 + par5, par2 + 0, zLevel, (par3 + par5) * var7, (par4 + 0) * var8); - var9.addVertexWithUV(par1 + 0, par2 + 0, zLevel, (par3 + 0) * var7, (par4 + 0) * var8); - var9.draw(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/908b8df8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/908b8df8c42100141fce95f06aba7e85 deleted file mode 100644 index 2d2a6a5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/908b8df8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,87 +0,0 @@ -package com.ngb.projectzulu.common.mobs.renders; - -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; - -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.mobs.entity.EntityLizardSpit; - -public class RenderLizardSpit extends Render implements RenderWrapper { - private float field_77002_a; - - public RenderLizardSpit(float par1) { - this.field_77002_a = par1; - } - - public void doRenderLizardSpit(EntityLizardSpit par1EntityLizardSpit, double par2, double par4, double par6, - float par8, float par9) { - - IIcon icon; - if (ItemList.genericCraftingItems.isPresent()) { - icon = ItemGenerics.Properties.LizardSpit.getIcon(); - } else { - icon = Items.fire_charge.getIconFromDamage(0); - } - if (icon != null) { // Icon only null if ItemGenerics is disabled, TODO more elegant solution - GL11.glPushMatrix(); - this.bindEntityTexture(par1EntityLizardSpit); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); - - Tessellator var12 = Tessellator.instance; - float var13 = icon.getMinU(); - float var14 = icon.getMaxU(); - float var15 = icon.getMinV(); - float var16 = icon.getMaxV(); - float var17 = 1.0F; - float var18 = 0.5F; - float var19 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); - var12.startDrawingQuads(); - var12.setNormal(0.0F, 1.0F, 0.0F); - var12.addVertexWithUV((double) (0.0F - var18), (double) (0.0F - var19), 0.0D, (double) var13, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (0.0F - var19), 0.0D, (double) var14, - (double) var16); - var12.addVertexWithUV((double) (var17 - var18), (double) (1.0F - var19), 0.0D, (double) var14, - (double) var15); - var12.addVertexWithUV((double) (0.0F - var18), (double) (1.0F - var19), 0.0D, (double) var13, - (double) var15); - var12.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/a03ce1fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/a03ce1fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index e33e777..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/a03ce1fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityHorseRandom; -import projectzulu.common.mobs.models.ModelHorse; -import projectzulu.common.mobs.renders.RenderGenericHorse; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/a0b0b2e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/a0b0b2e4c42100141fce95f06aba7e85 deleted file mode 100644 index c5486e6..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/a0b0b2e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,59 +0,0 @@ -package projectzulu.common.core.terrain; - -import java.io.File; -import java.util.Random; -import java.util.concurrent.ConcurrentHashMap; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.core.terrain.TerrainFeature.Size; -import cpw.mods.fml.common.IWorldGenerator; - -public class FeatureGenerator implements IWorldGenerator { - - /** Mapping From FeatureName to feature instance. Feature name is in lower case */ - private ConcurrentHashMap structures = new ConcurrentHashMap(); - - public void registerStructure(TerrainFeature... feature) { - for (TerrainFeature terrainFeature : feature) { - structures.put(terrainFeature.getFeatureName().toLowerCase(), terrainFeature); - } - } - - public TerrainFeature getRegisteredStructure(String featureName) { - return structures.get(featureName.toLowerCase()); - } - - public void initialize(File modConfigDirectory) { - for (TerrainFeature terrainFeature : structures.values()) { - terrainFeature.initialize(modConfigDirectory); - } - } - - @Override - public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, - IChunkProvider chunkProvider) { - - for (Size featureSize : Size.values()) { - for (TerrainFeature terrainFeature : structures.values()) { - if (terrainFeature.getFeatureSize() != featureSize) { - continue; - } - - ChunkCoordinates[] coords = terrainFeature.getGenerationCoordinates(world, chunkX, chunkZ); - boolean generated = false; - for (ChunkCoordinates genWorldCoords : coords) { - if (terrainFeature.canGenerateHere(world, chunkX, chunkZ, genWorldCoords, random)) { - terrainFeature.generateFeature(world, chunkX, chunkZ, genWorldCoords, random, FeatureDirection.CENTERED); - generated = true; - } - } - if (generated) { - return; - } - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/b17c5c9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/b17c5c9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e11d92c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/b17c5c9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.mobs.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.mobs.entity.EntityGenericCreature; - -public class PacketAnimTime implements PZPacket { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/c078efa0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/c078efa0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 9dff344..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/c078efa0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/c15219a2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/c15219a2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d1e94ed..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/c15219a2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,16 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockBrewingStandSingle extends BlockBrewingStandBase { - - public BlockBrewingStandSingle(int renderID) { - super(renderID); - } - - @Override - public TileEntity createNewTileEntity(World world, int var2) { - return new TileEntityBrewingSingle(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d134cf01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d134cf01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index a272393..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/d134cf01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,82 +0,0 @@ -package com.ngb.projectzulu.common.world2.buildingmanager; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.core.terrain.TerrainFeature.FeatureDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.architect.ArchitectCemetary; -import projectzulu.common.world2.randomizer.Randomizer; -import projectzulu.common.world2.randomizer.SelectedFewRandomizer; - -public class BuildingManagerCemetary extends BuildingManagerBase { - - public ArchitectCemetary architect; - public Randomizer randomizer; - - MazeCell[][] cemetary; - - public BuildingManagerCemetary(World world, ChunkCoordinates startingPos, FeatureDirection direction) { - super(world); - architect = new ArchitectCemetary(world); - randomizer = new SelectedFewRandomizer(world.rand, 3, 10, false); - - int xCells = 6; - int zCells = 6; - int cellSize = 3; - int cellHeight = 5; - startingPos = calcTranslatedPosition(direction, startingPos, xCells * cellSize, zCells * cellSize, cellHeight); - - cemetary = new MazeCell[xCells][zCells]; - for (int i = 0; i < cemetary.length; i++) { - for (int j = 0; j < cemetary[0].length; j++) { - cemetary[i][j] = new MazeCell(cellSize, cellHeight, new ChunkCoordinates(startingPos.posX + cellSize - * i, startingPos.posY, startingPos.posZ + cellSize * j)); - } - } - } - - @Override - protected void randomizeCells() { - randomizer.randomize(cemetary); - } - - @Override - protected void assignBlueprints(int pass, int maxPass) { - if (pass == maxPass) { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - architect.assignBlueprint(cemetary, new Point(cellX, cellZ), pass, maxPass); - } - } - } - } - - @Override - protected void construct() { - for (int cellX = 0; cellX < cemetary.length; cellX++) { - for (int cellZ = 0; cellZ < cemetary[0].length; cellZ++) { - MazeCell currentCell = cemetary[cellX][cellZ]; - processCellPieces(currentCell, architect); - } - } - } - - @Override - protected void handleBlockPlacement(BlockWithMeta blockWithMeta, ChunkCoordinates position, Random random) { - Block blockAt = world.getBlock(position.posX, position.posY, position.posZ); - if (blockWithMeta.block.equals(Blocks.air) && blockAt.equals(Block.getBlockFromName("snow"))) { - return; - } - if (blockAt.getMaterial().equals(Material.wood) || blockAt.getMaterial().equals(Material.leaves)) { - return; - } - super.handleBlockPlacement(blockWithMeta, position, random); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/f0bf45fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/f0bf45fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 2a2f4f1..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fa/f0bf45fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,139 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import net.minecraft.client.audio.PositionedSoundRecord; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; -import org.lwjgl.util.Point; - -import projectzulu.common.core.DefaultProps; - -public class GUISelectionList extends GuiScrollingList { - - private GuiLimitedMobSpawner parent; - // private List> listNames; - ListType listType; - int selectedElement = -1; - - Node currentNode; - GuiButton previous; - public static final ResourceLocation CREATURE_GUI = new ResourceLocation(DefaultProps.dungeonKey, - "creaturelistgui.png"); - - public GUISelectionList(GuiLimitedMobSpawner parent, Node rootSoundNode, ListType listType, int listWidth, - Point screenSize, Point backgroundSize) { - super(parent.getMinecraft(), listWidth, backgroundSize.getY() + 50, // Width, Height - (screenSize.getY() - backgroundSize.getY()) / 2 + 25, (screenSize.getY() - backgroundSize.getY()) / 2 - + backgroundSize.getY() - 20, // Top, Bottom, - (screenSize.getX() - backgroundSize.getX()) / 2 + 234, // Left - parent.getMinecraft().fontRenderer.FONT_HEIGHT + 8); // Element Height - this.parent = parent; - this.currentNode = rootSoundNode; - this.listType = listType; - previous = new GuiButton(ButtonIDs.BACKWARDS.index, screenSize.getX() / 2 + 106, - (screenSize.getY() + backgroundSize.getY()) / 2 - 240, 85, 20, "Parent Dir."); - } - - @Override - protected int getSize() { - return currentNode.numberOfChildren(); - } - - @Override - protected void elementClicked(int clickedIndex, boolean var2) { - // TODO: update for Node - Node childNode = currentNode.getChild(clickedIndex); - if (childNode.numberOfChildren() > 0) { - currentNode = childNode; - } else { - if (parent.getDataField(parent.currentDataField) instanceof CreatureFields) { - ((CreatureFields) parent.getDataField(parent.currentDataField)).setDataFromList( - currentNode.getChild(clickedIndex).getFullName(), listType); - parent.closeList(); - } - } - // if(parent.getDataField(parent.currentDataField) instanceof CreatureFields){ - // ((CreatureFields)parent.getDataField(parent.currentDataField)).setDataFromList(listNames.get(clickedIndex).getFullName(), - // listType); - // parent.closeList(); - // } - // selectedElement = clickedIndex; - } - - @Override - protected boolean isSelected(int selectedIndex) { - return selectedIndex == selectedElement; - } - - @Override - protected void drawBackground() { - parent.getMinecraft().renderEngine.bindTexture(CREATURE_GUI); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - int xCoord = (parent.width - parent.backgroundSize.getX()) / 2 + 230; // 277 - int yCoord = (parent.height - parent.backgroundSize.getY()) / 2; - parent.drawTexturedModalRect(xCoord, yCoord, 0, 0, 91, 244); - } - - @Override - protected int getContentHeight() { - return (this.getSize()) * slotHeight;// + 35*2 + 1; - } - - @Override - protected void drawSlot(int listIndex, int var2, int var3, int var4, Tessellator tessellator) { - if (currentNode.numberOfChildren() <= listIndex) { - return; - } - String renderString = currentNode.getChild(listIndex).getName(); // (160 << 16) + (145 << 8) + 114) - boolean addDirTag = currentNode.getChild(listIndex).numberOfChildren() != 0; - renderString = addDirTag ? "D:" + renderString : renderString; - renderString = renderString.length() > 13 ? renderString.substring(0, 13) : renderString; - parent.drawString(parent.getMinecraft().fontRenderer, renderString, this.left + 3, var3 + 2, 16777215); // Red: - // 0xFF2222 - // //Blck: - // 4210752 - } - - public void drawScreen(Point screenSize, Point backgroundSize, int mouseX, int mouseY, float p_22243_3_) { - super.drawScreen(mouseX, mouseY, p_22243_3_); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - drawScrollOverlay(this.left, (screenSize.getY() - backgroundSize.getY()) / 2 + 4, this.top, 255, 255); // Top - // Overlay - drawScrollOverlay(this.left, this.bottom, - (screenSize.getY() - backgroundSize.getY()) / 2 + backgroundSize.getY() - 4, 255, 255); // Bot Overlay - // GL11.glEnable(GL11.GL_DEPTH_TEST); - // GL11.glDisable(GL11.GL_TEXTURE_2D); - previous.drawButton(parent.getMinecraft(), mouseX, mouseY); - } - - private void drawScrollOverlay(int leftOffset, int topHeight, int botHeight, int alphaBottom, int alphaTop) { - Tessellator var5 = Tessellator.instance; - GL11.glBindTexture(GL11.GL_TEXTURE_2D, parent.getMinecraft().renderEngine.getTexture(getBackgroundTexture()) - .getGlTextureId()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float imageSize = 32.0F; - var5.startDrawingQuads(); - // var5.setColorRGBA_I(4210752, alphaTop); - var5.addVertexWithUV(leftOffset, botHeight, 0.0D, 0.0D, botHeight / imageSize); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, botHeight, 0.0D, (this.listWidth) / imageSize, - botHeight / imageSize); - // var5.setColorRGBA_I(4210752, alphaBottom); - var5.addVertexWithUV(leftOffset + (double) this.listWidth, topHeight, 0.0D, (this.listWidth) / imageSize, - topHeight / imageSize); - var5.addVertexWithUV(leftOffset, topHeight, 0.0D, 0.0D, topHeight / imageSize); - var5.draw(); - } - - public void mouseClicked(int par1, int par2, int par3) { - if (par3 == 0 && previous.mousePressed(parent.getMinecraft(), par1, par2)) { - if (currentNode.getParent() != null) { - currentNode = currentNode.getParent(); - parent.getMinecraft().getSoundHandler() - .playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); - } - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/01ef91ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/01ef91ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 857b836..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/01ef91ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,21 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import projectzulu.common.ProjectZulu_Core; - -public class BlockPalmTreePlank extends Block { - - public BlockPalmTreePlank() { - super(Material.wood); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - setHardness(2.0F); - setResistance(5.0F); - } - - @Override - public boolean isOpaqueCube() { - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/11709a9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/11709a9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f781967..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/11709a9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,44 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import projectzulu.common.api.PotionList; -import projectzulu.common.api.SubItemPotionList; -import projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public class SubItemPotionHeal extends SubItemPotionGeneric { - - public SubItemPotionHeal(Item itemID, int subID) { - super(itemID, subID, "potion.heal2"); - setSubItemBounds(4, 1, 4, 0); - setEffectScale(20 * 10, 20 * 5, 16, 10, 2); - } - - @Override - Optional getPotion() { - return PotionList.heal2; - } - - @Override - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.fermented_spider_eye) { - return TYPE.CHEMICAL; - } else { - return super.getIngredientType(ingredient, brewingStack); - } - } - - @Override - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - if (SubItemPotionList.HARM.isPresent()) { - SubItemPotion subItemPotion = SubItemPotionList.HARM.get(); - return new ItemStack(subItemPotion.item, 1, PotionParser.setID(subItemPotion.subID, - brewingStack.getItemDamage())); - } - return null; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/203c30fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/203c30fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d749173..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/203c30fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,111 +0,0 @@ -//package com.ngb.projectzulu.common.core; -// -//import java.util.EnumSet; -//import java.util.HashMap; -// -//import projectzulu.common.core.packets.PacketPlaySound; -//import projectzulu.common.core.packets.PacketStreamSound; -//import projectzulu.common.dungeon.packets.PacketMobSpawner; -//import projectzulu.common.mobs.packets.PacketAnimTime; -//import projectzulu.common.mobs.packets.PacketFollowerMasterData; -// -//public enum PacketIDs { -// /* PacketID: Unknown Packet, send a Warning */ -// unknown(0) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Temperature Packet */ -// temperature(1) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* PacketID: Update Tile Entity Text [C->S] */ -// tileEntityText(2) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Centipede Followers --> Master */ -// followerMasterData(3) { -// @Override -// public PacketFollowerMasterData createPacketManager() { -// return new PacketFollowerMasterData(index); -// } -// }, -// /* Packet: Sync Entity Name to Server from GUI */ -// entityNameSync(4) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Perform EntityGenericTameable Taming Effect */ -// tameParticleEffect(5) { -// @Override -// public PacketManager createPacketManager() { -// return null; -// } -// }, -// /* Packet: Sync Entity Animation Time */ -// animTime(6) { -// @Override -// public PacketAnimTime createPacketManager() { -// return new PacketAnimTime(index); -// } -// }, -// /* Packet: Sync Mob Spawner Settings From Client to Server */ -// mobSpawner(7) { -// @Override -// public PacketMobSpawner createPacketManager() { -// return new PacketMobSpawner(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// playSound(8) { -// @Override -// public PacketPlaySound createPacketManager() { -// return new PacketPlaySound(index); -// } -// }, -// /* Packet: Sync Sound to Play from Server to Client */ -// streamSound(9) { -// @Override -// public PacketStreamSound createPacketManager() { -// return new PacketStreamSound(index); -// } -// }; -// -// public final int index; -// -// public int index() { -// return index; -// } -// -// private static final HashMap lookupEnum = new HashMap(); -// static { -// for (PacketIDs packetID : EnumSet.allOf(PacketIDs.class)) -// lookupEnum.put(packetID.index, packetID); -// } -// -// PacketIDs(int index) { -// this.index = index; -// } -// -// /* Return unknown if State Cannot be Found */ -// public static PacketIDs getPacketIDbyIndex(int index) { -// PacketIDs value = lookupEnum.get(index); -// if (value != null) { -// return value; -// } else { -// return unknown; -// } -// } -// -// public abstract T createPacketManager(); -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/20ab5000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/20ab5000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 717cec4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/20ab5000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,91 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsBase; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlock extends KeyParserBase { - - public KeyParserBlock(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - return isValidBlock(world, xCoord, yCoord, zCoord, typeValuePair, valueCache); - } - - /** - * Represents Restriction on isValidBlock. - * - * @return True if Operation should continue as normal, False if it should be disallowed - */ - private boolean isValidBlock(World world, int xCoord, int yCoord, int zCoord, TypeValuePair typeValuePair, - HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Integer xRange = (Integer) valueCache.get(Key.blockRangeX.key); - Integer yRange = (Integer) valueCache.get(Key.blockRangeY.key); - Integer zRange = (Integer) valueCache.get(Key.blockRangeZ.key); - - xRange = xRange == null ? OptionalSettingsBase.defaultBlockRange : xRange; - yRange = yRange == null ? OptionalSettingsBase.defaultBlockRange : yRange; - zRange = zRange == null ? OptionalSettingsBase.defaultBlockRange : zRange; - - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - for (int i = -xRange; i <= xRange; i++) { - for (int k = -zRange; k <= zRange; k++) { - for (int j = -yRange; j <= yRange; j++) { - Block blockID = world.getBlock(xCoord + i, yCoord + j, zCoord + k); - int meta = world.getBlockMetadata(xCoord + i, yCoord + j, zCoord + k); - if (blockID == searchBlock && metaValue.equals(meta)) { - return false; - } - } - } - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/3231f09fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/3231f09fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index e0669ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/3231f09fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,30 +0,0 @@ -package projectzulu.common.world2.blueprints.oasis; - -import java.util.Random; - -import net.minecraft.util.ChunkCoordinates; - -public class BPOasisEdgeRandomPoint extends BPOasisEdge { - boolean inverted; - - public BPOasisEdgeRandomPoint() { - super(false); - } - - public boolean isGrass(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random) { - if (piecePos.posZ > 0 || random.nextInt(3) == 0) { - return true; - } - return false; - } - - @Override - public int getWeight() { - return 1; - } - - @Override - public String childIdentifier() { - return "randompoint"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/4144239fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/4144239fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index f98a97a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/4144239fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityLizard; -import projectzulu.common.mobs.models.ModelLizard; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class LizardDeclaration extends SpawnableDeclaration { - public LizardDeclaration() { - super("Lizard", 2, EntityLizard.class, EnumCreatureType.monster); - setSpawnProperties(10, 100, 1, 1); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (114 << 16) + (102 << 8) + 74; - eggColor2 = (181 << 16) + (171 << 8) + 146; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scaleItem, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.PoisonDroplet.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 0.0f, 0.4f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelLizard(), 0.5f, new ResourceLocation(DefaultProps.mobKey, "lizard.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); - return defaultBiomesToSpawn; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/70d10efec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/70d10efec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f667c62..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/70d10efec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,98 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.entity.Render; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityTNTPrimed; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.api.BlockList; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class RenderCreeperBlossomPrimed extends Render implements RenderWrapper { - - private RenderBlocks blockRenderer = new RenderBlocks(); - - public RenderCreeperBlossomPrimed(float shadowSize) { - this.shadowSize = shadowSize; - } - - public void doRender(EntityCreeperBlossomPrimed par1EntityTNTPrimed, double par2, double par4, double par6, - float par8, float par9) { - par1EntityTNTPrimed.fuse = 39; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) par2, (float) par4, (float) par6); - float var10; - - if ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { - - var10 = 1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; - if (var10 < 0.0F) { - var10 = 0.0F; - } - - if (var10 > 1.0F) { - var10 = 1.0F; - } - - var10 *= var10; - var10 *= var10; - float var11 = 1.0F + var10 * 0.3F; - GL11.glScalef(var11, var11, var11); - } - var10 = (1.0F - ((float) par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; - this.bindEntityTexture(par1EntityTNTPrimed); - this.blockRenderer - .renderBlockAsItem(BlockList.creeperBlossom.get(), 2, par1EntityTNTPrimed.getBrightness(par9)); - if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); - GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); - this.blockRenderer.renderBlockAsItem(BlockList.creeperBlossom.get(), 0, 1.0F); // TODO: Commented Out To - // Debug Image - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - - GL11.glPopMatrix(); - } - - /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render entityClass) { - return new RenderGenericLiving(new ModelFinch(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "finch_red.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a10524f6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a10524f6c42100141fce95f06aba7e85 deleted file mode 100644 index 5309b52..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/a10524f6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.spawner.tag.OptionalParser; -import com.ngb.projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/b106c39fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/b106c39fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 775491d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/b106c39fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.BPScatteredTombstonesAndFlowers; -import projectzulu.common.world2.blueprints.BlueprintCemetaryEdge; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain; -import projectzulu.common.world2.blueprints.BlueprintCemetaryFountain2; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb; -import projectzulu.common.world2.blueprints.BlueprintCemeteryTomb2; - -public class ArchitectCemetary extends ArchitectBase { - BlueprintSet edge = new BPSetGenericEdge(new BlueprintCemetaryEdge()); - - public ArchitectCemetary(World world) { - super(world); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPScatteredTombstonesAndFlowers())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemeteryTomb2(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BlueprintCemetaryFountain(), 1)); - stockpile.addBlueprintSet(new BPSetGenericCarved(new BlueprintCemetaryFountain2())); - stockpile.addBlueprintSet(edge); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set; - if (edge.isApplicable(cells, buildCoords, random)) { - set = edge; - } else { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set = stockpile.getBlueprintSet(cell); - return set != null ? stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, - cell.getHeight(), cell.getDirection(), random, cell.getBuildingID()) : null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/e0fdd9f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/e0fdd9f8c42100141fce95f06aba7e85 deleted file mode 100644 index ee536f5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fb/e0fdd9f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,79 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.CustomMobData; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ConfigHelper; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ItemGenerics; -import com.ngb.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.ngb.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.ngb.projectzulu.common.mobs.entity.EntityHorseBeige; -import com.ngb.projectzulu.common.mobs.models.ModelHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.ngb.projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "Horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, "Horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/125aeee4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/125aeee4c42100141fce95f06aba7e85 deleted file mode 100644 index 4cdeb40..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/125aeee4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,36 +0,0 @@ -package projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserSpawnRange extends KeyParserBase { - - public KeyParserSpawnRange(Key key) { - super(key, false, KeyType.VALUE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - String[] pieces = parseable.split(","); - OptionalParser.parseSpawnRange(pieces, valueCache); - return true; - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - throw new UnsupportedOperationException(); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/20a917e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/20a917e4c42100141fce95f06aba7e85 deleted file mode 100644 index b352ddc..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/20a917e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,69 +0,0 @@ -package projectzulu.common.blocks.heads; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -public class ModelFoxHead extends ModelBase{ - - ModelRenderer CENTERROT; - private ModelRenderer HEADROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFoxHead() - { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - CENTERROT = new ModelRenderer(this, "CENTERROT"); - CENTERROT.setRotationPoint(0F, 21.5F, 0F); - setRotation(CENTERROT, 0F, 0F, 0F); - CENTERROT.mirror = true; - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 0F, 1F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - CENTERROT.addChild(HEADROT); - } - - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) - { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - CENTERROT.render(f5); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) - { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity){ - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - CENTERROT.rotateAngleY = f3 / (180F / (float)Math.PI); - } - - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/20e75da0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/20e75da0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 72fb9ec..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/20e75da0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,31 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockQuickSand; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class QuickSandDeclaration extends BlockDeclaration { - - public QuickSandDeclaration() { - super("QuickSand"); - } - - @Override - protected boolean createBlock() { - BlockList.quickSand = Optional.of(new BlockQuickSand().setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.quickSand.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/2192929dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/2192929dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 7b6d49d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/2192929dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,17 +0,0 @@ -package projectzulu.common.api; - -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public enum PotionList { - INSTANCE; - public static Optional bubbling = Optional.absent(); - public static Optional incendiary = Optional.absent(); - public static Optional slowfall = Optional.absent(); - public static Optional cleansing = Optional.absent(); - public static Optional curse = Optional.absent(); - public static Optional thorn = Optional.absent(); - public static Optional heal2 = Optional.absent(); - public static Optional harm2 = Optional.absent(); -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/30e64ef6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/30e64ef6c42100141fce95f06aba7e85 deleted file mode 100644 index dce11e7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/30e64ef6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,161 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import scala.annotation.meta.param; - -public class Node implements Comparable { - private Node parent; - private String name; - private List children = new ArrayList(); - - public Node(Node parent, String data) { - this.parent = parent; - parseDataForNode(data); - parseDataForChild(data); - } - - public Node getParent() { - return parent; - } - - public String getName() { - return name; - } - - /** - * Return Node name Concated after the name of its Parent(s) - * - * @return - */ - public String getFullName() { - return prefixParents(name); - } - - private String prefixParents(String name) { - if (parent != null && parent.parent != null && parent.parent.name.equals("root")) { - return parent.prefixParents(parent.name + ":" + name); - } else if (parent != null && !parent.name.equals("root")) { - return parent.prefixParents(parent.name + "." + name); - } else { - return name; - } - } - - public boolean addChild(String data) { - parseDataForChild(data); - return true; - } - - public Node getChild(int index) { - return children.get(index); - } - - public int numberOfChildren() { - return children.size(); - } - - public void sortNodeTree() { - Collections.sort(children); - for (Node child : children) { - child.sortNodeTree(); - } - } - - /** - * Return true if Name is Parsed from Data - */ - private boolean parseDataForNode(String data) { - String[] stringSplitData = data.split("\\.", 2); - this.name = stringSplitData[0]; - return true; - } - - /** - * Return true if Child is added from Data - */ - private boolean parseDataForChild(String data) { - String[] stringSplitData = data.split("\\.", 2); - if (stringSplitData.length < 2) { - return false; - } - String[] stringSplitChild = stringSplitData[1].split("\\.", 2); - - String childName = stringSplitChild[0]; - for (Node child : children) { - if (child.name.equals(childName)) { - child.addChild(stringSplitData[1]); - return true; - } - } - children.add(new Node(this, stringSplitData[1])); - return true; - } - - @Override - public boolean equals(Object otherObj) { - if (this == otherObj) { - return true; - } - if (otherObj == null) { - return false; - } - if (getClass() != otherObj.getClass()) { - return false; - } - - Node otherNode = (Node) otherObj; - - if (children == null) { - if (otherNode.children != null) { - return false; - } - } else if (!children.equals(otherNode.children)) { - return false; - } - - if (name == null) { - if (otherNode.name != null) { - return false; - } - } else if (!name.equals(otherNode.name)) { - return false; - } - - if (parent == null) { - if (otherNode.parent != null) { - return false; - } - } else if (!parent.equals(otherNode.parent)) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((children == null) ? 0 : children.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((parent == null) ? 0 : parent.hashCode()); - return result; - } - - @Override - public int compareTo(Node node) { - if (node != null && node.children.size() > 0) { - if (children.size() > 0) { - return this.name.compareTo(node.name); - } else { - return +1; - } - } else if (this.children.size() > 0) { - return -1; - } - return this.name.compareTo(node.name); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/506d90f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/506d90f4c42100141fce95f06aba7e85 deleted file mode 100644 index 5506c54..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/506d90f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,160 +0,0 @@ -package com.ngb.projectzulu.common.world.terrain; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.IllegalFormatException; -import java.util.Iterator; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.material.Material; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.TerrainFeatureHelper; -import com.ngb.projectzulu.common.core.terrain.BiomeFeature; -import com.ngb.projectzulu.common.core.terrain.FeatureConfiguration; -import com.ngb.projectzulu.common.world2.buildingmanager.BuildingManagerLabyrinth; -import cpw.mods.fml.common.Loader; - -public class LabyrinthFeature extends BiomeFeature { - public static final String LABYRINTH = "Labyrinth"; - - private List entityEntries = new ArrayList(); - public int chestLootChance; - public int chestMaxLoot; - - public String getEntityEntry(Random rand) { - if (entityEntries.isEmpty()) { - return "EMPTY"; - } - return ((EntityEntry) WeightedRandom.getRandomItem(rand, entityEntries)).entityname; - } - - public LabyrinthFeature() { - super(LABYRINTH, Size.LARGE); - } - - @Override - protected void loadDefaultSettings() { - minChunkDistance = 9; - chunksPerSpawn = 100; - chestLootChance = 20; - chestMaxLoot = -1; - entityEntries.add(new EntityEntry("EMPTY", 4)); - if (Loader.isModLoaded(DefaultProps.MobsModId)) { - if (CustomEntityList.HAUNTEDARMOR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.HAUNTEDARMOR.modData.get().mobName), 3)); - } - if (CustomEntityList.MINOTAUR.modData.isPresent()) { - entityEntries.add(new EntityEntry(DefaultProps.CoreModId.concat(".").concat( - CustomEntityList.MINOTAUR.modData.get().mobName), 1)); - } - } else { - entityEntries.add(new EntityEntry("Zombie", 4)); - } - } - - @Override - protected Collection getDefaultBiomeList() { - return Arrays.asList(new String[] { BiomeGenBase.plains.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.extremeHills.biomeName, BiomeGenBase.forest.biomeName, BiomeGenBase.taiga.biomeName, - BiomeGenBase.swampland.biomeName, BiomeGenBase.river.biomeName, BiomeGenBase.icePlains.biomeName, - BiomeGenBase.iceMountains.biomeName, BiomeGenBase.desertHills.biomeName, - BiomeGenBase.forestHills.biomeName, BiomeGenBase.taigaHills.biomeName, - BiomeGenBase.extremeHillsEdge.biomeName, BiomeGenBase.jungle.biomeName, BiomeGenBase.desert.biomeName, - BiomeGenBase.jungleHills.biomeName, "Birch Forest", "Forested Island", "Forested Hills", "Green Hills", - "Mountain Taiga", "Pine Forest", "Rainforest", "Redwood Forest", "Lush Redwoods", "Snow Forest", - "Snowy Rainforest", "Temperate Rainforest", "Woodlands", "Mountainous Desert" }); - } - - @Override - protected void loadSettings(FeatureConfiguration config) { - super.loadSettings(config); - chestMaxLoot = config.getFeatureProperty(this, "general", "Chest Max Loot", chestMaxLoot).getInt(chestMaxLoot); - chestLootChance = config.getFeatureProperty(this, "general", "Chest Loot Chance", chestLootChance).getInt( - chestLootChance); - - String entries = ""; - Iterator iterator = entityEntries.iterator(); - while (iterator.hasNext()) { - EntityEntry entityEntry = iterator.next(); - entries = entries.concat(entityEntry.entityname).concat("-") - .concat(Integer.toString(entityEntry.itemWeight)); - if (iterator.hasNext()) { - entries = entries.concat(","); - } - } - - entries = config.getFeatureProperty(this, "general", "SpawnerEntities", entries, - "Entities that appear in Spawner. Format: Entityname-Weight,").getString(); - entityEntries.clear(); - - for (String entry : entries.split(",")) { - if (entry.trim().equals("")) { - continue; - } - - String[] pair = entry.trim().split("-"); - if (pair.length != 2) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has Invalid Number of Arguments.", - getFeatureName(), entries); - } - try { - EntityEntry entityEntry = new EntityEntry(pair[0].trim(), Integer.parseInt(pair[1])); - entityEntries.add(entityEntry); - } catch (IllegalFormatException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } catch (IllegalArgumentException e) { - ProjectZuluLog.severe("Skipping Entity parsing for TF %s. %s has invalid format.", getFeatureName(), - entries); - continue; - } - } - } - - @Override - public ChunkCoordinates[] getGenerationCoordinates(World world, int chunkX, int chunkZ) { - Random random = new Random(world.getSeed()); - long randomFactor1 = random.nextLong() / 2L * 2L + 1L; - long randomFactor2 = random.nextLong() / 2L * 2L + 1L; - random.setSeed(chunkX * 16 * randomFactor1 + chunkZ * 16 * randomFactor2 ^ world.getSeed()); - - int xCoord = chunkX * 16 + random.nextInt(16); - int zCoord = chunkZ * 16 + random.nextInt(16); - return new ChunkCoordinates[] { new ChunkCoordinates(xCoord, world.getTopSolidOrLiquidBlock(xCoord, zCoord), - zCoord) }; - } - - @Override - public boolean canGenerateHere(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random) { - if (super.canGenerateHere(world, chunkX, chunkZ, genBlockCoords, random)) { - if (world.getBlock(genBlockCoords.posX, genBlockCoords.posY, genBlockCoords.posZ).getMaterial() != Material.water) { - if (!TerrainFeatureHelper.doesTerrainFluctuate(world, genBlockCoords.posX, genBlockCoords.posY, - genBlockCoords.posZ, 5, 12)) { - if (printToLog) { - ProjectZuluLog.info("Generating %s at %s, %s, %s", getFeatureName(), genBlockCoords.posX, - genBlockCoords.posY, genBlockCoords.posZ); - } - return true; - } - } - } - return false; - } - - @Override - public void generateFeature(World world, int chunkX, int chunkZ, ChunkCoordinates genBlockCoords, Random random, - FeatureDirection direction) { - new BuildingManagerLabyrinth(world, new ChunkCoordinates(genBlockCoords.posX, genBlockCoords.posY - 16, - genBlockCoords.posZ), direction).generate(); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/50fb6b00c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/50fb6b00c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ba05fb9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/50fb6b00c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,58 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.core.ProjectZuluLog; -import projectzulu.common.dungeon.spawner.tag.ParsingHelper; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -public class KeyParserRandom extends KeyParserBase { - - public KeyParserRandom(Key key) { - super(key, true, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - Operand operand = parseOperand(pieces); - - if (pieces.length == 4) { - int randInt = ParsingHelper.parseFilteredInteger(pieces[1], 16, "RandomRange " + key.key); - int randOffset = ParsingHelper.parseFilteredInteger(pieces[2], 16, "RandomOffset " + key.key); - int maximum = ParsingHelper.parseFilteredInteger(pieces[3], -1, "Maximum " + key.key); - TypeValuePair typeValue = new TypeValuePair(key, new Object[] { isInverted(pieces[0]), randInt, randOffset, - maximum }); - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } else { - ProjectZuluLog.severe("Error Parsing %s Parameter. Invalid Argument Length.", key.key); - return false; - } - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - Object[] values = (Object[]) typeValuePair.getValue(); - boolean isInverted = (Boolean) values[0]; - - int randInt = (Integer) values[1]; - int randOffset = (Integer) values[2]; - int maximum = (Integer) values[3]; - - boolean isValid = !(world.rand.nextInt(randInt) + randOffset <= maximum); - return isInverted ? isValid : !isValid; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/604677a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/604677a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d236a83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/604677a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,41 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/60b28bf4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/60b28bf4c42100141fce95f06aba7e85 deleted file mode 100644 index c816dce..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/60b28bf4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,23 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public interface Architect { - - /** - * Assigns a Blueprint to the relevant MazeCells. Should only set one BlueprintSet per call, but should assign that - * set to multiple cells if applicable. - * - * @param cells MazeCell array - * @param buildCoords Current cell being evaluated - * @param Current Pass Number - * @param Maximum number of Passes - */ - public abstract void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass); - - public abstract BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos); -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/7088d7f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/7088d7f4c42100141fce95f06aba7e85 deleted file mode 100644 index db0fe11..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/7088d7f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,290 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityPotion; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.ItemList; -import com.ngb.projectzulu.common.core.ItemGenerics.Properties; -import com.ngb.projectzulu.common.potion.EntityPZPotion; -import com.ngb.projectzulu.common.potion.PotionParser; - -import com.google.common.base.Optional; - -public abstract class SubItemPotionGeneric extends SubItemPotion { - - protected int maxLevel = 2; - protected int maxDuration = 2; - protected int maxPower = 2; - /* Forms This Potion can Take. 0 = Regular and Splash, 1 == Regular Only, 2 == Only Splash */ - protected int type = 2; - - protected int initialTicks = 0; - protected int ticksPerLevel = 10; - protected int durationScale = 12; - protected int durationSpread = 10; - protected int powerPerLevel = 1; - - protected String[] strengthPrefixes = new String[] { "", "Thickened", "Strengthened", "Fortified" }; - protected String[] durationPrefixes = new String[] { "", "Extended", "Prolonged", "Continuous" }; - - protected String[] durationPostfixes = new String[] { "", "of Extended", "of Prolonged", "of Continuous" }; - protected String[] strengthPostfixes = new String[] { "", "Thickness", "Strength", "Fortification" }; - - enum TYPE { - CHEMICAL, POWER, DURATION, TIER, SPLASH, NONE; - } - - SubItemPotionGeneric(Item item, int subID, String baseName) { - super(item, subID, baseName); - } - - @Override - public void register() { - - } - - @Override - public final ItemStack getPotionResult(ItemStack ingredient, ItemStack brewingStack) { - switch (getIngredientType(ingredient, brewingStack)) { - case POWER: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (power < maxPower - 1) { - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setPower(power + 1, - metaDamage)); - } - break; - } - case DURATION: { - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (duration < maxDuration - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setDuration( - duration + 1, metaDamage)); - } - break; - } - case TIER: { - int level = PotionParser.readLevel(brewingStack.getItemDamage()); - int power = PotionParser.readPower(brewingStack.getItemDamage()); - int duration = PotionParser.readDuration(brewingStack.getItemDamage()); - int metaDamage = brewingStack.getItemDamage(); - if (level < maxLevel - 1) { - if (power > 0) { - metaDamage = PotionParser.setPower(power - 1, metaDamage); - } - if (duration > 0) { - metaDamage = PotionParser.setDuration(duration - 1, metaDamage); - } - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setLevel(level + 1, - metaDamage)); - } - break; - } - case CHEMICAL: { - return getChemicalPotionResult(ingredient, brewingStack); - } - case SPLASH: { - if (!PotionParser.isSplash(brewingStack.getItemDamage())) { - return new ItemStack(brewingStack.getItem(), brewingStack.stackSize, PotionParser.setSplash(brewingStack - .getItemDamage())); - } - break; - } - case NONE: - break; - } - return super.getPotionResult(ingredient, brewingStack); - } - - protected ItemStack getChemicalPotionResult(ItemStack ingredient, ItemStack brewingStack) { - return null; - } - - protected TYPE getIngredientType(ItemStack ingredient, ItemStack brewingStack) { - if (ingredient.getItem() == Items.redstone) { - return TYPE.POWER; - } else if (ingredient.getItem() == Items.glowstone_dust) { - return TYPE.DURATION; - } else if (ingredient.getItem() == Items.gunpowder) { - return TYPE.SPLASH; - } else if (ItemList.genericCraftingItems.isPresent() - && ingredient.getItem() == ItemList.genericCraftingItems.get() - && ingredient.getItemDamage() == Properties.ShinyBauble.meta) { - return TYPE.TIER; - } - return TYPE.NONE; - } - - protected void setSubItemBounds(int maxLevel, int maxDuration, int maxPower, int type) { - this.maxLevel = maxLevel; - this.maxDuration = maxDuration; - this.maxPower = maxPower; - this.type = type; - } - - protected void setEffectScale(int initialTicks, int ticksPerLevel, int durationScale, int durationSpread, - int powerPerLevel) { - this.initialTicks = initialTicks; - this.ticksPerLevel = ticksPerLevel; - this.durationScale = durationScale; - this.durationSpread = durationSpread; - this.powerPerLevel = powerPerLevel; - } - - abstract Optional getPotion(); - - @Override - public String getDisplayName(ItemStack itemStack) { - int level = PotionParser.readLevel(itemStack.getItemDamage()); - int duration = PotionParser.readDuration(itemStack.getItemDamage()); - int power = PotionParser.readPower(itemStack.getItemDamage()); - String nameBuilder = ""; - - /* Check For Prefix */ - if (power <= 0 && duration > 0) { - nameBuilder = nameBuilder + durationPrefixes[duration] + " "; - } else if (power > 0 && duration <= 0) { - nameBuilder = nameBuilder + strengthPrefixes[power] + " "; - } - - /* Add Potion Name */ - nameBuilder = nameBuilder + StatCollector.translateToLocal(baseName).trim() + " Potion"; - - /* Check for Postfix */ - if (power > 0 && duration > 0) { - nameBuilder = nameBuilder + " " + durationPostfixes[duration] + " " + strengthPostfixes[power]; - } - if (level > 0) { - nameBuilder = nameBuilder + " "; - for (int i = 1; i <= level; i++) { - nameBuilder = nameBuilder + "I"; - } - } - return nameBuilder; - } - - @Override - public boolean hasPotionEffects(ItemStack itemStack) { - return true; - } - - @Override - public List getPotionEffects(int damageMeta) { - List effectList = new ArrayList(); - if (getPotion().isPresent()) { - effectList.add(new PotionEffect(getPotion().get().id, getPotion().get().isInstant() ? 1 - : calculateDuration(damageMeta), calculatePower(damageMeta))); - } - return effectList; - } - - protected int calculateDuration(int damageMeta) { - int baseLevel = PotionParser.readLevel(damageMeta); - int baseDuration = PotionParser.readDuration(damageMeta); - int tempBase = (initialTicks + baseLevel * ticksPerLevel); - double tempBonus = (Math.pow(baseDuration + 11 - durationSpread, 2)) - / (Math.pow(maxDuration - 1, 2) + maxDuration - 1) * durationScale; - return (int) (tempBase * tempBonus); - } - - protected int calculatePower(int damageMeta) { - return (PotionParser.readPower(damageMeta) + powerPerLevel * PotionParser.readLevel(damageMeta)); - } - - @Override - public void getSubItems(Item itemID, CreativeTabs creativeTab, List list) { - if (!getPotion().isPresent()) { - return; - } - - /* Add Regular Potion Variations */ - if (type == 0 || type == 1) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - - /* Add Splash Potion Variations */ - if (type == 0 || type == 2) { - for (int level = 0; level < maxLevel; level++) { - for (int power = 0; power < maxPower; power++) { - for (int duration = 0; duration < maxDuration; duration++) { - int damage = PotionParser.setSplash(PotionParser.setPower(power, - PotionParser.setDuration(duration, PotionParser.setLevel(level, subID)))); - list.add(new ItemStack(itemID, 1, damage)); - } - } - } - } - } - - @Override - public boolean isEffectInstant(int damageMeta) { - if (getPotion().isPresent()) { - return getPotion().get().isInstant(); - } else { - return false; - } - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) { - List effectList = getPotionEffects(itemStack); - if (effectList != null && !effectList.isEmpty()) { - - Iterator iterator = effectList.iterator(); - while (iterator.hasNext()) { - /* Line 1: PotionName - Power X (Duration) */ - PotionEffect potioneffect = iterator.next(); - String line1 = StatCollector.translateToLocal(potioneffect.getEffectName()).trim(); - - line1 = line1.concat(" - Power ").concat(Integer.toString(potioneffect.getAmplifier() + 1)); - - if (potioneffect.getDuration() > 20 && !isEffectInstant(itemStack.getItemDamage())) { - line1 = line1 + " (" + Potion.getDurationString(potioneffect) + ")"; - } - - if (Potion.potionTypes[potioneffect.getPotionID()].isBadEffect()) { - list.add(EnumChatFormatting.RED + line1); - } else { - list.add(EnumChatFormatting.GRAY + line1); - } - } - } else { - String s1 = StatCollector.translateToLocal("potion.empty").trim(); - list.add(EnumChatFormatting.GRAY + s1); - } - } - - @Override - protected EntityPotion getEntityPotion(ItemStack itemStack, World world, EntityPlayer player) { - return new EntityPZPotion(world, player, itemStack); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/714a749fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/714a749fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c7c4e95..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/714a749fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,55 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.AchievementList; -import projectzulu.common.potion.subitem.SubItemPotionRegistry; - -public class SlotBrewingStandSinglePotion extends Slot { - /** The player that has this container open. */ - private EntityPlayer player; - - public SlotBrewingStandSinglePotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, - int par5) { - super(par2IInventory, par3, par4, par5); - this.player = par1EntityPlayer; - } - - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack par1ItemStack) { - return canHoldPotion(par1ItemStack); - } - - /** - * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case - * of armor slots) - */ - @Override - public int getSlotStackLimit() { - return 1; - } - - @Override - public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack itemStack) { - if (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack)) { - this.player.addStat(AchievementList.potion, 1); - } - - super.onPickupFromSlot(par1EntityPlayer, itemStack); - } - - /** - * Returns true if this itemstack can be filled with a potion - */ - public static boolean canHoldPotion(ItemStack itemStack) { - return itemStack != null - && (SubItemPotionRegistry.INSTANCE.isItemPotion(itemStack) || itemStack.getItem() == Items.potionitem - && itemStack.getItemDamage() == 0); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/a0e473f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/a0e473f4c42100141fce95f06aba7e85 deleted file mode 100644 index c22b282..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/a0e473f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,202 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint; - -import java.awt.Point; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world2.MazeCell; - -public class BPSetDoorway implements BlueprintSet, Blueprint { - private boolean hasBeenApplied = false; - - @Override - public boolean isApplicable(MazeCell[][] cells, Point buildCoords, Random random) { - if (random.nextInt(10) != 0) { - return false; - } - - if (isWestWall(cells, buildCoords)) { - if (cells[buildCoords.x + 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x + 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isEastWall(cells, buildCoords)) { - if (cells[buildCoords.x - 2][buildCoords.y].rawState == 0 - && cells[buildCoords.x - 2][buildCoords.y + 1].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isNorthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y + 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y + 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - if (isSouthWall(cells, buildCoords)) { - if (cells[buildCoords.x][buildCoords.y - 2].rawState == 0 - && cells[buildCoords.x + 1][buildCoords.y - 2].rawState == 0) { - boolean applied = hasBeenApplied; - hasBeenApplied = true; - return !applied; - } - } - - return false; - } - - @Override - public boolean assignCellsWithBlueprints(MazeCell[][] cells, Point buildCoords, Random random) { - if (isWestWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isEastWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1] - .setBuildingProperties(getIdentifier(), CellIndexDirection.SouthWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y] - .setBuildingProperties(getIdentifier(), CellIndexDirection.NorthWall); - cells[buildCoords.x - 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x - 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.SouthWall); - cells[buildCoords.x - 1][buildCoords.y + 1].rawState = -1; - } else if (isNorthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y + 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y + 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y + 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y + 1].rawState = -1; - } else if (isSouthWall(cells, buildCoords)) { - cells[buildCoords.x][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y].rawState = -1; - - cells[buildCoords.x][buildCoords.y - 1].setBuildingProperties(getIdentifier(), CellIndexDirection.EastWall); - cells[buildCoords.x][buildCoords.y - 1].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y].setBuildingProperties(getIdentifier(), CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y].rawState = -1; - - cells[buildCoords.x + 1][buildCoords.y - 1].setBuildingProperties(getIdentifier(), - CellIndexDirection.WestWall); - cells[buildCoords.x + 1][buildCoords.y - 1].rawState = -1; - } - - return true; - } - - private boolean isWestWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == 0 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isEastWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.x == cells.length - 1 && buildCoords.y > 2 && buildCoords.y < cells[0].length - 3; - } - - private boolean isNorthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == 0 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - private boolean isSouthWall(MazeCell[][] cells, Point buildCoords) { - return buildCoords.y == cells[0].length - 1 && buildCoords.x > 2 && buildCoords.x < cells.length - 3; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, - CellIndexDirection cellIndexDirection, Random random, String buildingID) { - if (cellIndexDirection == CellIndexDirection.SouthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 6); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.NorthWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 7); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.WestWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 4); - } else { - return new BlockWithMeta(Blocks.air); - } - } else if (cellIndexDirection == CellIndexDirection.EastWall) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.sandstone); - } else if (piecePos.posY == cellHeight - 1) { - return new BlockWithMeta(Blocks.sandstone_stairs, 5); - } else { - return new BlockWithMeta(Blocks.air); - } - } - return new BlockWithMeta(Blocks.gold_block); - } - - @Override - public String getIdentifier() { - return "Pyramid_Door"; - } - - @Override - public int getWeight() { - return 0; - } - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/c08c47f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/c08c47f9c42100141fce95f06aba7e85 deleted file mode 100644 index 0442f68..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/c08c47f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,563 +0,0 @@ -package com.ngb.projectzulu.common.dungeon; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.IEntityLivingData; -import net.minecraft.init.Blocks; -import net.minecraft.nbt.NBTBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.NetworkManager; -import net.minecraft.network.Packet; -import net.minecraft.network.play.server.S35PacketUpdateTileEntity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.util.WeightedRandom; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -import com.ngb.projectzulu.common.dungeon.spawner.tag.settings.OptionalSettingsSpawning; -import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TileEntityLimitedMobSpawner extends TileEntity { - /** The stored delay before a new spawn. */ - public int delay = -1; - - private NBTTagCompound debugSavedSetup = new NBTTagCompound(); - - public boolean isDebugEnabled() { - return !(debugSavedSetup == null || debugSavedSetup.hasNoTags()); - } - - public void setDebugMode(NBTTagCompound debugSavedSetup) { - this.debugSavedSetup = debugSavedSetup; - } - - public void loadDebugNBT() { - readFromNBT(debugSavedSetup); - } - - /** - * The string ID of the mobs being spawned from this spawner. Defaults to pig, apparently. - */ - private String mobID = "Chicken"; - /* List of TileEntityLimitedMobSpawnData */ - private List spawnList = null; - - public List getSpawnList() { - return spawnList; - } - - public void setSpawnList(List spawnList) { - this.spawnList = spawnList; - } - - /** The extra NBT data to add to spawned entities */ - private TileEntityLimitedMobSpawnData spawnerTags = null; - public double yaw; - public double yaw2 = 0.0D; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; - - public int getMinSpawnDelay() { - return minSpawnDelay; - } - - public int getMaxSpawnDelay() { - return maxSpawnDelay; - } - - public void setMinMaxSpawnDelay(int minSpawnDelay, int maxSpawnDelay) { - if (maxSpawnDelay < minSpawnDelay) { - this.maxSpawnDelay = minSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } else { - this.maxSpawnDelay = maxSpawnDelay; - this.minSpawnDelay = minSpawnDelay; - } - } - - private int spawnCount = 4; - private Entity displayEntity; - - /** Toggles whether the GUI can edit this TileEntities Property */ - private boolean isEditable = true; - - /** Maximum Entities to Spawn Before MobSpawner should Stop Spawning */ - private int maxSpawnableEntities = 5; - - public int getMaxSpawnableEntities() { - return maxSpawnableEntities; - } - - public void setMaxSpawnableEntities(int maxSpawnableEntities) { - this.maxSpawnableEntities = maxSpawnableEntities; - } - - private int spawnedEntities = 0; - - /** Maximum number of entities for limiting mob spawning */ - private int maxNearbyEntities = 6; - - public int getMaxNearbyEntities() { - return maxNearbyEntities; - } - - public void setMaxNearbyEntities(int maxNearbyEntities) { - this.maxNearbyEntities = maxNearbyEntities; - } - - /** Required player range for mob spawning to occur */ - private int requiredPlayerRange = 16; - - public int getRequriedPLayerRange() { - return requiredPlayerRange; - } - - public void setRequiredPlayerRange(int requiredPlayerRange) { - this.requiredPlayerRange = requiredPlayerRange; - } - - /** Range for spawning new entities with mob spawners */ - private int spawnRangeHorizontal = 4; - private int spawnRangeVertical = 1; - - public int spawnRangeOffsetX = 0; - public int spawnRangeOffsetY = 0; - public int spawnRangeOffsetZ = 0; - - public int getSpawnRangeHorizontal() { - return spawnRangeHorizontal; - } - - public int getSpawnRangeVertial() { - return spawnRangeVertical; - } - - public void setSpawnRangeHorizontal(int horizontal) { - if (horizontal < 0) { - spawnRangeHorizontal = 0; - } else { - spawnRangeHorizontal = horizontal; - } - } - - public void setSpawnRangeVertical(int vertical) { - if (vertical < 0) { - spawnRangeVertical = 0; - } else { - spawnRangeVertical = vertical; - } - } - - public TileEntityLimitedMobSpawner() { - this.delay = 20; - } - - public String getEntityName() { - return this.spawnerTags == null ? this.mobID : this.spawnerTags.type; - } - - public void setMobID(String par1Str) { - this.mobID = par1Str; - } - - /** - * Returns true if there is a player in range (using World.getClosestPlayer) - */ - public boolean anyPlayerInRange() { - if (isDebugEnabled()) { - return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } else { - return this.worldObj.getClosestVulnerablePlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, - this.requiredPlayerRange) != null; - } - } - - public boolean isEditable() { - return this.isEditable; - } - - @SideOnly(Side.CLIENT) - public void playSpawnSound(String spawnSound) { - worldObj.playSound(xCoord, yCoord, zCoord, spawnSound, 1.0f, 1.0f, true); - } - - /** - * Sets the sign's isEditable flag to the specified parameter. - */ - @SideOnly(Side.CLIENT) - public void setEditable(boolean par1) { - this.isEditable = par1; - } - - /** - * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count - * ticks and creates a new spawn inside its implementation. - */ - @Override - public void updateEntity() { - if (maxSpawnableEntities > 0 && spawnedEntities >= maxSpawnableEntities) { - worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air); - } - - if (this.anyPlayerInRange()) { - double var5; - - if (this.worldObj.isRemote) { - double var1 = this.xCoord + this.worldObj.rand.nextFloat(); - double var3 = this.yCoord + this.worldObj.rand.nextFloat(); - var5 = this.zCoord + this.worldObj.rand.nextFloat(); - this.worldObj.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - this.worldObj.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - - if (this.delay > 0) { - --this.delay; - } - - this.yaw2 = this.yaw; - this.yaw = (this.yaw + 1000.0F / (this.delay + 200.0F)) % 360.0D; - } else { - if (this.delay == -1) { - this.updateDelay(); - } - - if (this.delay > 0) { - --this.delay; - return; - } - - boolean var12 = false; - - for (int var2 = 0; var2 < this.spawnCount; ++var2) { - Entity var13 = EntityList.createEntityByName(this.getEntityName(), this.worldObj); - - if (var13 == null) { - return; - } - - int var4 = this.worldObj.getEntitiesWithinAABB( - var13.getClass(), - AxisAlignedBB - .getAABBPool() - .getAABB(xCoord + spawnRangeOffsetX, yCoord + spawnRangeOffsetY, - zCoord + spawnRangeOffsetZ, xCoord + spawnRangeOffsetX + 1, - yCoord + spawnRangeOffsetY + 1, zCoord + spawnRangeOffsetZ + 1) - .expand(spawnRangeHorizontal * 2, spawnRangeVertical * 2 + 2, - spawnRangeHorizontal * 2)).size(); - - if (var4 >= this.maxNearbyEntities) { - this.updateDelay(); - return; - } - - if (var13 != null) { - var5 = xCoord + spawnRangeOffsetX + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) - * spawnRangeHorizontal; - double var7 = yCoord + spawnRangeOffsetY + worldObj.rand.nextInt(spawnRangeVertical * 2 + 1) - - spawnRangeVertical / 2f; - double var9 = zCoord + spawnRangeOffsetZ - + (worldObj.rand.nextDouble() - worldObj.rand.nextDouble()) * spawnRangeHorizontal; - EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving) var13 : null; - this.writeNBTTagsTo(var13); - var13.setLocationAndAngles(var5, var7, var9, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - - boolean canSpawnHere = false; - if (spawnerTags != null && spawnerTags.optionalSpawning.isOptionalEnabled()) { - canSpawnHere = optionalCanSpawnHere(var11, spawnerTags.optionalSpawning); - } else { - canSpawnHere = var11.getCanSpawnHere(); - } - - if (var11 == null || canSpawnHere) { - this.worldObj.spawnEntityInWorld(var13); - this.worldObj.playAuxSFX(2004, this.xCoord, this.yCoord, this.zCoord, 0); - if (!isDebugEnabled()) { - spawnedEntities++; - } - if (spawnerTags != null) { - PZPacket packet = new PacketPlaySound().setPacketData(xCoord, yCoord, zCoord, - spawnerTags.spawnSound); - ProjectZulu_Core.getPipeline().sendToAllAround(packet, - new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 64)); - } - if (var11 != null) { - var11.spawnExplosionParticle(); - } - - var12 = true; - } - } - } - - if (var12) { - this.updateDelay(); - } - } - - super.updateEntity(); - } - } - - private boolean optionalCanSpawnHere(EntityLiving entity, OptionalSettingsSpawning optionalSpawning) { - boolean canSpawn = optionalSpawning.isOptionalEnabled() ? !optionalSpawning.isInverted() : false; - int xCoord = MathHelper.floor_double(entity.posX); - int yCoord = MathHelper.floor_double(entity.boundingBox.minY); - int zCoord = MathHelper.floor_double(entity.posZ); - if (!optionalSpawning.isValidLocation(entity.worldObj, entity, xCoord, yCoord, zCoord)) { - canSpawn = optionalSpawning.isInverted(); - } - return canSpawn && entity.worldObj.checkNoEntityCollision(entity.boundingBox) - && entity.worldObj.getCollidingBoundingBoxes(entity, entity.boundingBox).isEmpty(); - } - - public void writeNBTTagsTo(Entity par1Entity) { - if (this.spawnerTags != null) { - NBTTagCompound var2 = new NBTTagCompound(); - par1Entity.writeToNBTOptional(var2); - Iterator keyIterator = spawnerTags.properties.func_150296_c().iterator(); - while (keyIterator.hasNext()) { - String key = (String) keyIterator.next(); - NBTBase nbt = spawnerTags.properties.getTag(key); - var2.setTag(key, nbt.copy()); - } - - try { - par1Entity.readFromNBT(var2); - } catch (Exception e) { - if (!debugSavedSetup.hasNoTags()) { - ProjectZuluLog.warning("Attempting to Recover From Debug Mode Backup due to Error %s", - e.getMessage()); - try { - loadDebugNBT(); - } catch (Exception e2) { - ProjectZuluLog - .severe("Exception Occured when Writing DebugNBT to %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e2.printStackTrace(); - } - } else { - ProjectZuluLog - .severe("Exception occured when writing NBT to Entity %s. Entity may not work as expected. Recreate NBT on entity can repair.", - EntityList.getEntityString(par1Entity)); - e.printStackTrace(); - } - } - } else if (par1Entity instanceof EntityLiving && par1Entity.worldObj != null) { - IEntityLivingData livingData = null; - // livingData = ((EntityLiving) par1Entity).onSpawnWithEgg(livingData); - } - } - - /** - * Sets the delay before a new spawn (base delay of 200 + random number up to 600). - */ - private void updateDelay() { - if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.delay = this.minSpawnDelay; - } else { - this.delay = this.minSpawnDelay + this.worldObj.rand.nextInt(this.maxSpawnDelay - this.minSpawnDelay); - } - - if (this.spawnList != null && this.spawnList.size() > 0) { - this.spawnerTags = (TileEntityLimitedMobSpawnData) WeightedRandom.getRandomItem(this.worldObj.rand, - this.spawnList); - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - } - - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, 0); - } - - /** - * Used to Force TileEntity to Repick its Spawnable Creature after being Synced to remove Old Data - */ - public void forceUpdate() { - updateDelay(); - } - - /** - * Reads a tile entity from NBT. - */ - @Override - public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - super.readFromNBT(par1NBTTagCompound); - this.mobID = par1NBTTagCompound.getString("EntityId"); - this.delay = par1NBTTagCompound.getShort("Delay"); - if (par1NBTTagCompound.hasKey("SpawnPotentials")) { - this.spawnList = new ArrayList(); - NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials", 10); - - for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - TileEntityLimitedMobSpawnData spawnData = new TileEntityLimitedMobSpawnData(this, - var2.getCompoundTagAt(var3)); - if (EntityList.stringToClassMapping.containsKey(spawnData.type)) { - this.spawnList.add(spawnData); - } else { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnData.type, xCoord, yCoord, zCoord); - } - } - } else { - this.spawnList = null; - } - if (par1NBTTagCompound.hasKey("SpawnData")) { - this.spawnerTags = new TileEntityLimitedMobSpawnData(this, par1NBTTagCompound.getCompoundTag("SpawnData"), - this.mobID, "", ""); - if (!EntityList.classToStringMapping.containsKey(spawnerTags.type)) { - ProjectZuluLog - .severe("Failed to load Limited Spawner entity %s at (%s, %s, %s). Entity does not appear to be declared.", - spawnerTags.type, xCoord, yCoord, zCoord); - } - spawnerTags = null; - } else { - this.spawnerTags = null; - } - if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { - this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); - this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); - this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); - this.maxSpawnableEntities = par1NBTTagCompound.getShort("MaxSpawnableEntities"); - } - if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { - this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); - this.requiredPlayerRange = par1NBTTagCompound.getShort("RequiredPlayerRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeHori")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRangeHori"); - } else if (par1NBTTagCompound.hasKey("SpawnRange")) { - this.spawnRangeHorizontal = par1NBTTagCompound.getShort("SpawnRange"); - } - - if (par1NBTTagCompound.hasKey("SpawnRangeVert")) { - this.spawnRangeVertical = par1NBTTagCompound.getShort("SpawnRangeVert"); - } - - if (par1NBTTagCompound.hasKey("DebugSavedSetup")) { - debugSavedSetup = par1NBTTagCompound.getCompoundTag("DebugSavedSetup"); - } - - if (par1NBTTagCompound.hasKey("OffsetX")) { - spawnRangeOffsetX = par1NBTTagCompound.getShort("OffsetX"); - } - - if (par1NBTTagCompound.hasKey("OffsetY")) { - spawnRangeOffsetY = par1NBTTagCompound.getShort("OffsetY"); - } - - if (par1NBTTagCompound.hasKey("OffsetZ")) { - spawnRangeOffsetZ = par1NBTTagCompound.getShort("OffsetZ"); - } - - if (this.worldObj != null && this.worldObj.isRemote) { - this.displayEntity = null; - } - } - - /** - * Writes a tile entity to NBT. - */ - @Override - public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - super.writeToNBT(par1NBTTagCompound); - par1NBTTagCompound.setTag("DebugSavedSetup", debugSavedSetup); - par1NBTTagCompound.setString("EntityId", this.getEntityName()); - par1NBTTagCompound.setShort("Delay", (short) this.delay); - par1NBTTagCompound.setShort("MinSpawnDelay", (short) this.minSpawnDelay); - par1NBTTagCompound.setShort("MaxSpawnDelay", (short) this.maxSpawnDelay); - par1NBTTagCompound.setShort("SpawnCount", (short) this.spawnCount); - par1NBTTagCompound.setShort("MaxNearbyEntities", (short) this.maxNearbyEntities); - par1NBTTagCompound.setShort("RequiredPlayerRange", (short) this.requiredPlayerRange); - par1NBTTagCompound.setShort("SpawnRangeHori", (short) this.spawnRangeHorizontal); - par1NBTTagCompound.setShort("SpawnRangeVert", (short) this.spawnRangeVertical); - par1NBTTagCompound.setShort("MaxSpawnableEntities", (short) this.maxSpawnableEntities); - par1NBTTagCompound.setShort("OffsetX", (short) this.spawnRangeOffsetX); - par1NBTTagCompound.setShort("OffsetY", (short) this.spawnRangeOffsetY); - par1NBTTagCompound.setShort("OffsetZ", (short) this.spawnRangeOffsetZ); - - if (this.spawnerTags != null) { - par1NBTTagCompound.setTag("SpawnData", (NBTTagCompound) this.spawnerTags.properties.copy()); - } - - if (this.spawnerTags != null || this.spawnList != null && this.spawnList.size() > 0) { - NBTTagList var2 = new NBTTagList(); - - if (this.spawnList != null && this.spawnList.size() > 0) { - Iterator var3 = this.spawnList.iterator(); - - while (var3.hasNext()) { - TileEntityLimitedMobSpawnData var4 = (TileEntityLimitedMobSpawnData) var3.next(); - var2.appendTag(var4.getNBT()); - } - } else { - var2.appendTag(this.spawnerTags.getNBT()); - } - - par1NBTTagCompound.setTag("SpawnPotentials", var2); - } - } - - /** - * will create the entity from the internalID the first time it is accessed - */ - @SideOnly(Side.CLIENT) - public Entity getMobEntity() { - if (this.displayEntity == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityName(), Minecraft.getMinecraft().theWorld); - this.writeNBTTagsTo(var1); - this.displayEntity = var1; - } - return this.displayEntity; - } - - /** - * Overriden in a sign to provide the text. - */ - @Override - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, var1); - - } - - @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt.func_148857_g(); - readFromNBT(tag); - } - - public void syncToServer() { - NBTTagCompound tileEntityData = new NBTTagCompound(); - writeToNBT(tileEntityData); - PZPacket packet = new PacketMobSpawner().setPacketData(xCoord, yCoord, zCoord, tileEntityData); - ProjectZulu_Core.getPipeline().sendToServer(packet); - } - - /** - * Called when a client event is received with the event number and argument, see World.sendClientEvent - */ - @Override - public boolean receiveClientEvent(int par1, int par2) { - if (par1 == 1 && this.worldObj.isRemote) { - this.delay = this.minSpawnDelay; - return true; - } else { - return super.receiveClientEvent(par1, par2); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/c0fb5401c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/c0fb5401c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 63c877c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/c0fb5401c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,351 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.ModelHelper; -import projectzulu.common.mobs.entity.EntityGenericCreature; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelMammoth extends ModelBase { - float heightToRais = 18; - ModelRenderer body3; - ModelRenderer body2; - ModelRenderer body1; - ModelRenderer leg1; - ModelRenderer leg2; - ModelRenderer leg3; - ModelRenderer leg4; - ModelRenderer head; - ModelRenderer headhair; - ModelRenderer TUSKRIGROT; - ModelRenderer NOSEROT1; - ModelRenderer TUSKLEFROT; - - ModelRenderer NOSEROT2; - ModelRenderer NOSEROT3; - ModelRenderer NOSEROT4; - ModelRenderer NOSEROT5; - ModelRenderer NOSEROT6; - ModelRenderer NOSEROT7; - ModelRenderer NOSEROT8; - ModelRenderer NOSEROT9; - ModelRenderer HEADROT; - ModelRenderer EARRIGROT; - ModelRenderer EARLEFROT; - - private ModelRenderer SADDLEROT; - - public ModelMammoth() { - textureWidth = 128; - textureHeight = 64; - setTextureOffset("HEADROT.headhair", 58, 48); - setTextureOffset("HEADROT.head", 34, 48); - setTextureOffset("HEADROT.eyebrowrig", 64, 53); - setTextureOffset("HEADROT.eyebrowlef", 64, 53); - setTextureOffset("TUSKLEFROT.tuskleft", 44, 15); - setTextureOffset("TUSKLEFROT.tuskleft3", 52, 14); - setTextureOffset("TUSKLEFROT.tuskleft2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig", 44, 15); - setTextureOffset("TUSKRIGROT.tuskrig2", 44, 21); - setTextureOffset("TUSKRIGROT.tuskrig3", 52, 14); - setTextureOffset("NOSEROT1.nose1", 0, 0); - setTextureOffset("NOSEROT2.nose2", 0, 3); - setTextureOffset("NOSEROT3.nose3", 0, 0); - setTextureOffset("NOSEROT4.nose4", 0, 3); - setTextureOffset("NOSEROT5.nose5", 0, 0); - setTextureOffset("NOSEROT6.nose6", 0, 3); - setTextureOffset("NOSEROT7.nose7", 0, 0); - setTextureOffset("NOSEROT8.nose8", 0, 3); - setTextureOffset("NOSEROT9.nose9", 0, 0); - setTextureOffset("EARRIGROT.earrig", 58, 53); - setTextureOffset("EARLEFROT.earlef", 58, 53); - setTextureOffset("SADDLEROT.chairsup10", 74, 7); - setTextureOffset("SADDLEROT.chairsup1", 74, 7); - setTextureOffset("SADDLEROT.chairsup2", 74, 7); - setTextureOffset("SADDLEROT.chairsup3", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup6", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.chairsup8", 74, 7); - setTextureOffset("SADDLEROT.chairsup9", 74, 7); - setTextureOffset("SADDLEROT.chairrail5", 74, 17); - setTextureOffset("SADDLEROT.chairsup5", 74, 7); - setTextureOffset("SADDLEROT.chairsup4", 74, 7); - setTextureOffset("SADDLEROT.chairsup7", 74, 7); - setTextureOffset("SADDLEROT.SaddleBase", 74, 0); - setTextureOffset("SADDLEROT.chairrail1", 74, 7); - setTextureOffset("SADDLEROT.chairrail4", 74, 15); - setTextureOffset("SADDLEROT.chairrail2", 74, 7); - setTextureOffset("SADDLEROT.Saddlestrap3", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap", 74, 19); - setTextureOffset("SADDLEROT.Saddlestrap4", 114, 9); - setTextureOffset("SADDLEROT.Saddlestrap2", 74, 19); - setTextureOffset("SADDLEROT.SaddleBaseFront", 96, 7); - setTextureOffset("SADDLEROT.SaddleBaseRear3", 96, 9); - setTextureOffset("SADDLEROT.SaddleBaseRear1", 96, 11); - setTextureOffset("SADDLEROT.SaddleBaseRear2", 96, 11); - setTextureOffset("SADDLEROT.chairrail3", 74, 13); - - body3 = new ModelRenderer(this, 0, 48); - body3.addBox(-4F, 0F, -2F, 13, 10, 4); - body3.setRotationPoint(-2.5F, 10F - heightToRais, 3F); - body3.setTextureSize(128, 64); - body3.mirror = true; - setRotation(body3, 0F, 0F, 0F); - body2 = new ModelRenderer(this, 0, 31); - body2.addBox(-5.5F, 0F, -2F, 15, 11, 5); - body2.setRotationPoint(-2F, 9F - heightToRais, -2F); - body2.setTextureSize(128, 64); - body2.mirror = true; - setRotation(body2, 0F, 0F, 0F); - body1 = new ModelRenderer(this, 0, 15); - body1.addBox(-2F, 0F, -2F, 16, 11, 4); - body1.setRotationPoint(-6F, 8F - heightToRais, -6F); - body1.setTextureSize(128, 64); - body1.mirror = true; - setRotation(body1, 0F, 0F, 0F); - leg1 = new ModelRenderer(this, 40, 34); - leg1.addBox(-2F, 0F, -2F, 4, 5, 4); - leg1.setRotationPoint(-6F, 19F - heightToRais, -6F); - leg1.setTextureSize(128, 64); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 40, 34); - leg2.addBox(-2F, 0F, -2F, 4, 5, 4); - leg2.setRotationPoint(6F, 19F - heightToRais, -6F); - leg2.setTextureSize(128, 64); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 56, 34); - leg3.addBox(-2F, 0F, -2F, 4, 4, 4); - leg3.setRotationPoint(-4.5F, 20F - heightToRais, 3F); - leg3.setTextureSize(128, 64); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0.0174533F); - leg4 = new ModelRenderer(this, 56, 34); - leg4.addBox(-2F, 0F, -2F, 4, 4, 4); - leg4.setRotationPoint(4.5F, 20F - heightToRais, 3F); - leg4.setTextureSize(128, 64); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0.0174533F); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 13F - heightToRais, -8F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("headhair", -2.5F, -6F, -3.5F, 5, 2, 3); - HEADROT.addBox("head", -4F, -4F, -4F, 8, 8, 4); - HEADROT.addBox("eyebrowrig", -3F, -2F, -5F, 2, 1, 1); - HEADROT.addBox("eyebrowlef", 1F, -2F, -5F, 2, 1, 1); - TUSKLEFROT = new ModelRenderer(this, "TUSKLEFROT"); - TUSKLEFROT.setRotationPoint(-3F, 4F, -2F); - setRotation(TUSKLEFROT, 0F, 0F, 0F); - TUSKLEFROT.mirror = true; - TUSKLEFROT.addBox("tuskleft", -1F, 0F, -1F, 2, 4, 2); - TUSKLEFROT.addBox("tuskleft3", -1F, -3F, -6F, 2, 5, 2); - TUSKLEFROT.addBox("tuskleft2", -1F, 2F, -6F, 2, 2, 5); - HEADROT.addChild(TUSKLEFROT); - TUSKRIGROT = new ModelRenderer(this, "TUSKRIGROT"); - TUSKRIGROT.setRotationPoint(3F, 4F, -2F); - setRotation(TUSKRIGROT, 0F, 0F, 0F); - TUSKRIGROT.mirror = true; - TUSKRIGROT.addBox("tuskrig", -1F, 0F, -1F, 2, 4, 2); - TUSKRIGROT.addBox("tuskrig2", -1F, 2F, -6F, 2, 2, 5); - TUSKRIGROT.addBox("tuskrig3", -1F, -3F, -6F, 2, 5, 2); - HEADROT.addChild(TUSKRIGROT); - NOSEROT1 = new ModelRenderer(this, "NOSEROT1"); - NOSEROT1.setRotationPoint(0F, 3F, -4F); - setRotation(NOSEROT1, 0F, 0F, 0F); - NOSEROT1.mirror = true; - NOSEROT1.addBox("nose1", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT2 = new ModelRenderer(this, "NOSEROT2"); - NOSEROT2.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT2, 0F, 0F, 0F); - NOSEROT2.mirror = true; - NOSEROT2.addBox("nose2", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT3 = new ModelRenderer(this, "NOSEROT3"); - NOSEROT3.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT3, 0F, 0F, 0F); - NOSEROT3.mirror = true; - NOSEROT3.addBox("nose3", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT4 = new ModelRenderer(this, "NOSEROT4"); - NOSEROT4.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT4, 0F, 0F, 0F); - NOSEROT4.mirror = true; - NOSEROT4.addBox("nose4", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT5 = new ModelRenderer(this, "NOSEROT5"); - NOSEROT5.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT5, 0F, 0F, 0F); - NOSEROT5.mirror = true; - NOSEROT5.addBox("nose5", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT6 = new ModelRenderer(this, "NOSEROT6"); - NOSEROT6.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT6, 0F, 0F, 0F); - NOSEROT6.mirror = true; - NOSEROT6.addBox("nose6", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT7 = new ModelRenderer(this, "NOSEROT7"); - NOSEROT7.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT7, 0F, 0F, 0F); - NOSEROT7.mirror = true; - NOSEROT7.addBox("nose7", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8 = new ModelRenderer(this, "NOSEROT8"); - NOSEROT8.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT8, 0F, 0F, 0F); - NOSEROT8.mirror = true; - NOSEROT8.addBox("nose8", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT9 = new ModelRenderer(this, "NOSEROT9"); - NOSEROT9.setRotationPoint(0F, 0F, -1F); - setRotation(NOSEROT9, 0F, 0F, 0F); - NOSEROT9.mirror = true; - NOSEROT9.addBox("nose9", -1.5F, -1F, -1F, 3, 2, 1); - NOSEROT8.addChild(NOSEROT9); - NOSEROT7.addChild(NOSEROT8); - NOSEROT6.addChild(NOSEROT7); - NOSEROT5.addChild(NOSEROT6); - NOSEROT4.addChild(NOSEROT5); - NOSEROT3.addChild(NOSEROT4); - NOSEROT2.addChild(NOSEROT3); - NOSEROT1.addChild(NOSEROT2); - HEADROT.addChild(NOSEROT1); - EARRIGROT = new ModelRenderer(this, "EARRIGROT"); - EARRIGROT.setRotationPoint(4F, -4F, -2F); - setRotation(EARRIGROT, 0F, 0F, 0F); - EARRIGROT.mirror = true; - EARRIGROT.addBox("earrig", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARRIGROT); - EARLEFROT = new ModelRenderer(this, "EARLEFROT"); - EARLEFROT.setRotationPoint(-5F, -4F, -2F); - setRotation(EARLEFROT, 0F, 0F, 0F); - EARLEFROT.mirror = true; - EARLEFROT.addBox("earlef", 0F, 0F, 0F, 1, 3, 2); - HEADROT.addChild(EARLEFROT); - SADDLEROT = new ModelRenderer(this, "SADDLEROT"); - SADDLEROT.setRotationPoint(0F, 8F - heightToRais, 0F); - setRotation(SADDLEROT, 0F, 0F, 0F); - SADDLEROT.mirror = true; - SADDLEROT.addBox("chairsup10", 4F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup1", -5F, -4F, -4.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup2", -5F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup3", -5F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup5", -2F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup6", 1F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 4F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup8", 4F, -4F, -0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup9", 4F, -4F, -2.5F, 1, 3, 1); - SADDLEROT.addBox("chairrail5", -3F, -7F, 0.5F, 6, 1, 1); - SADDLEROT.addBox("chairsup5", -0.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup4", -3.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("chairsup7", 2.5F, -4F, 0.5F, 1, 3, 1); - SADDLEROT.addBox("SaddleBase", -5F, -1F, -4F, 10, 1, 6); - SADDLEROT.addBox("chairrail1", -5F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("chairrail4", -4F, -6F, 0.5F, 8, 1, 1); - SADDLEROT.addBox("chairrail2", 4F, -5F, -4.5F, 1, 1, 5); - SADDLEROT.addBox("Saddlestrap3", -8.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap", -8.5F, 0F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("Saddlestrap4", 7.5F, 1F, -3.5F, 1, 11, 3); - SADDLEROT.addBox("Saddlestrap2", -8.5F, 12F, -3.5F, 17, 1, 3); - SADDLEROT.addBox("SaddleBaseFront", -6F, -1F, -5F, 12, 1, 1); - SADDLEROT.addBox("SaddleBaseRear3", -4F, 1F, 1F, 8, 1, 1); - SADDLEROT.addBox("SaddleBaseRear1", -5F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("SaddleBaseRear2", 4F, 0F, 1F, 1, 2, 1); - SADDLEROT.addBox("chairrail3", -5F, -5F, 0.5F, 10, 1, 1); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - - float field_78145_g = 11.0f; - float field_78151_h = 9.0f; - float scale = 4; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.3F / var8, 1.3F / var8, 1.3F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(scale * f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - SADDLEROT.render(scale * f5); - GL11.glPopMatrix(); - } else { - body3.render(scale * f5); - body2.render(scale * f5); - body1.render(scale * f5); - leg1.render(scale * f5); - leg2.render(scale * f5); - leg3.render(scale * f5); - leg4.render(scale * f5); - - HEADROT.render(scale * f5); - SADDLEROT.render(scale * f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - TUSKRIGROT.rotateAngleY = (float) (-22.5 * Math.PI / 180); - TUSKLEFROT.rotateAngleY = (float) (22.5 * Math.PI / 180); - - float angle = 0; - NOSEROT1.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT2.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT3.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT4.rotateAngleX = (float) (22.5 * Math.PI / 180 * MathHelper.cos(angle)); - NOSEROT5.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT6.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT7.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT8.rotateAngleX = (float) (0 * Math.PI / 180); - NOSEROT9.rotateAngleX = (float) (0 * Math.PI / 180); - - /* Left Side Legs */ - leg1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - - /* Right Side Legs */ - leg2.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - leg4.rotateAngleX = -(float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math - .log(par3 + 1))); - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityGenericCreature var5 = (EntityGenericCreature) par7Entity; - if (var5.getEntityState() == EntityStates.attacking && var5.getAnimTime() > 0) { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f) - + (float) (MathHelper.cos(f1 * 0.6662F / 2f + (float) Math.PI) * Math.PI / 180 * (20)); - } else { - HEADROT.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/d0b34b9fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/d0b34b9fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ee81004..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/d0b34b9fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,253 +0,0 @@ -// Date: 21/08/2012 16:58:44 PM -// Template version 1.1 -// Java generated by Techne -// Keep in mind that you still need to fill in some blanks -// - ZeuX -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityLizard; - -public class ModelLizard extends ModelBase { - ModelRenderer leg1; - ModelRenderer leg1u; - ModelRenderer leg2; - ModelRenderer leg2u; - - ModelRenderer TAILROT; - ModelRenderer Tail3; - ModelRenderer Tail2; - ModelRenderer Tail1; - - ModelRenderer FRONTROT; - ModelRenderer HEADBASE; - ModelRenderer Frill1; - ModelRenderer Frill2; - ModelRenderer Frill3; - ModelRenderer Frill4; - ModelRenderer head; - ModelRenderer leg3u; - ModelRenderer leg3; - ModelRenderer body; - ModelRenderer leg4; - ModelRenderer leg4u; - - public ModelLizard() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("TAILROT.dltfold1", 0, 0); - setTextureOffset("FRONTROT.dltfold3", 0, 0); - - leg1 = new ModelRenderer(this, 20, 22); - leg1.addBox(-3F, 0F, -1F, 2, 6, 2); - leg1.setRotationPoint(-4F, 18F, 6F); - leg1.setTextureSize(64, 32); - leg1.mirror = true; - setRotation(leg1, 0F, 0F, 0F); - leg1u = new ModelRenderer(this, 14, 22); - leg1u.addBox(-1F, 0F, -1F, 1, 2, 2); - leg1u.setRotationPoint(-4F, 18F, 6F); - leg1u.setTextureSize(64, 32); - leg1u.mirror = true; - setRotation(leg1u, 0F, 0F, 0F); - leg2 = new ModelRenderer(this, 20, 22); - leg2.addBox(1F, 0F, -1F, 2, 6, 2); - leg2.setRotationPoint(4F, 18F, 6F); - leg2.setTextureSize(64, 32); - leg2.mirror = true; - setRotation(leg2, 0F, 0F, 0F); - leg2u = new ModelRenderer(this, 14, 22); - leg2u.addBox(0F, 0F, -1F, 1, 2, 2); - leg2u.setRotationPoint(4F, 18F, 6F); - leg2u.setTextureSize(64, 32); - leg2u.mirror = true; - setRotation(leg2u, 0F, 0F, 0F); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, 20F, 9F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - Tail3 = new ModelRenderer(this, 0, 17); - Tail3.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail3); - Tail3.setRotationPoint(0F, -1F, 10F); - Tail3.setTextureSize(64, 32); - Tail3.mirror = true; - setRotation(Tail3, 0F, 0F, 0F); - Tail2 = new ModelRenderer(this, 0, 17); - Tail2.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail2); - Tail2.setRotationPoint(0F, -1F, 5F); - Tail2.setTextureSize(64, 32); - Tail2.mirror = true; - setRotation(Tail2, 0F, 0F, 0F); - Tail1 = new ModelRenderer(this, 0, 17); - Tail1.addBox(-1F, 0F, 0F, 2, 1, 5); - TAILROT.addChild(Tail1); - Tail1.setRotationPoint(0F, -1F, 0F); - Tail1.setTextureSize(64, 32); - Tail1.mirror = true; - setRotation(Tail1, 0F, 0F, 0F); - FRONTROT = new ModelRenderer(this, "FRONTROT"); - FRONTROT.setRotationPoint(0F, 19F, 6F); - setRotation(FRONTROT, 0F, 0F, 0F); - FRONTROT.mirror = true; - HEADBASE = new ModelRenderer(this, "HEADBASE"); - FRONTROT.addChild(HEADBASE); - HEADBASE.setRotationPoint(0F, 0F, -13F); - setRotation(HEADBASE, 0F, 0F, 0F); - HEADBASE.mirror = true; - Frill2 = new ModelRenderer(this, 29, 22); - Frill2.addBox(-3F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill2); - Frill2.setRotationPoint(-3F, 1F, -3F); - Frill2.setTextureSize(64, 32); - Frill2.mirror = true; - setRotation(Frill2, 0F, 0.0371786F, 0F); - Frill4 = new ModelRenderer(this, 37, 22); - Frill4.addBox(-4F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill4); - Frill4.setRotationPoint(-1F, -2F, -3F); - Frill4.setTextureSize(64, 32); - Frill4.mirror = true; - setRotation(Frill4, 0F, 0F, 0F); - Frill1 = new ModelRenderer(this, 29, 22); - Frill1.addBox(0F, -3F, 0F, 3, 5, 1); - HEADBASE.addChild(Frill1); - Frill1.setRotationPoint(3F, 1F, -3F); - Frill1.setTextureSize(64, 32); - Frill1.mirror = true; - setRotation(Frill1, 0F, 0.0371786F, 0F); - - Frill3 = new ModelRenderer(this, 37, 22); - Frill3.addBox(0F, -2F, 0F, 4, 4, 1); - HEADBASE.addChild(Frill3); - Frill3.setRotationPoint(1F, -2F, -3F); - Frill3.setTextureSize(64, 32); - Frill3.mirror = true; - setRotation(Frill3, 0F, 0F, 0F); - Frill3.mirror = false; - head = new ModelRenderer(this, 0, 0); - head.addBox(-4F, -4F, -9F, 6, 6, 8); - HEADBASE.addChild(head); - head.setRotationPoint(1F, 1F, 1F); - head.setTextureSize(64, 32); - head.mirror = true; - setRotation(head, 0F, 0F, 0F); - // dltfold3.addChildModelRenderer(HEADBASE); - leg3u = new ModelRenderer(this, 14, 22); - leg3u.addBox(-1F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg3u); - leg3u.setRotationPoint(-4F, -1F, -12F); - leg3u.setTextureSize(64, 32); - leg3u.mirror = true; - setRotation(leg3u, 0F, 0F, 0F); - body = new ModelRenderer(this, 10, 0); - body.addBox(-4F, -2F, -9F, 8, 4, 18); - FRONTROT.addChild(body); - body.setRotationPoint(0F, 0F, -6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - leg4u = new ModelRenderer(this, 14, 22); - leg4u.addBox(0F, 0F, -1F, 1, 2, 2); - FRONTROT.addChild(leg4u); - leg4u.setRotationPoint(4F, -1F, -12F); - leg4u.setTextureSize(64, 32); - leg4u.mirror = true; - setRotation(leg4u, 0F, 0F, 0F); - leg4 = new ModelRenderer(this, 20, 22); - leg4.addBox(1F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg4); - leg4.setRotationPoint(4F, -1F, -12F); - leg4.setTextureSize(64, 32); - leg4.mirror = true; - setRotation(leg4, 0F, 0F, 0F); - leg3 = new ModelRenderer(this, 20, 22); - leg3.addBox(-3F, 0F, -1F, 2, 6, 2); - FRONTROT.addChild(leg3); - leg3.setRotationPoint(-4F, -1F, -12F); - leg3.setTextureSize(64, 32); - leg3.mirror = true; - setRotation(leg3, 0F, 0F, 0F); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - FRONTROT.render(f5); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - GL11.glPopMatrix(); - } else { - leg1.render(f5); - leg1u.render(f5); - leg2.render(f5); - leg2u.render(f5); - TAILROT.render(f5); - FRONTROT.render(f5); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityLizard var5 = (EntityLizard) par1EntityLiving; - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - if (var5.prepareToSpit == true) { - Frill1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.0F * par3; - Frill2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 1.0F * par3; - - Frill3.rotateAngleZ = (float) (-45 * Math.PI / 180); - Frill3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - Frill3.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F) * 0.5F * par3; - - Frill4.rotateAngleZ = (float) (45 * Math.PI / 180); - Frill4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - Frill4.rotateAngleX = MathHelper.cos(4 * par2 * 0.6662F - (float) Math.PI) * 0.5F * par3; - } else { - Frill1.rotateAngleZ = (float) (-90 * Math.PI / 180); // This is on Right - Frill2.rotateAngleZ = (float) (90 * Math.PI / 180); // This is on Left - - Frill3.rotateAngleY = (float) (-90 * Math.PI / 180); - Frill4.rotateAngleY = (float) (90 * Math.PI / 180); - } - leg1.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg2.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - leg3.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - leg4.rotateAngleY = MathHelper.cos(4 * par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - HEADBASE.rotateAngleX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - HEADBASE.rotateAngleY = Math.min(Math.max(f3, -45), +45) * (float) (Math.PI / 180f); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/e07373f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/e07373f8c42100141fce95f06aba7e85 deleted file mode 100644 index f5b676c..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/e07373f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.potion.effects; - -import net.minecraft.entity.EntityLivingBase; - -public class PotionIncendiary extends PotionZulu { - - public PotionIncendiary(int par1, boolean par2, int par3) { - super(par1, par2, par3); - setIconIndex(1, 2); - setEffectiveness(1.0D); - } - - @Override - public void performEffect(EntityLivingBase par1EntityLiving, int par2) { - super.performEffect(par1EntityLiving, par2); - } - - @Override - public void affectEntity(EntityLivingBase par1EntityLiving, EntityLivingBase par2EntityLiving, int par3, double par4) { - par2EntityLiving.setFire((int) (2 + 1.5 * par3)); - super.affectEntity(par1EntityLiving, par2EntityLiving, par3, par4); - } - - @Override - public boolean isInstant() { - return true; - } - - @Override - public boolean isReady(int par1, int par2) { - return true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/f1c7a89fc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/f1c7a89fc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index ea3f172..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fc/f1c7a89fc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWeakness extends SubItemPotionHalfPower { - - public SubItemPotionWeakness(Item itemID, int subID) { - super(itemID, subID, "Weakness"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 6, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.weakness); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/01b06ea0c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/01b06ea0c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a02d752..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/01b06ea0c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,77 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ItemCoconutSeed extends Item { - - public ItemCoconutSeed(int par2, boolean par3bool, String baseName) { - super(); - maxStackSize = 12; - setMaxDamage(5); - setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); - bFull3D = par3bool; - setUnlocalizedName(baseName); - setTextureName(DefaultProps.blockKey + ":" + baseName); - } - - @Override - public int getMetadata(int par1) { - return par1; - } - - @Override - public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, - int par5, int par6, int par7, float par8, float par9, float par10) { - - Block var11 = par3World.getBlock(par4, par5, par6); - int var12 = par3World.getBlockMetadata(par4, par5, par6); - - if (BlockList.palmTreeLog.isPresent() && var11 == BlockList.palmTreeLog.get() - && !par3World.isAirBlock(par4, par5, par6)) { - if (par7 == 0) { - return false; - } - - if (par7 == 1) { - return false; - } - - if (par7 == 2) { - --par6; - } - - if (par7 == 3) { - ++par6; - } - - if (par7 == 4) { - --par4; - } - - if (par7 == 5) { - ++par4; - } - - if (par3World.isAirBlock(par4, par5, par6) && BlockList.coconut.isPresent()) { - - int var13 = BlockList.coconut.get().onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, - 0); - par3World.setBlock(par4, par5, par6, BlockList.coconut.get(), var13, 3); - - if (!par2EntityPlayer.capabilities.isCreativeMode) { - --par1ItemStack.stackSize; - } - } - } - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/10e09400c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/10e09400c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index ebbffb0..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/10e09400c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,70 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import java.util.EnumSet; - -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; - -public class EntityBear extends EntityGenericAnimal implements IAnimals { - - public EntityBear(World par1World) { - super(par1World); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - /* Attack On Collide Declared in SubClass */ - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); - } - - @Override - protected String getHurtSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "bearliving"; - } - - @Override - public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { - return true; - } - - /** - * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each - * Entity if deviations from default are desired - */ - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null - && (itemStack.getItem() == Items.fish || itemStack.getItem() == Items.cooked_fished)) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/20ddbaf8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/20ddbaf8c42100141fce95f06aba7e85 deleted file mode 100644 index 2d8060b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/20ddbaf8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,198 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -public class ModelCentipede extends ModelBase { - - ModelRenderer sidebody2; - ModelRenderer body; - ModelRenderer sidebody3; - ModelRenderer sidebody1; - ModelRenderer ANTENLEFROT1; - ModelRenderer ANTENRIGROT1; - ModelRenderer LEG11ROT; - ModelRenderer LEG21ROT; - ModelRenderer LEG31ROT; - ModelRenderer LEG41ROT; - private ModelRenderer ANTENLEFROT2; - private ModelRenderer ANTENLEFROT3; - private ModelRenderer ANTENRIGROT2; - private ModelRenderer ANTENRIGROT3; - private ModelRenderer LEG12ROT; - private ModelRenderer LEG22ROT; - private ModelRenderer LEG32ROT; - private ModelRenderer LEG42ROT; - - public ModelCentipede() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("ANTENLEFROT1.antenlef1", 54, 0); - setTextureOffset("ANTENLEFROT2.antenlef2", 50, 0); - setTextureOffset("ANTENLEFROT3.antenlef3", 47, 0); - setTextureOffset("ANTENRIGROT1.antenrig1", 54, 0); - setTextureOffset("ANTENRIGROT2.antenrig2", 50, 0); - setTextureOffset("ANTENRIGROT3.antenrig3", 47, 0); - setTextureOffset("LEG11ROT.leg11", 34, 0); - setTextureOffset("LEG12ROT.leg12", 34, 3); - setTextureOffset("LEG21ROT.leg21", 34, 0); - setTextureOffset("LEG22ROT.leg22", 34, 3); - setTextureOffset("LEG31ROT.leg31", 34, 0); - setTextureOffset("LEG32ROT.leg32", 34, 3); - setTextureOffset("LEG41ROT.leg41", 34, 0); - setTextureOffset("LEG42ROT.leg42", 34, 3); - - sidebody2 = new ModelRenderer(this, 42, 17); - sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); - sidebody2.setTextureSize(64, 32); - sidebody2.mirror = true; - setRotation(sidebody2, 0F, 0F, 0F); - body = new ModelRenderer(this, 0, 14); - body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); - body.setTextureSize(64, 32); - body.mirror = true; - setRotation(body, 0F, 0F, 0F); - sidebody3 = new ModelRenderer(this, 0, 2); - sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); - sidebody3.setTextureSize(64, 32); - sidebody3.mirror = true; - setRotation(sidebody3, 0F, 0F, 0F); - sidebody1 = new ModelRenderer(this, 42, 17); - sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); - sidebody1.setTextureSize(64, 32); - sidebody1.mirror = true; - setRotation(sidebody1, 0F, 0F, 0F); - ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); - setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); - ANTENLEFROT1.mirror = true; - ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENLEFROT2 = new ModelRenderer(this, "ANTENLEFROT2"); - ANTENLEFROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENLEFROT2, -0.5235988F, 0F, 0F); - ANTENLEFROT2.mirror = true; - ANTENLEFROT2.addBox("antenlef2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENLEFROT3 = new ModelRenderer(this, "ANTENLEFROT3"); - ANTENLEFROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENLEFROT3, -0.5235988F, 0F, 0F); - ANTENLEFROT3.mirror = true; - ANTENLEFROT3.addBox("antenlef3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENLEFROT2.addChild(ANTENLEFROT3); - ANTENLEFROT1.addChild(ANTENLEFROT2); - ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); - setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); - ANTENRIGROT1.mirror = true; - ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); - ANTENRIGROT2 = new ModelRenderer(this, "ANTENRIGROT2"); - ANTENRIGROT2.setRotationPoint(0F, 0F, -4F); - setRotation(ANTENRIGROT2, -0.5235988F, 0F, 0F); - ANTENRIGROT2.mirror = true; - ANTENRIGROT2.addBox("antenrig2", -0.5F, -0.5F, -3F, 1, 1, 3); - ANTENRIGROT3 = new ModelRenderer(this, "ANTENRIGROT3"); - ANTENRIGROT3.setRotationPoint(0F, 0F, -3F); - setRotation(ANTENRIGROT3, -0.5235988F, 0F, 0F); - ANTENRIGROT3.mirror = true; - ANTENRIGROT3.addBox("antenrig3", -0.5F, -0.5F, -2F, 1, 1, 2); - ANTENRIGROT2.addChild(ANTENRIGROT3); - ANTENRIGROT1.addChild(ANTENRIGROT2); - LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); - setRotation(LEG11ROT, 0F, 0F, -0.1745329F); - LEG11ROT.mirror = true; - LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); - LEG12ROT = new ModelRenderer(this, "LEG12ROT"); - LEG12ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG12ROT, 0F, 0F, -0.7853982F); - LEG12ROT.mirror = true; - LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); - LEG11ROT.addChild(LEG12ROT); - LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); - setRotation(LEG21ROT, 0F, 0F, 0.1745329F); - LEG21ROT.mirror = true; - LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); - LEG22ROT = new ModelRenderer(this, "LEG22ROT"); - LEG22ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG22ROT, 0F, 0F, 0.7853982F); - LEG22ROT.mirror = true; - LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); - LEG21ROT.addChild(LEG22ROT); - LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); - setRotation(LEG31ROT, 0F, 0F, -0.1745329F); - LEG31ROT.mirror = true; - LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); - LEG32ROT = new ModelRenderer(this, "LEG32ROT"); - LEG32ROT.setRotationPoint(-4F, 0F, 0F); - setRotation(LEG32ROT, 0F, 0F, -0.7853982F); - LEG32ROT.mirror = true; - LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); - LEG31ROT.addChild(LEG32ROT); - LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); - setRotation(LEG41ROT, 0F, 0F, 0.1745329F); - LEG41ROT.mirror = true; - LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); - LEG42ROT = new ModelRenderer(this, "LEG42ROT"); - LEG42ROT.setRotationPoint(4F, 0F, 0F); - setRotation(LEG42ROT, 0F, 0F, 0.7853982F); - LEG42ROT.mirror = true; - LEG42ROT.addBox("leg42", 0F, -0.5F, -1F, 2, 1, 2); - LEG41ROT.addChild(LEG42ROT); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - sidebody2.render(f5); - body.render(f5); - sidebody3.render(f5); - sidebody1.render(f5); - ANTENLEFROT1.render(f5); - ANTENRIGROT1.render(f5); - LEG11ROT.render(f5); - LEG21ROT.render(f5); - LEG31ROT.render(f5); - LEG41ROT.render(f5); - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - - ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/41e421fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/41e421fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index f05fd75..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/41e421fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,33 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import projectzulu.common.api.BlockList; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class CreativePZGeneralTab extends CreativeTabs { - - public CreativePZGeneralTab(int par1, String par2Str) { - super(par1, par2Str); - } - - @Override - @SideOnly(Side.CLIENT) - public String getTranslatedTabLabel() { - return "Project Zulu General"; - } - - @Override - public Item getTabIconItem() { - return Item.getItemFromBlock(BlockList.campfire.isPresent() ? BlockList.campfire.get() : Blocks.grass); - } - - @Override - public int func_151243_f() { - return 3; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/7098cdffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/7098cdffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 77e0029..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/7098cdffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,35 +0,0 @@ -package com.ngb.projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeSapling; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeSapling extends BlockDeclaration { - - public PalmTreeSapling() { - super("PalmTreeSapling"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeSapling = Optional.of(new BlockPalmTreeSapling().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeSapling.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("sapling", new ItemStack(block)); - OreDictionary.registerOre("saplingPalm", new ItemStack(block)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/810d58e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/810d58e4c42100141fce95f06aba7e85 deleted file mode 100644 index b059077..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/810d58e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,63 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import java.io.File; - -import net.minecraft.block.Block; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import projectzulu.common.ProjectZulu_Core; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.tombstone.BlockTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstone; -import projectzulu.common.blocks.tombstone.TileEntityTombstoneRenderer; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class TombstoneDeclaration extends BlockDeclaration { - - public TombstoneDeclaration() { - super("Tombstone"); - } - - @Override - protected boolean createBlock() { - BlockList.tombstone = Optional - .of(new BlockTombstone(TileEntityTombstone.class).setBlockName(name.toLowerCase()).setBlockTextureName( - DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.tombstone.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - Configuration tempConfig = new Configuration(new File(ProjectZulu_Core.modConfigDirectoryFile, - DefaultProps.configDirectory + DefaultProps.tempConfigFile)); - tempConfig.load(); - Property property = tempConfig.get("TempSettings.Tombstone", "useAlterantiveTileEntityName", false); - if (!property.getBoolean(false)) { - try { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "TileEntityTombstone"); - } catch (IllegalArgumentException e) { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - } - } else { - GameRegistry.registerTileEntity(TileEntityTombstone.class, "PZTileEntityTombstone"); - property.set(true); - } - tempConfig.save(); - } - - @Override - @SideOnly(Side.CLIENT) - protected void clientRegisterBlock() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTombstone.class, new TileEntityTombstoneRenderer()); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/906cbff4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/906cbff4c42100141fce95f06aba7e85 deleted file mode 100644 index 3b454af..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/906cbff4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package com.ngb.projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionWaterBreathing extends SubItemPotionGeneric { - - public SubItemPotionWaterBreathing(Item itemID, int subID) { - super(itemID, subID, "potion.waterBreathing"); - setSubItemBounds(4, 4, 1, 0); - setEffectScale(20 * 20, 20 * 5, 14, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.waterBreathing); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/907900fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/907900fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 69b4fa5..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/907900fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,419 +0,0 @@ -package com.ngb.projectzulu.common.blocks; - -import static net.minecraftforge.common.ChestGenHooks.DUNGEON_CHEST; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.ShapedOreRecipe; -import net.minecraftforge.oredict.ShapelessOreRecipe; -import projectzulu.common.Properties; -import projectzulu.common.api.BlockList; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.OptionalItemStack; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; - -public class ItemBlockRecipeManager { - - public static void setupBlockModuleRecipies() { - if (Loader.isModLoaded("ExtrabiomesXL")) { - setupExtrabiomesXLRecipies(); - } - setupCampfireRecipies(); - setupArmorRecipies(); - - /* Tombstone */ - addRecipe(new OptionalItemStack(BlockList.tombstone), new String[] { "CCC", "CSC", "CCC" }, new char[] { 'C', - 'S' }, new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.sign)); - - /* Palm Tree Recipies */ - addSmelting(new OptionalItemStack(Items.coal, 1, 1), 0, new OptionalItemStack(BlockList.palmTreeLog)); - addShapelessRecipe(new OptionalItemStack(BlockList.palmTreePlank, 4), new OptionalItemStack( - BlockList.palmTreeLog)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { "X ", "X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X ", " X ", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " X", " X", " " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", "X ", "X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X ", " X " }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - addRecipe(new OptionalItemStack(BlockList.palmTreeDoubleSlab), new String[] { " ", " X", " X" }, 'X', - new OptionalItemStack(BlockList.palmTreeSlab)); - - /* Jasper */ - if (BlockList.jasper.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(BlockList.jasper.get()), 1, 1, 5)); - } - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.dye, 1, 1)); - addRecipe(new OptionalItemStack(BlockList.jasper), new String[] { "XXX", "XCX", "XXX" }, - new char[] { 'C', 'X' }, new OptionalItemStack(Blocks.sand), new OptionalItemStack(Items.redstone)); - - /* Coconut */ - if (ItemList.coconutSeed.isPresent() && ItemList.coconutItem.isPresent()) { - FMLCommonHandler.instance().bus().register(new CoconutCraftingHandler()); - } - addRecipe(new OptionalItemStack(Items.bowl), new String[] { " ", "X X", " X " }, 'X', new OptionalItemStack( - ItemList.coconutShell)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.wooden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.stone_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.iron_sword, 1, OreDictionary.WILDCARD_VALUE), new OptionalItemStack( - ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.golden_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - addRecipe(new OptionalItemStack(ItemList.coconutSeed), new String[] { " X ", " Y ", " " }, new char[] { 'X', - 'Y' }, new OptionalItemStack(Items.diamond_sword, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(ItemList.coconutItem)); - - /* Aloe Vera */ - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { "C ", "C ", "C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C ", " C ", " C " }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addRecipe(new OptionalItemStack(Items.string, 6), new String[] { " C", " C", " C" }, 'C', - new OptionalItemStack(BlockList.tumbleweed)); - addShapelessRecipe(new OptionalItemStack(BlockList.aloeVera, 2), new OptionalItemStack(BlockList.tumbleweed)); - - /* Brewing Stand */ - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack( - "log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandSingle), true, - new String[] { "GGG", "CLC", "LLL" }, new char[] { 'G', 'C', 'L' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack("cobbleRed"), new OptionalItemStack("log")); - shapedOreRecipe(new OptionalItemStack(BlockList.brewingStandTriple), true, - new String[] { "GGG", "LNL", "NNN" }, new char[] { 'G', 'L', 'N' }, - new OptionalItemStack(Blocks.glass), new OptionalItemStack(Items.glowstone_dust), - new OptionalItemStack(Blocks.nether_brick)); - - /* Misc Generic Craftables */ - if (ItemList.genericCraftingItems.isPresent()) { - ChestGenHooks.getInfo(DUNGEON_CHEST).addItem( - new WeightedRandomChestContent(new ItemStack(ItemList.genericCraftingItems.get(), 1, - ItemGenerics.Properties.ShinyBauble.meta()), 3, 8, 35)); - } - addRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.ShinyBauble.meta()), - new String[] { " G ", "GNG", " G " }, new char[] { 'G', 'N' }, new OptionalItemStack( - Items.glowstone_dust), new OptionalItemStack(Items.nether_wart)); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Salt.meta()), - new OptionalItemStack(Items.gunpowder)); - addRecipe(new OptionalItemStack(BlockList.spike), new String[] { " ", " ", "TTT" }, 'T', - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Tusk.meta())); - addShapelessRecipe(new OptionalItemStack(Items.string), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.RawFiber.meta())); // 4 RawFib --> 1 String - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 2, ItemGenerics.Properties.Pulp.meta()), - new OptionalItemStack(Items.paper)); - addShapelessRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.PricklyPowder.meta()), new OptionalItemStack(Blocks.cactus), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Pulp.meta())); - - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.BlackLichen.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(Items.milk_bucket), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Pulp.meta()), new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.Ectoplasm.meta())); - addShapelessRecipe( - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.GlowingGoo.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.PowderSlush.meta()), - new OptionalItemStack(ItemList.genericCraftingItems, 1, ItemGenerics.Properties.Ectoplasm.meta())); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.SmallUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.SmallHeart.meta()), new OptionalItemStack( - "foodSalt")); - shapelessOreRecipe(new OptionalItemStack(ItemList.genericCraftingItems, 1, - ItemGenerics.Properties.LargeUnhealthyHeart.meta()), new OptionalItemStack( - ItemList.genericCraftingItems, 1, ItemGenerics.Properties.LargeHeart.meta()), new OptionalItemStack( - "foodSalt")); - - addShapelessRecipe(new OptionalItemStack(Items.leather), new OptionalItemStack(ItemList.furPelt)); - if (ItemList.furPelt.isPresent() && ItemList.genericCraftingItems.isPresent()) { - FMLCommonHandler.instance().bus().register(new RawFiberCraftingHandler()); - } - - /* Flower Pot */ - if (!Properties.replaceFlowerPot) { - addShapelessRecipe(new OptionalItemStack(Items.flower_pot), new OptionalItemStack( - BlockList.universalFlowerPot)); - addShapelessRecipe(new OptionalItemStack(BlockList.universalFlowerPot), new OptionalItemStack( - Items.flower_pot)); - } - } - - private static void setupExtrabiomesXLRecipies() { - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack("cobbleRed"), - new OptionalItemStack(Items.stick)); - } - - private static void setupCampfireRecipies() { - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 0), true, new String[] { " ", "LLL", " " }, - new char[] { 'L' }, new OptionalItemStack("log")); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 1), true, new String[] { " ", "LLL", "CCC" }, - new char[] { 'L', 'C' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 2), true, new String[] { " S ", "LLL", " " }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE), - new OptionalItemStack(Blocks.cobblestone), new OptionalItemStack(Items.stick)); - shapedOreRecipe(new OptionalItemStack(BlockList.campfire, 1, 3), true, new String[] { " S ", "LLL", "CCC" }, - new char[] { 'L', 'C', 'S' }, new OptionalItemStack("log"), new OptionalItemStack(Blocks.cobblestone), - new OptionalItemStack(Blocks.cobblestone)); - } - - private static void setupArmorRecipies() { - - addRecipe(new OptionalItemStack(ItemList.scaleArmorHead), new String[] { "XXX", "X X", " " }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorChest), new String[] { "X X", "XXX", "XXX" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorLeg), new String[] { "XXX", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - addRecipe(new OptionalItemStack(ItemList.scaleArmorBoots), new String[] { " ", "X X", "X X" }, 'X', - new OptionalItemStack(ItemList.scaleItem)); - - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.goldScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.gold_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorHead), new String[] { "XXX", "XYX", " " }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, new char[] { - 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack(ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.ironScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.iron_ingot), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorHead), new String[] { "XXX", "XYX", " " }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorHead)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorChest), new String[] { "XYX", "XXX", "XXX" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorChest)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorLeg), new String[] { "XXX", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorLeg)); - addRecipe(new OptionalItemStack(ItemList.diamondScaleArmorBoots), new String[] { " ", "XYX", "X X" }, - new char[] { 'X', 'Y' }, new OptionalItemStack(Items.diamond), new OptionalItemStack( - ItemList.scaleArmorBoots)); - - addRecipe(new OptionalItemStack(ItemList.redClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - addRecipe(new OptionalItemStack(ItemList.redClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 14)); - - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 13)); - addRecipe(new OptionalItemStack(ItemList.greenClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - addRecipe(new OptionalItemStack(ItemList.greenClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 5)); - - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 11)); - addRecipe(new OptionalItemStack(ItemList.blueClothHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - addRecipe(new OptionalItemStack(ItemList.blueClothBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.wool, 1, 3)); - - addRecipe(new OptionalItemStack(ItemList.cactusArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - addRecipe(new OptionalItemStack(ItemList.cactusArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(Blocks.cactus)); - - addRecipe(new OptionalItemStack(ItemList.furArmorHead), new String[] { "XXX", "X X", " " }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorChest), new String[] { "X X", "XXX", "XXX" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorLeg), new String[] { "XXX", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - addRecipe(new OptionalItemStack(ItemList.furArmorBoots), new String[] { " ", "X X", "X X" }, - new char[] { 'X' }, new OptionalItemStack(ItemList.furPelt)); - } - - public static void shapelessOreRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - Object[] objectComp = new Object[component.length]; - for (int i = 0; i < objectComp.length; i++) { - objectComp[i] = component[i].createRecipeObject(); - } - CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result.createItemStack(), objectComp)); - } - - public static void shapedOreRecipe(OptionalItemStack result, boolean mirrored, String[] craftingRecipe, - char[] compChar, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) { - return; - } - } - - Object[] objectComponents = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - objectComponents[i] = craftingRecipe[i]; - } - for (int i = 0; i < component.length; i++) { - objectComponents[i * 2 + craftingRecipe.length] = compChar[i]; - objectComponents[i * 2 + craftingRecipe.length + 1] = component[i].createRecipeObject(); - } - - CraftingManager.getInstance().getRecipeList() - .add(new ShapedOreRecipe(result.createItemStack(), mirrored, objectComponents)); - } - - public static void addSmelting(OptionalItemStack result, int xp, OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - GameRegistry.addSmelting(component.createItemStack(), result.createItemStack(), xp); - } - - public static void addShapelessRecipe(OptionalItemStack result, OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack optionalItemStack : component) { - if (!optionalItemStack.isPresent()) { - return; - } - } - Object[] itemStackComp = new ItemStack[component.length]; - for (int i = 0; i < itemStackComp.length; i++) { - itemStackComp[i] = component[i].createItemStack(); - } - GameRegistry.addShapelessRecipe(result.createItemStack(), itemStackComp); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char compChar, - OptionalItemStack component) { - if (!result.isPresent() || !component.isPresent()) { - return; - } - addRecipe(result.createItemStack(), craftingRecipe, new char[] { compChar }, component.createItemStack()); - } - - public static void addRecipe(OptionalItemStack result, String[] craftingRecipe, char[] compChar, - OptionalItemStack... component) { - if (!result.isPresent()) { - return; - } - for (OptionalItemStack pairCharParam : component) { - if (!pairCharParam.isPresent()) - return; - } - ItemStack[] itemStackComponents = new ItemStack[component.length]; - for (int i = 0; i < component.length; i++) { - itemStackComponents[i] = component[i].createItemStack(); - } - addRecipe(result.createItemStack(), craftingRecipe, compChar, itemStackComponents); - } - - public static void addRecipe(ItemStack itemResult, String[] craftingRecipe, char[] compChar, ItemStack... component) { - Object[] componentList = new Object[craftingRecipe.length + compChar.length * 2]; - for (int i = 0; i < craftingRecipe.length; i++) { - componentList[i] = craftingRecipe[i]; - } - for (int i = 0; i < compChar.length; i++) { - componentList[i * 2 + craftingRecipe.length] = compChar[i]; - componentList[i * 2 + craftingRecipe.length + 1] = component[i]; - } - GameRegistry.addRecipe(itemResult, componentList); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a2dfbef9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a2dfbef9c42100141fce95f06aba7e85 deleted file mode 100644 index 8795cd8..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/a2dfbef9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,47 +0,0 @@ -package com.ngb.projectzulu.common.core.entitydeclaration; - -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityList.EntityEggInfo; -import net.minecraft.entity.EnumCreatureType; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.ProjectZulu_Core; -import com.ngb.projectzulu.common.api.CustomMobData; - -public abstract class EggableDeclaration extends CreatureDeclaration { - - protected int eggColor1; - protected int eggColor2; - - protected EggableDeclaration(String mobName, int entityID, Class mobClass, EnumCreatureType creatureType) { - super(mobName, entityID, mobClass, creatureType); - } - - @Override - public void loadCreaturesFromConfig(Configuration config) { - super.loadCreaturesFromConfig(config); - eggColor1 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor1", eggColor1).getInt( - eggColor1); - eggColor2 = config.get("MOB CONTROLS." + mobName, mobName.toLowerCase() + " EggColor2", eggColor2).getInt( - eggColor2); - } - - /* - * Create loadCustomMobData() method which calls outputData to List. loadCustom contains calls that are the same for - * all creatures - */ - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - super.outputDataToList(config, customMobData); - } - - @Override - public void registerEgg() { - super.registerEgg(); - int eggID = ProjectZulu_Core.getNextDefaultEggID(); - while (EntityList.IDtoClassMapping.containsKey(eggID)) { - eggID = ProjectZulu_Core.getNextDefaultEggID(); - } - EntityList.IDtoClassMapping.put(eggID, mobClass); - EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/c0b2219ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/c0b2219ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 572819d..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/c0b2219ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,605 +0,0 @@ -package projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderCampFire implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - RenderItem itemRenderer = new RenderItem(); - - ItemStack itemStackToRender = new ItemStack(block, 1, metadata); - - itemRenderer.setRenderManager(RenderManager.instance); - EntityItem entityItemToRender = new EntityItem(Minecraft.getMinecraft().theWorld, 0, 0, 0, itemStackToRender); - entityItemToRender.hoverStart = 0; - - float scaleItem = 1.5f; - GL11.glPushMatrix(); - - Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glRotatef((float) (90f * Math.PI / 180f), 1, 0, 0); - GL11.glScalef(scaleItem, scaleItem, scaleItem); - itemRenderer.doRender(entityItemToRender, 0, 0, 0, 0, 0); - GL11.glPopMatrix(); - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - /** - * Render Campfire Stones - */ - public boolean render(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, int modelId, - RenderBlocks renderer) { - - Tessellator var5 = Tessellator.instance; - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, par2, par3, par4); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - double var19 = par2; - double var20 = par3; - double var15 = par4; - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case WoodFire: - case StoneFire: - /* Render If Should and Render Campfire Fire */ - renderBlockFire(blockAccess, par2, par3, par4, par1Block, modelId, renderer); - break; - case Stone: - case Wood: - break; - } - - switch (BlockCampfire.Type.getTypeByMeta(blockAccess.getBlockMetadata(par2, par3, par4))) { - case Wood: - case WoodFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.35, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.24, var20, var15 + 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.24, var20, var15 - 0.24, renderer, 0.33, 0.2, 0.2, 45 * Math.PI / 180); - - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.21, var20, var15 + 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.21, var20, var15 - 0.21, renderer, 0.4, 0.2, 0.2, (90 + 45) * Math.PI / 180); - break; - case Stone: - case StoneFire: - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Logs */ - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), var19, - var20, var15, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, 45 * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 - 0.14, var20, var15 + 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - renderCampireRectangle2Sides(par1Block, 20, 21, blockAccess.getBlockMetadata(par2, par3, par4), - var19 + 0.14, var20, var15 - 0.14, renderer, 0.2, 0.2, 0.2, (90 + 45) * Math.PI / 180); - - /* Render Campfire Stones */ - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.4, var20, - var15 + 0.0, renderer, 0.2, 0.3, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 + 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.0, var20, - var15 - 0.4, renderer, 0.3, 0.2, 0.3, 0.0); - - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 135 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 - 0.33, var20, - var15 + 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - renderCampireRectangle(par1Block, 16, blockAccess.getBlockMetadata(par2, par3, par4), var19 + 0.33, var20, - var15 - 0.33, renderer, 0.3, 0.2, 0.3, 45 * Math.PI / 180); - break; - } - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle2Sides(Block par1Block, int index1, int index2, int par2, double par3, - double par5, double par7, RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - double var13 = var10.getMinU(); - double var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) / 2.01f; - double var17 = var10.getMinV(); - double var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) / 2.01f; - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - var10 = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - var13 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 0.99f / 4f; - var15 = var10.getMinU() + (var10.getMaxU() - var10.getMinU()) * 2.99f / 4f; - var17 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 0.99f / 4f; - var19 = var10.getMinV() + (var10.getMaxV() - var10.getMinV()) * 2.99f / 4f; - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - return true; - } - - /** - * Function that Renders a Rectangle at provided position with provided width, height and angle (about the Y axis) - * - * @param par1Block - * @param var10 - * @param par2 - * @param par3 - * @param par5 - * @param par7 - * @param renderer - * @param xWidth - * @param zWidth - * @param yMax - * @param angle - * @return - */ - private boolean renderCampireRectangle(Block par1Block, int var10, int par2, double par3, double par5, double par7, - RenderBlocks renderer, double xWidth, double zWidth, double yMax, double angle) { - Tessellator var9 = Tessellator.instance; - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 3, 2); - double var13 = icon.getMinU(); - double var15 = icon.getMinU() + (icon.getMaxU() - icon.getMinU()) / 2.01f; - double var17 = icon.getMinV(); - double var19 = icon.getMinV() + (icon.getMaxV() - icon.getMinV()) / 2.01f; - - double yMin = 0.0f; - - double intermedVarX = -xWidth / 2; - double intermedVarZ = +zWidth / 2; - double point1X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point1Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = -xWidth / 2; - intermedVarZ = -zWidth / 2; - double point2X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point2Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = -zWidth / 2; - double point3X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point3Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - intermedVarX = +xWidth / 2; - intermedVarZ = +zWidth / 2; - double point4X = par3 + 0.5D + intermedVarX * Math.cos(angle) - intermedVarZ * Math.sin(angle); - double point4Z = par7 + 0.5D + intermedVarX * Math.sin(angle) + intermedVarZ * Math.cos(angle); - - /* Side 1 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 3 */ - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var13, var17); - - /* Side 2 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - /* Side 4 */ - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var15, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var15, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var13, var17); - - /* Side 5 */ - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMax, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMax, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMax, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMax, point1Z, var13, var17); - - /* Side 6 */ - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - - var9.addVertexWithUV(point4X, par5 + yMin, point4Z, var15, var17); - var9.addVertexWithUV(point3X, par5 + yMin, point3Z, var15, var19); - var9.addVertexWithUV(point2X, par5 + yMin, point2Z, var13, var19); - var9.addVertexWithUV(point1X, par5 + yMin, point1Z, var13, var17); - - return true; - } - - /** - * Renders a fire block at the given coordinates - */ - public boolean renderBlockFire(IBlockAccess blockAccess, int par2, int par3, int par4, Block par1Block, - int modelId, RenderBlocks renderer) { - Tessellator var5 = Tessellator.instance; - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); - var5.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, par2, par3, par4)); - - IIcon icon = renderer.getBlockIconFromSideAndMetadata(Blocks.fire, 0, 0); - double var9 = icon.getMinU(); - double var11 = icon.getMaxU(); - double var13 = icon.getMinV(); - double var15 = icon.getMaxV(); - - float var17 = 1.4F; - double var20; - double var22; - double var24; - double var26; - double var28; - double var30; - double var32; - - if (!World.doesBlockHaveSolidTopSurface(blockAccess, par2, par3 - 1, par4) - && !Blocks.fire.canCatchFire(blockAccess, par2, par3 - 1, par4, ForgeDirection.UP)) { - float var36 = 0.2F; - float var19 = 0.0625F; - - if ((par2 + par3 + par4 & 1) == 1) { - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - } - - if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { - var20 = var11; - var11 = var9; - var9 = var20; - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 - 1, par3, par4, ForgeDirection.EAST)) { - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + var36, par3 + var17 + var19, par4 + 1, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2 + 1, par3, par4, ForgeDirection.WEST)) { - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 1, var11, var13); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 1, var11, var15); - var5.addVertexWithUV(par2 + 1 - 0, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1 - var36, par3 + var17 + var19, par4 + 0, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 - 1, ForgeDirection.SOUTH)) { - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + var36, var11, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3, par4 + 1, ForgeDirection.NORTH)) { - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + var17 + var19, par4 + 1 - var36, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0 + var19, par4 + 1 - 0, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0 + var19, par4 + 1 - 0, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17 + var19, par4 + 1 - var36, var9, var13); - } - - if (Blocks.fire.canCatchFire(blockAccess, par2, par3 + 1, par4, ForgeDirection.DOWN)) { - var20 = par2 + 0.5D + 0.5D; // 1 - var22 = par2 + 0.5D - 0.5D; // 0 - var24 = par4 + 0.5D + 0.5D; - var26 = par4 + 0.5D - 0.5D; - - var28 = par2 + 0.5D - 0.5D; - var30 = par2 + 0.5D + 0.5D; - var32 = par4 + 0.5D - 0.5D; - double var34 = par4 + 0.5D + 0.5D; - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - ++par3; - var17 = -0.2F; - - if ((par2 + par3 + par4 & 1) == 0) { - var5.addVertexWithUV(var28, par3 + var17, par4 + 0, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 1, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 1, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(var30, par3 + var17, par4 + 1, var11, var13); - var5.addVertexWithUV(var22, par3 + 0, par4 + 1, var11, var15); - var5.addVertexWithUV(var22, par3 + 0, par4 + 0, var9, var15); - var5.addVertexWithUV(var30, par3 + var17, par4 + 0, var9, var13); - } else { - var5.addVertexWithUV(par2 + 0, par3 + var17, var34, var11, var13); - var5.addVertexWithUV(par2 + 0, par3 + 0, var26, var11, var15); - var5.addVertexWithUV(par2 + 1, par3 + 0, var26, var9, var15); - var5.addVertexWithUV(par2 + 1, par3 + var17, var34, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 1, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 1, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0, par3 + var17, var32, var9, var13); - } - } - } else { - double var18 = par2 + 0.5D + 0.2D; - var20 = par2 + 0.5D - 0.2D; // - var22 = par4 + 0.5D + 0.2D; - var24 = par4 + 0.5D - 0.2D; - var26 = par2 + 0.5D - 0.3D; - var28 = par2 + 0.5D + 0.3D; - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - - var18 = par2 + 0.5D - 0.3D; // - var20 = par2 + 0.5D + 0.3D; // / - var22 = par4 + 0.5D - 0.3D; - var24 = par4 + 0.5D + 0.3D; - var26 = par2 + 0.5D - 0.3D; // - var28 = par2 + 0.5D + 0.3D; // / - var30 = par4 + 0.5D - 0.3D; - var32 = par4 + 0.5D + 0.3D; - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.2, var9, var13); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.2, var9, var15); - var5.addVertexWithUV(var18, par3 + 0, par4 + 0.8, var11, var15); - var5.addVertexWithUV(var26, par3 + var17, par4 + 0.8, var11, var13); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.8, var9, var13); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.8, var9, var15); - var5.addVertexWithUV(var20, par3 + 0, par4 + 0.2, var11, var15); - var5.addVertexWithUV(var28, par3 + var17, par4 + 0.2, var11, var13); - - var9 = icon.getMinU(); - var11 = icon.getMaxU(); - var13 = icon.getMinV(); - var15 = icon.getMaxV(); - - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var32, var9, var13); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var24, var9, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var24, var11, var15); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var32, var11, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + var17, var30, var9, var13); - var5.addVertexWithUV(par2 + 0.8, par3 + 0, var22, var9, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + 0, var22, var11, var15); - var5.addVertexWithUV(par2 + 0.2, par3 + var17, var30, var11, var13); - } - - return true; - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/d04f46f5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/d04f46f5c42100141fce95f06aba7e85 deleted file mode 100644 index dd9ed3a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/d04f46f5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,596 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.mobs.entity.EntityHornBill; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/f054c7e5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/f054c7e5c42100141fce95f06aba7e85 deleted file mode 100644 index 7179139..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fd/f054c7e5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,147 +0,0 @@ -package projectzulu.common.potion.brewingstands; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class ContainerBrewingStandSingle extends Container { - - private TileEntityBrewingBase tileBrewingStand; - - /** Instance of Slot. */ - private final Slot theSlot; - private int brewTime = 0; - public final int potionSlots; - - public ContainerBrewingStandSingle(InventoryPlayer par1InventoryPlayer, TileEntityBrewingBase brewingStand) { - this.tileBrewingStand = brewingStand; - potionSlots = tileBrewingStand.getSizeInventory() - 1; - int slotID = 0; - if (potionSlots >= 1) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 79, - 53)); - } - - if (potionSlots >= 3) { - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, 56, - 46)); - addSlotToContainer(new SlotBrewingStandSinglePotion(par1InventoryPlayer.player, brewingStand, slotID++, - 102, 46)); - } - this.theSlot = this.addSlotToContainer(new SlotBrewingStandSingleIngredient(this, brewingStand, slotID++, 79, - 17)); - int i; - - /* Add Inventory Slots */ - for (i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - /* Add Hot Bar Slots */ - for (i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } - - @Override - public void addCraftingToCrafters(ICrafting par1ICrafting) { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - - /** - * Looks for changes made in the container, sends them to every listener. - */ - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - for (int i = 0; i < this.crafters.size(); ++i) { - ICrafting icrafting = (ICrafting) this.crafters.get(i); - - if (this.brewTime != this.tileBrewingStand.getBrewTime()) { - icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - } - this.brewTime = this.tileBrewingStand.getBrewTime(); - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - if (par1 == 0) { - this.tileBrewingStand.setBrewTime(par2); - } - } - - @Override - public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - int potionMin = 0; - int potionMax = potionSlots + 1; // 4; - int hotBarMin = potionSlots + 1 + 3 * 9; // 31; - int hotBarMax = potionSlots + 1 + 3 * 9 + 9; // 40; - int inventMin = potionSlots + 1; // 4; - int inventMax = potionSlots + 1 + 3 * 9;// 31; - - ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - if ((par2 < 0 || par2 > potionMax)) { - if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(itemstack1)) { - if (!this.mergeItemStack(itemstack1, potionMax - 1, potionMax, false)) { - return null; - } - } else if (SlotBrewingStandSinglePotion.canHoldPotion(itemstack)) { - if (!this.mergeItemStack(itemstack1, potionMin, potionMax - 1, false)) { - return null; - } - } else if (par2 >= inventMin && par2 < inventMax) { - if (!this.mergeItemStack(itemstack1, hotBarMin, hotBarMax, false)) { - return null; - } - } else if (par2 >= hotBarMin && par2 < hotBarMax) { - if (!this.mergeItemStack(itemstack1, inventMin, inventMax, false)) { - return null; - } - } else if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, false)) { - return null; - } - } else { - if (!this.mergeItemStack(itemstack1, inventMin, hotBarMax, true)) { - return null; - } - slot.onSlotChange(itemstack1, itemstack); - } - - if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); - } else { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - return itemstack; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/1143699ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/1143699ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 6947281..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/1143699ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,122 +0,0 @@ -package projectzulu.common.dungeon.commands; - -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.command.CommandBase; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.NumberInvalidException; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.command.WrongUsageException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.server.MinecraftServer; - -public class CommandPlaceBlock extends CommandBase { - @Override - public String getCommandName() { - return "placeblock"; - } - - /** - * Return the required permission level for this command. - */ - @Override - public int getRequiredPermissionLevel() { - return 2; - } - - /** - * Command stringArgs : /placeblock [targetPlayer] [blockID] Command stringArgs == 2: /placeblock @p - * blockID Command stringArgs == 3: /placeblock @p blockID Command stringArgs == 5: /placeblock @p blockID - * Command stringArgs == 6: /placeblock @p blockID - */ - @Override - public void processCommand(ICommandSender commandSender, String[] stringArgs) { - if (stringArgs.length < 2) { - throw new WrongUsageException("commands.placeblock.usage", new Object[0]); - } else { - int targetX = 0; - int targetY = 0; - int targetZ = 0; - int blockMeta = 0; - EntityPlayerMP targetPlayer = getPlayer(commandSender, stringArgs[0]); - if (targetPlayer == null) { - throw new PlayerNotFoundException(); - } - - Block blockToPlace = Block.getBlockFromName(stringArgs[1]); - if (blockToPlace == null) { - throw new WrongUsageException("commands.placeblock.noblock", new Object[0]); - } - - if (stringArgs.length == 3 || stringArgs.length == 6) { - blockMeta = parseIntBounded(commandSender, stringArgs[2], 0, 4095); - } - - if (stringArgs.length == 2 || stringArgs.length == 3) { - targetX = (int) targetPlayer.posX; - targetY = (int) targetPlayer.posY; - targetZ = (int) targetPlayer.posZ; - } else if (stringArgs.length == 5 || stringArgs.length == 6) { - int indexOfPos = stringArgs.length - 3; - targetX = (int) parsePosition(commandSender, targetPlayer.posX, stringArgs[indexOfPos++]); - targetY = (int) parsePositionWithBounds(commandSender, targetPlayer.posY, stringArgs[indexOfPos++], 0, - 0); - targetZ = (int) parsePosition(commandSender, targetPlayer.posZ, stringArgs[indexOfPos++]); - } - - targetPlayer.worldObj.setBlock(targetX, targetY, targetZ, blockToPlace, blockMeta, 3); - } - } - - @Override - public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spawnentity.usage"; - } - - /** - * Adds the strings available in this command to the given list of tab completion options. - */ - @Override - public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord( - par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - - private double parsePosition(ICommandSender commandSender, double currentPos, String stringDouble) { - return this.parsePositionWithBounds(commandSender, currentPos, stringDouble, -30000000, 30000000); - } - - private double parsePositionWithBounds(ICommandSender commandSender, double currentPos, String stringDouble, - int lowerLimit, int upperLimit) { - boolean isRelativeCoords = stringDouble.startsWith("~"); - double targetPos = isRelativeCoords ? currentPos : 0.0D; - - if (!isRelativeCoords || stringDouble.length() > 1) { - boolean hasDecimal = stringDouble.contains("."); - - if (isRelativeCoords) { - stringDouble = stringDouble.substring(1); - } - - targetPos += parseDouble(commandSender, stringDouble); - - if (!hasDecimal && !isRelativeCoords) { - targetPos += 0.5D; - } - } - - if (lowerLimit != 0 || upperLimit != 0) { - if (targetPos < lowerLimit) { - throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(lowerLimit) }); - } - - if (targetPos > upperLimit) { - throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] { - Double.valueOf(targetPos), Integer.valueOf(upperLimit) }); - } - } - return targetPos; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/115ccd9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/115ccd9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a2d89cd..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/115ccd9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,217 +0,0 @@ -package projectzulu.common.mobs.entity; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.ai.EntityAIBase; -import net.minecraft.pathfinding.PathEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.CustomEntityList; -import projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; - -public abstract class EntityGenericCreature extends EntityAerial { - private PathEntity pathToEntity; - - public boolean hasPath() { - return this.pathToEntity != null; - } - - /** The Entity this EntityCreature is set to attack. */ - protected Entity entityToAttack; - - public Entity getEntityToAttack() { - return this.entityToAttack; - } - - public void setTarget(Entity par1Entity) { - this.entityToAttack = par1Entity; - } - - private float maximumHomeDistance = -1.0F; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); - private boolean field_110180_bt; - // Cooldown instituted on the entity when it attempts to find a path but fails. - private int leashPathCooldown = 0; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0f); - - /** - * returns true if a creature has attacked recently only used for creepers and skeletons - */ - /* Do I need this? */ - // protected boolean hasAttacked = false; - - /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick = 0; - - public int getFleeTick() { - return fleeingTick; - } - - public void setFleeTick(int fleeingTick) { - this.fleeingTick = fleeingTick; - } - - /* Entity State Variables */ - protected int animTime = 0; - - public int getAnimTime() { - return animTime; - } - - public void setAnimTime(int animTime) { - this.animTime = animTime; - } - - protected int angerLevel = 0; - - public int getAngerLevel() { - return angerLevel; - } - - public void setAngerLevel(int angerLevel) { - this.angerLevel = angerLevel; - } - - protected EntityStates entityState = EntityStates.idle; - - public EntityStates getEntityState() { - return entityState; - } - - public EntityGenericCreature(World par1World) { - super(par1World); - } - - @Override - protected boolean isAIEnabled() { - return true; - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - attackTime = Math.max(attackTime - 1, 0); - fleeingTick = Math.max(fleeingTick - 1, 0); - angerLevel = Math.max(angerLevel - 1, 0); - } - - @Override - public void onUpdate() { - super.onUpdate(); - leashPathCooldown = Math.max(leashPathCooldown - 1, 0); - } - - @Override - protected void updateLeashedState() { - super.updateLeashedState(); - - if (this.getLeashed() && this.getLeashedToEntity() != null - && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity entity = this.getLeashedToEntity(); - this.setHomeArea((int) entity.posX, (int) entity.posY, (int) entity.posZ, 5); - float f = this.getDistanceToEntity(entity); - - if (this instanceof EntityGenericTameable && ((EntityGenericTameable) this).isSitting()) { - if (f > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - - if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(f); - if (leashPathCooldown == 0 && f > 4.0F) { - boolean foundPath = this.getNavigator().tryMoveToEntityLiving(entity, 1.0D); - if (!foundPath) { - leashPathCooldown = 20; - } - } - - if (f > 6.0F) { - double d0 = (entity.posX - this.posX) / (double) f; - double d1 = (entity.posY - this.posY) / (double) f; - double d2 = (entity.posZ - this.posZ) / (double) f; - this.motionX += d0 * Math.abs(d0) * 0.4D; - this.motionY += d1 * Math.abs(d1) * 0.4D; - this.motionZ += d2 * Math.abs(d2) * 0.4D; - } - - if (f > 10.0F) { - this.clearLeashed(true, true); - } - } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } - } - - protected void func_142017_o(float par1) { - } - - @Override - public int getMaxSpawnedInChunk() { - CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); - if (entityEntry != null) { - return entityEntry.modData.get().maxSpawnInChunk; - } else { - return super.getMaxSpawnedInChunk(); - } - } - - /** - * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. - * Args: x, y, z - */ - public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - - /** - * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. - */ - protected void attackEntity(Entity par1Entity, float par2) { - } - - /** - * Returns true if entity is within home distance from current position - */ - public boolean isWithinHomeDistanceCurrentPosition() { - return this.isWithinHomeDistance(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)); - } - - public boolean isWithinHomeDistance(int par1, int par2, int par3) { - return maximumHomeDistance == -1.0F ? true - : homePosition.getDistanceSquared(par1, par2, par3) < maximumHomeDistance * maximumHomeDistance; - } - - public void setHomeArea(int par1, int par2, int par3, int par4) { - this.homePosition.set(par1, par2, par3); - this.maximumHomeDistance = (float) par4; - } - - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } - - public float getMaximumHomeDistance() { - return this.maximumHomeDistance; - } - - public void detachHome() { - this.maximumHomeDistance = -1.0F; - } - - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/213c30fec72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/213c30fec72100141a6cb1c64d7b6ba1 deleted file mode 100644 index baa8774..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/213c30fec72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,247 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.handler.codec.MessageToMessageCodec; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.INetHandler; -import net.minecraft.network.NetHandlerPlayServer; -import projectzulu.common.core.packets.PacketPlaySound; -import projectzulu.common.core.packets.PacketStreamSound; -import projectzulu.common.core.packets.PacketTameParticle; -import projectzulu.common.dungeon.packets.PacketMobSpawner; -import projectzulu.common.mobs.packets.PacketAnimTime; -import projectzulu.common.mobs.packets.PacketFollowerMasterData; -import projectzulu.common.mobs.packets.PacketNameSync; -import projectzulu.common.mobs.packets.PacketTileText; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.network.FMLEmbeddedChannel; -import cpw.mods.fml.common.network.FMLOutboundHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -@ChannelHandler.Sharable -public class PacketPipeline extends MessageToMessageCodec { - private final String CHANNEL; - private EnumMap channels; - private ArrayList> packets = new ArrayList>(); - private boolean isInitialised; - - private class PacketRegister { - private ArrayList> packets; - - private PacketRegister(ArrayList> packets) { - this.packets = packets; - } - - /** - * Register your packet with the pipeline. Discriminators are automatically set. - * - * @param clazz the class to register - * - * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the - * registry already contains this packet - */ - public boolean registerPacket(Class clazz) { - if (this.packets.size() > 256) { - ProjectZuluLog.severe("Packet decoders are limited to 256. Cannot add %s", clazz.getClass()); - return false; - } - - if (this.packets.contains(clazz)) { - ProjectZuluLog.severe("Packet decoders %s is already registered and will be ignored.", clazz); - } - - this.packets.add(clazz); - return true; - } - } - - public PacketPipeline(String channel) { - this.CHANNEL = channel; - } - - /** - * @param FMLInitializationEvent is not needed, but call MUST occur at FMLInitializationEvent for registration. Thus - * it is required to provide guidance - */ - public void initialise(FMLInitializationEvent event) { - if (!isInitialised) { - isInitialised = true; - this.channels = NetworkRegistry.INSTANCE.newChannel(CHANNEL, this); - - PacketRegister packetRegister = new PacketRegister(packets); - packetRegister.registerPacket(PacketPlaySound.class); - packetRegister.registerPacket(PacketStreamSound.class); - packetRegister.registerPacket(PacketNameSync.class); - packetRegister.registerPacket(PacketTileText.class); - packetRegister.registerPacket(PacketMobSpawner.class); - packetRegister.registerPacket(PacketAnimTime.class); - packetRegister.registerPacket(PacketFollowerMasterData.class); - packetRegister.registerPacket(PacketTameParticle.class); - - // TODO: 1) Add Packets Manually, in which case SORTING is ridiculous - // or 2) post an event here to allow registering from anywhere and then perform SORTing to ensure order - // or 3) Split into two methods initialize() postInit() where packets can be added after channel - // registration but before sorting - // 3 is clunky, 2 is great for modules but 1 is easier and simple to transition later - Collections.sort(this.packets, new Comparator>() { - - @Override - public int compare(Class clazz1, Class clazz2) { - int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), - clazz2.getCanonicalName()); - if (com == 0) { - com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); - } - - return com; - } - }); - } - } - - // In line encoding of the packet, including discriminator setting - @Override - protected void encode(ChannelHandlerContext ctx, PZPacket msg, List out) throws Exception { - ByteBuf buffer = Unpooled.buffer(); - Class clazz = msg.getClass(); - if (!this.packets.contains(msg.getClass())) { - throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); - } - - byte discriminator = (byte) this.packets.indexOf(clazz); - buffer.writeByte(discriminator); - msg.encodeInto(ctx, buffer); - FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL) - .get()); - out.add(proxyPacket); - } - - // In line decoding and handling of the packet - @Override - protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List out) throws Exception { - ByteBuf payload = msg.payload(); - byte discriminator = payload.readByte(); - Class clazz = this.packets.get(discriminator); - if (clazz == null) { - throw new NullPointerException("No packet registered for discriminator: " + discriminator); - } - - PZPacket pkt = clazz.newInstance(); - pkt.decodeInto(ctx, payload.slice()); - - EntityPlayer player; - switch (FMLCommonHandler.instance().getEffectiveSide()) { - case CLIENT: - player = this.getClientPlayer(); - pkt.handleClientSide(player); - break; - - case SERVER: - INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); - player = ((NetHandlerPlayServer) netHandler).playerEntity; - pkt.handleServerSide(player); - break; - - default: - } - - out.add(pkt); - } - - @SideOnly(Side.CLIENT) - private EntityPlayer getClientPlayer() { - return Minecraft.getMinecraft().thePlayer; - } - - /** - * Send this message to everyone. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALL); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the specified player. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.PLAYER); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within a certain range of a point. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to everyone within the supplied dimension. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.DIMENSION); - this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); - this.channels.get(Side.SERVER).writeAndFlush(message); - } - - /** - * Send this message to the server. - *

- * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET) - .set(FMLOutboundHandler.OutboundTarget.TOSERVER); - this.channels.get(Side.CLIENT).writeAndFlush(message); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/21ab5000c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/21ab5000c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 11660b9..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/21ab5000c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,68 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.spawner.tag.keys; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLiving; -import net.minecraft.world.World; -import projectzulu.common.dungeon.spawner.tag.OptionalParser; -import projectzulu.common.dungeon.spawner.tag.TypeValuePair; -import projectzulu.common.dungeon.spawner.tag.settings.OptionalSettings.Operand; - -import com.google.common.collect.ListMultimap; - -public class KeyParserBlockFoot extends KeyParserBase { - - public KeyParserBlockFoot(Key key) { - super(key, false, KeyType.CHAINABLE); - } - - @Override - public boolean parseChainable(String parseable, ArrayList parsedChainable, - ArrayList operandvalue) { - String[] pieces = parseable.split(","); - - Operand operand = parseOperand(pieces); - - TypeValuePair typeValue = new TypeValuePair(key, OptionalParser.parseBlock(pieces)); - - if (typeValue.getValue() != null) { - parsedChainable.add(typeValue); - operandvalue.add(operand); - return true; - } - return false; - } - - @Override - public boolean parseValue(String parseable, HashMap valueCache) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isValidLocation(World world, EntityLiving entity, int xCoord, int yCoord, int zCoord, - TypeValuePair typeValuePair, HashMap valueCache) { - @SuppressWarnings("unchecked") - ListMultimap iDMetas = (ListMultimap) typeValuePair.getValue(); - Block blockID = world.getBlock(xCoord, yCoord - 1, zCoord); - int meta = world.getBlockMetadata(xCoord, yCoord - 1, zCoord); - boolean foundMatch = false; - for (String blockKey : iDMetas.keySet()) { - Block searchBlock = Block.getBlockFromName(blockKey); - if (searchBlock == null) { - continue; - } - List metas = iDMetas.get(blockKey); - for (Integer metaValue : metas) { - if (blockID == searchBlock && metaValue.equals(meta)) { - foundMatch = true; - break; - } - } - } - return foundMatch ? false : true; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d78d9dc52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d78d9dc52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c28ec15..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/30d78d9dc52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,54 +0,0 @@ -package projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/3101eca1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/3101eca1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5a34409..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/3101eca1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,596 +0,0 @@ -package projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.mobs.entity.EntityHornBill; -import projectzulu.common.mobs.entity.EntityStates; - -public class ModelHornBill extends ModelBase { - - float heightToRaise = -10.0f; - - ModelRenderer BODYROT; - private ModelRenderer HEADROT; - private ModelRenderer TAILBASEROT; - private ModelRenderer TAILFEATHER1ROT; - private ModelRenderer TAILFEATHER3ROT; - private ModelRenderer TAILFEATHER5ROT; - private ModelRenderer WINGLEFROT1; - private ModelRenderer WINGLEFROT2; - private ModelRenderer WINGLEFROT3; - private ModelRenderer WINGLEFROT4; - private ModelRenderer WINGLEFROT5; - private ModelRenderer WINGLEFROT6; - private ModelRenderer WINGLEFROT7; - private ModelRenderer WINGLEFROT8; - private ModelRenderer WINGLEFROT9; - private ModelRenderer WINGLEFROT10; - private ModelRenderer WINGLEFROT11; - private ModelRenderer WINGLEFROT12; - private ModelRenderer WINGRIGROT1; - private ModelRenderer WINGRIGROT2; - private ModelRenderer WINGRIGROT3; - private ModelRenderer WINGRIGROT4; - private ModelRenderer WINGRIGROT5; - private ModelRenderer WINGRIGROT6; - private ModelRenderer WINGRIGROT7; - private ModelRenderer WINGRIGROT8; - private ModelRenderer WINGRIGROT9; - private ModelRenderer WINGRIGROT10; - private ModelRenderer WINGRIGROT11; - private ModelRenderer WINGRIGROT12; - private ModelRenderer LEGLEFTOPROT; - private ModelRenderer LEGLEFBOTROT; - private ModelRenderer FOOTLEF1ROT; - private ModelRenderer FOOTLEF2ROT; - private ModelRenderer FOOTLEF3ROT; - private ModelRenderer LEGRIGTOPROT; - private ModelRenderer LEGRIGBOTROT; - private ModelRenderer FOOTRIG1ROT; - private ModelRenderer FOOTRIG2ROT; - private ModelRenderer FOOTRIG3ROT; - private ModelRenderer NECK1ROT; - private ModelRenderer NECK2ROT; - private ModelRenderer NECK3ROT; - private ModelRenderer NECK4ROT; - private ModelRenderer NECK5ROT; - private ModelRenderer NECK6ROT; - private ModelRenderer HORN2ROT; - - public ModelHornBill() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.body", 0, 21); - setTextureOffset("BODYROT.headfrill", 0, 16); - setTextureOffset("BODYROT.tailfrill", 0, 5); - setTextureOffset("BODYROT.tailfrill2", 0, 10); - setTextureOffset("TAILBASEROT.tailbase2", 8, 10); - setTextureOffset("TAILFEATHER3ROT.tailfeather3", 9, 5); - setTextureOffset("TAILFEATHER1ROT.tailfeather1", 9, 5); - setTextureOffset("TAILFEATHER5ROT.tailfeather5", 9, 5); - setTextureOffset("NECK1ROT.neck1", 8, 0); - setTextureOffset("NECK2ROT.neck2", 21, 0); - setTextureOffset("NECK3ROT.neck3", 20, 0); - setTextureOffset("NECK4ROT.neck4", 19, 0); - setTextureOffset("NECK5ROT.neck5", 18, 0); - setTextureOffset("NECK6ROT.neck6", 17, 0); - setTextureOffset("HEADROT.horn1", 48, 0); - setTextureOffset("HEADROT.head", 50, 6); - setTextureOffset("HEADROT.beaktop", 48, 13); - setTextureOffset("HEADROT.beakbot", 44, 14); - setTextureOffset("HORN2ROT.horn2", 42, 4); - setTextureOffset("WINGLEFROT1.winglef1", 22, 24); - setTextureOffset("WINGLEFROT2.winglef2", 23, 24); - setTextureOffset("WINGLEFROT3.winglef3", 24, 24); - setTextureOffset("WINGLEFROT4.winglef4", 25, 24); - setTextureOffset("WINGLEFROT5.winglef5", 22, 24); - setTextureOffset("WINGLEFROT6.winglef6", 23, 24); - setTextureOffset("WINGLEFROT7.winglef7", 24, 24); - setTextureOffset("WINGLEFROT8.winglef8", 25, 24); - setTextureOffset("WINGLEFROT9.winglef9", 22, 24); - setTextureOffset("WINGLEFROT10.winglef10", 23, 24); - setTextureOffset("WINGLEFROT11.winglef11", 24, 24); - setTextureOffset("WINGLEFROT12.winglef12", 24, 24); - setTextureOffset("WINGRIGROT1.wingrig1", 22, 24); - setTextureOffset("WINGRIGROT2.wingrig2", 23, 24); - setTextureOffset("WINGRIGROT3.wingrig3", 24, 24); - setTextureOffset("WINGRIGROT4.wingrig4", 25, 24); - setTextureOffset("WINGRIGROT5.wingrig5", 22, 24); - setTextureOffset("WINGRIGROT6.wingrig6", 23, 24); - setTextureOffset("WINGRIGROT7.wingrig7", 24, 24); - setTextureOffset("WINGRIGROT8.wingrig8", 25, 24); - setTextureOffset("WINGRIGROT9.wingrig9", 22, 24); - setTextureOffset("WINGRIGROT10.wingrig10", 23, 24); - setTextureOffset("WINGRIGROT11.wingrig11", 24, 24); - setTextureOffset("WINGRIGROT12.wingrig12", 24, 24); - setTextureOffset("LEGLEFTOPROT.legleftop", 32, 0); - setTextureOffset("LEGLEFBOTROT.leglefbot", 32, 0); - setTextureOffset("FOOTLEF1ROT.footlef13", 36, 2); - setTextureOffset("FOOTLEF1ROT.footlef12", 36, 0); - setTextureOffset("FOOTLEF1ROT.footlef11", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef23", 36, 2); - setTextureOffset("FOOTLEF2ROT.footlef22", 36, 0); - setTextureOffset("FOOTLEF2ROT.footlef21", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef33", 36, 2); - setTextureOffset("FOOTLEF3ROT.footlef31", 36, 0); - setTextureOffset("FOOTLEF3ROT.footlef32", 36, 0); - setTextureOffset("LEGRIGTOPROT.legrigtop", 32, 0); - setTextureOffset("LEGRIGBOTROT.legrigbot", 32, 0); - setTextureOffset("FOOTRIG1ROT.footrig13", 36, 2); - setTextureOffset("FOOTRIG1ROT.footrig12", 36, 0); - setTextureOffset("FOOTRIG1ROT.footrig11", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig23", 36, 2); - setTextureOffset("FOOTRIG2ROT.footrig22", 36, 0); - setTextureOffset("FOOTRIG2ROT.footrig21", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig33", 36, 2); - setTextureOffset("FOOTRIG3ROT.footrig31", 36, 0); - setTextureOffset("FOOTRIG3ROT.footrig32", 36, 0); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 19F - heightToRaise, 2.5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("body", -2F, -3F, -5.5F, 4, 4, 7); - BODYROT.addBox("headfrill", -2F, -3F, -6.5F, 4, 4, 1); - BODYROT.addBox("tailfrill", -2F, -3F, 1.5F, 4, 4, 1); - BODYROT.addBox("tailfrill2", -1.5F, -3F, 2.5F, 3, 3, 1); - TAILBASEROT = new ModelRenderer(this, "TAILBASEROT"); - TAILBASEROT.setRotationPoint(0F, -1.5F, 3.5F); - setRotation(TAILBASEROT, 0F, 0F, 0F); - TAILBASEROT.mirror = true; - TAILBASEROT.addBox("tailbase2", -1F, -1F, 0F, 2, 2, 1); - TAILFEATHER3ROT = new ModelRenderer(this, "TAILFEATHER3ROT"); - TAILFEATHER3ROT.setRotationPoint(0F, -0.25F, 1F); - setRotation(TAILFEATHER3ROT, 0F, 0F, 0F); - TAILFEATHER3ROT.mirror = true; - TAILFEATHER3ROT.addBox("tailfeather3", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER3ROT); - TAILFEATHER1ROT = new ModelRenderer(this, "TAILFEATHER1ROT"); - TAILFEATHER1ROT.setRotationPoint(1F, 0.25F, 1F); - setRotation(TAILFEATHER1ROT, 0F, 0F, 0F); - TAILFEATHER1ROT.mirror = true; - TAILFEATHER1ROT.addBox("tailfeather1", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER1ROT); - TAILFEATHER5ROT = new ModelRenderer(this, "TAILFEATHER5ROT"); - TAILFEATHER5ROT.setRotationPoint(-1F, 0.5F, 1F); - setRotation(TAILFEATHER5ROT, 0F, 0F, 0F); - TAILFEATHER5ROT.mirror = true; - TAILFEATHER5ROT.addBox("tailfeather5", -0.5F, -0.5F, 0F, 1, 1, 8); - TAILBASEROT.addChild(TAILFEATHER5ROT); - BODYROT.addChild(TAILBASEROT); - NECK1ROT = new ModelRenderer(this, "NECK1ROT"); - NECK1ROT.setRotationPoint(0F, -1.5F, -6.5F); - setRotation(NECK1ROT, 0F, 0F, 0F); - NECK1ROT.mirror = true; - NECK1ROT.addBox("neck1", -1.5F, -1.5F, -1F, 3, 3, 1); - NECK2ROT = new ModelRenderer(this, "NECK2ROT"); - NECK2ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK2ROT, 0F, 0F, 0F); - NECK2ROT.mirror = true; - NECK2ROT.addBox("neck2", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK3ROT = new ModelRenderer(this, "NECK3ROT"); - NECK3ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK3ROT, 0F, 0F, 0F); - NECK3ROT.mirror = true; - NECK3ROT.addBox("neck3", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK4ROT = new ModelRenderer(this, "NECK4ROT"); - NECK4ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK4ROT, 0F, 0F, 0F); - NECK4ROT.mirror = true; - NECK4ROT.addBox("neck4", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK5ROT = new ModelRenderer(this, "NECK5ROT"); - NECK5ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK5ROT, 0F, 0F, 0F); - NECK5ROT.mirror = true; - NECK5ROT.addBox("neck5", -1.5F, -1.5F, -1F, 3, 2, 1); - NECK6ROT = new ModelRenderer(this, "NECK6ROT"); - NECK6ROT.setRotationPoint(0F, 0F, -1F); - setRotation(NECK6ROT, 0F, 0F, 0F); - NECK6ROT.mirror = true; - NECK6ROT.addBox("neck6", -1.5F, -1.5F, -1F, 3, 2, 1); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, -1F, -2F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("horn1", -1.5F, -3F, -3.5F, 3, 1, 5); - HEADROT.addBox("head", -2F, -2F, -2F, 4, 4, 3); - HEADROT.addBox("beaktop", -1F, -1.5F, -8F, 2, 2, 6); - HEADROT.addBox("beakbot", -0.5F, 0.5F, -6F, 1, 1, 4); - HORN2ROT = new ModelRenderer(this, "HORN2ROT"); - HORN2ROT.setRotationPoint(0F, -2.5F, -3F); - setRotation(HORN2ROT, -0.2617994F, 0F, 0F); - HORN2ROT.mirror = true; - HORN2ROT.addBox("horn2", -1F, -0.5F, -1.5F, 2, 1, 1); - HEADROT.addChild(HORN2ROT); - NECK6ROT.addChild(HEADROT); - NECK5ROT.addChild(NECK6ROT); - NECK4ROT.addChild(NECK5ROT); - NECK3ROT.addChild(NECK4ROT); - NECK2ROT.addChild(NECK3ROT); - NECK1ROT.addChild(NECK2ROT); - BODYROT.addChild(NECK1ROT); - WINGLEFROT1 = new ModelRenderer(this, "WINGLEFROT1"); - WINGLEFROT1.setRotationPoint(-2.5F, -2.5F, -5.5F); - setRotation(WINGLEFROT1, 0F, 0F, 0F); - WINGLEFROT1.mirror = true; - WINGLEFROT1.addBox("winglef1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT2 = new ModelRenderer(this, "WINGLEFROT2"); - WINGLEFROT2.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT2, 0F, 0F, 0F); - WINGLEFROT2.mirror = true; - WINGLEFROT2.addBox("winglef2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT3 = new ModelRenderer(this, "WINGLEFROT3"); - WINGLEFROT3.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT3, 0F, 0F, 0F); - WINGLEFROT3.mirror = true; - WINGLEFROT3.addBox("winglef3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT4 = new ModelRenderer(this, "WINGLEFROT4"); - WINGLEFROT4.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT4, 0F, 0.0698132F, 0F); - WINGLEFROT4.mirror = true; - WINGLEFROT4.addBox("winglef4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT5 = new ModelRenderer(this, "WINGLEFROT5"); - WINGLEFROT5.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT5, 0F, 0F, 0F); - WINGLEFROT5.mirror = true; - WINGLEFROT5.addBox("winglef5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT6 = new ModelRenderer(this, "WINGLEFROT6"); - WINGLEFROT6.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT6, 0F, 0F, 0F); - WINGLEFROT6.mirror = true; - WINGLEFROT6.addBox("winglef6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT7 = new ModelRenderer(this, "WINGLEFROT7"); - WINGLEFROT7.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT7, 0F, 0F, 0F); - WINGLEFROT7.mirror = true; - WINGLEFROT7.addBox("winglef7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT8 = new ModelRenderer(this, "WINGLEFROT8"); - WINGLEFROT8.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT8, 0F, 0F, 0F); - WINGLEFROT8.mirror = true; - WINGLEFROT8.addBox("winglef8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT9 = new ModelRenderer(this, "WINGLEFROT9"); - WINGLEFROT9.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT9, 0F, 0F, 0F); - WINGLEFROT9.mirror = true; - WINGLEFROT9.addBox("winglef9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT10 = new ModelRenderer(this, "WINGLEFROT10"); - WINGLEFROT10.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT10, 0F, 0F, 0F); - WINGLEFROT10.mirror = true; - WINGLEFROT10.addBox("winglef10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11 = new ModelRenderer(this, "WINGLEFROT11"); - WINGLEFROT11.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT11, 0F, 0F, 0F); - WINGLEFROT11.mirror = true; - WINGLEFROT11.addBox("winglef11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT12 = new ModelRenderer(this, "WINGLEFROT12"); - WINGLEFROT12.setRotationPoint(-1F, 0F, 0F); - setRotation(WINGLEFROT12, 0F, 0F, 0F); - WINGLEFROT12.mirror = true; - WINGLEFROT12.addBox("winglef12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGLEFROT11.addChild(WINGLEFROT12); - WINGLEFROT10.addChild(WINGLEFROT11); - WINGLEFROT9.addChild(WINGLEFROT10); - WINGLEFROT8.addChild(WINGLEFROT9); - WINGLEFROT7.addChild(WINGLEFROT8); - WINGLEFROT6.addChild(WINGLEFROT7); - WINGLEFROT5.addChild(WINGLEFROT6); - WINGLEFROT4.addChild(WINGLEFROT5); - WINGLEFROT3.addChild(WINGLEFROT4); - WINGLEFROT2.addChild(WINGLEFROT3); - WINGLEFROT1.addChild(WINGLEFROT2); - BODYROT.addChild(WINGLEFROT1); - WINGRIGROT1 = new ModelRenderer(this, "WINGRIGROT1"); - WINGRIGROT1.setRotationPoint(2.5F, -2.5F, -5.5F); - setRotation(WINGRIGROT1, 0F, 0F, 0F); - WINGRIGROT1.mirror = true; - WINGRIGROT1.addBox("wingrig1", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT2 = new ModelRenderer(this, "WINGRIGROT2"); - WINGRIGROT2.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT2, 0F, 0F, 0F); - WINGRIGROT2.mirror = true; - WINGRIGROT2.addBox("wingrig2", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT3 = new ModelRenderer(this, "WINGRIGROT3"); - WINGRIGROT3.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT3, 0F, 0F, 0F); - WINGRIGROT3.mirror = true; - WINGRIGROT3.addBox("wingrig3", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT4 = new ModelRenderer(this, "WINGRIGROT4"); - WINGRIGROT4.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT4, 0F, 0.0698132F, 0F); - WINGRIGROT4.mirror = true; - WINGRIGROT4.addBox("wingrig4", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT5 = new ModelRenderer(this, "WINGRIGROT5"); - WINGRIGROT5.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT5, 0F, 0F, 0F); - WINGRIGROT5.mirror = true; - WINGRIGROT5.addBox("wingrig5", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT6 = new ModelRenderer(this, "WINGRIGROT6"); - WINGRIGROT6.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT6, 0F, 0F, 0F); - WINGRIGROT6.mirror = true; - WINGRIGROT6.addBox("wingrig6", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT7 = new ModelRenderer(this, "WINGRIGROT7"); - WINGRIGROT7.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT7, 0F, 0F, 0F); - WINGRIGROT7.mirror = true; - WINGRIGROT7.addBox("wingrig7", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT8 = new ModelRenderer(this, "WINGRIGROT8"); - WINGRIGROT8.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT8, 0F, 0F, 0F); - WINGRIGROT8.mirror = true; - WINGRIGROT8.addBox("wingrig8", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT9 = new ModelRenderer(this, "WINGRIGROT9"); - WINGRIGROT9.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT9, 0F, 0F, 0F); - WINGRIGROT9.mirror = true; - WINGRIGROT9.addBox("wingrig9", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT10 = new ModelRenderer(this, "WINGRIGROT10"); - WINGRIGROT10.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT10, 0F, 0F, 0F); - WINGRIGROT10.mirror = true; - WINGRIGROT10.addBox("wingrig10", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11 = new ModelRenderer(this, "WINGRIGROT11"); - WINGRIGROT11.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT11, 0F, 0F, 0F); - WINGRIGROT11.mirror = true; - WINGRIGROT11.addBox("wingrig11", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT12 = new ModelRenderer(this, "WINGRIGROT12"); - WINGRIGROT12.setRotationPoint(1F, 0F, 0F); - setRotation(WINGRIGROT12, 0F, 0F, 0F); - WINGRIGROT12.mirror = true; - WINGRIGROT12.addBox("wingrig12", -0.5F, -0.5F, 0F, 1, 1, 7); - WINGRIGROT11.addChild(WINGRIGROT12); - WINGRIGROT10.addChild(WINGRIGROT11); - WINGRIGROT9.addChild(WINGRIGROT10); - WINGRIGROT8.addChild(WINGRIGROT9); - WINGRIGROT7.addChild(WINGRIGROT8); - WINGRIGROT6.addChild(WINGRIGROT7); - WINGRIGROT5.addChild(WINGRIGROT6); - WINGRIGROT4.addChild(WINGRIGROT5); - WINGRIGROT3.addChild(WINGRIGROT4); - WINGRIGROT2.addChild(WINGRIGROT3); - WINGRIGROT1.addChild(WINGRIGROT2); - BODYROT.addChild(WINGRIGROT1); - LEGLEFTOPROT = new ModelRenderer(this, "LEGLEFTOPROT"); - LEGLEFTOPROT.setRotationPoint(-1.5F, 1F, 0F); - setRotation(LEGLEFTOPROT, 0F, 0F, 0F); - LEGLEFTOPROT.mirror = true; - LEGLEFTOPROT.addBox("legleftop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGLEFBOTROT = new ModelRenderer(this, "LEGLEFBOTROT"); - LEGLEFBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGLEFBOTROT, 0F, 0F, 0F); - LEGLEFBOTROT.mirror = true; - LEGLEFBOTROT.addBox("leglefbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTLEF1ROT = new ModelRenderer(this, "FOOTLEF1ROT"); - FOOTLEF1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF1ROT, 0F, 0.4363323F, 0F); - FOOTLEF1ROT.mirror = true; - FOOTLEF1ROT.addBox("footlef13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF1ROT.addBox("footlef11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF1ROT); - FOOTLEF2ROT = new ModelRenderer(this, "FOOTLEF2ROT"); - FOOTLEF2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTLEF2ROT, 0F, -0.4363323F, 0F); - FOOTLEF2ROT.mirror = true; - FOOTLEF2ROT.addBox("footlef23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTLEF2ROT.addBox("footlef21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF2ROT); - FOOTLEF3ROT = new ModelRenderer(this, "FOOTLEF3ROT"); - FOOTLEF3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTLEF3ROT, 0F, 0F, 0F); - FOOTLEF3ROT.mirror = true; - FOOTLEF3ROT.addBox("footlef33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTLEF3ROT.addBox("footlef32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGLEFBOTROT.addChild(FOOTLEF3ROT); - LEGLEFTOPROT.addChild(LEGLEFBOTROT); - BODYROT.addChild(LEGLEFTOPROT); - LEGRIGTOPROT = new ModelRenderer(this, "LEGRIGTOPROT"); - LEGRIGTOPROT.setRotationPoint(1.5F, 1F, 0F); - setRotation(LEGRIGTOPROT, 0F, 0F, 0F); - LEGRIGTOPROT.mirror = true; - LEGRIGTOPROT.addBox("legrigtop", -0.5F, 0F, -0.5F, 1, 2, 1); - LEGRIGBOTROT = new ModelRenderer(this, "LEGRIGBOTROT"); - LEGRIGBOTROT.setRotationPoint(0F, 2F, 0F); - setRotation(LEGRIGBOTROT, 0F, 0F, 0F); - LEGRIGBOTROT.mirror = true; - LEGRIGBOTROT.addBox("legrigbot", -0.5F, 0F, -0.5F, 1, 2, 1); - FOOTRIG1ROT = new ModelRenderer(this, "FOOTRIG1ROT"); - FOOTRIG1ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG1ROT, 0F, 0.4363323F, 0F); - FOOTRIG1ROT.mirror = true; - FOOTRIG1ROT.addBox("footrig13", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig12", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG1ROT.addBox("footrig11", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG1ROT); - FOOTRIG2ROT = new ModelRenderer(this, "FOOTRIG2ROT"); - FOOTRIG2ROT.setRotationPoint(0F, 1.5F, -0.5F); - setRotation(FOOTRIG2ROT, 0F, -0.4363323F, 0F); - FOOTRIG2ROT.mirror = true; - FOOTRIG2ROT.addBox("footrig23", -0.5F, -0.5F, -3F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig22", -0.5F, -0.5F, -2F, 1, 1, 1); - FOOTRIG2ROT.addBox("footrig21", -0.5F, -0.5F, -1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG2ROT); - FOOTRIG3ROT = new ModelRenderer(this, "FOOTRIG3ROT"); - FOOTRIG3ROT.setRotationPoint(0F, 1.5F, 0.5F); - setRotation(FOOTRIG3ROT, 0F, 0F, 0F); - FOOTRIG3ROT.mirror = true; - FOOTRIG3ROT.addBox("footrig33", -0.5F, -0.5F, 2F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig31", -0.5F, -0.5F, 0F, 1, 1, 1); - FOOTRIG3ROT.addBox("footrig32", -0.5F, -0.5F, 1F, 1, 1, 1); - LEGRIGBOTROT.addChild(FOOTRIG3ROT); - LEGRIGTOPROT.addChild(LEGRIGBOTROT); - BODYROT.addChild(LEGRIGTOPROT); - - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - float scale = 0.6f * f5; - setRotationAngles(f, f1, f2, f3, f4, scale, entity); - float field_78145_g = 8.0F; - float field_78151_h = 4.0F; - - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, field_78145_g * scale, field_78151_h * scale); - // HEADROT.render(scale); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * scale, 0.0F); - BODYROT.render(scale); - GL11.glPopMatrix(); - } else { - BODYROT.render(scale); - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - EntityHornBill var5 = (EntityHornBill) par1EntityLiving; - - // On Ground - if (var5.getEntityState() == EntityStates.attacking) { - BODYROT.rotateAngleX = (float) (-30 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (+10 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (+60 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTLEF3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - LEGRIGTOPROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (0 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (60 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG2ROT.rotateAngleX = (float) (45 * Math.PI / 180 + 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - FOOTRIG3ROT.rotateAngleX = (float) (-45 * Math.PI / 180 - 10 * Math.PI / 180 - * MathHelper.sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } else { - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - WINGLEFROT1.rotateAngleX = (float) (0 * Math.PI / 180); - WINGRIGROT1.rotateAngleX = (float) (0 * Math.PI / 180); - - LEGLEFTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGLEFTOPROT.rotateAngleY = (float) (5 * Math.PI / 180); - LEGLEFBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTLEF1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTLEF3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - LEGRIGTOPROT.rotateAngleX = (float) (60 * Math.PI / 180); - LEGRIGTOPROT.rotateAngleY = (float) (-5 * Math.PI / 180); - LEGRIGBOTROT.rotateAngleX = (float) (50 * Math.PI / 180); - FOOTRIG1ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG2ROT.rotateAngleX = (float) (75 * Math.PI / 180); - FOOTRIG3ROT.rotateAngleX = (float) (-75 * Math.PI / 180); - - WINGLEFROT1.rotateAngleZ = (float) (40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGLEFROT6.rotateAngleZ = (float) (-20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT10.rotateAngleZ = (float) (-25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT1.rotateAngleY = (float) (-4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT5.rotateAngleY = (float) (-5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT8.rotateAngleY = (float) (-6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGLEFROT11.rotateAngleY = (float) (-7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - WINGRIGROT1.rotateAngleZ = (float) (-40 * Math.PI / 180 * MathHelper.sin((float) (var5.worldObj - .getWorldTime() * 0.6662F * 0.5f + Math.PI * 0 / 2))); - WINGRIGROT6.rotateAngleZ = (float) (+20 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT10.rotateAngleZ = (float) (+25 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT1.rotateAngleY = (float) (+4 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT5.rotateAngleY = (float) (+5 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT8.rotateAngleY = (float) (+6 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - WINGRIGROT11.rotateAngleY = (float) (+7 * Math.PI / 180 * Math.abs(MathHelper - .sin((float) (var5.worldObj.getWorldTime() * 0.6662F * 0.5f / 2 + Math.PI * 3 / 4)))); - - TAILFEATHER1ROT.rotateAngleY = (float) (45 * Math.PI / 180 - 10 * Math.PI / 180 * par3); - TAILFEATHER5ROT.rotateAngleY = (float) (-45 * Math.PI / 180 + 10 * Math.PI / 180 * par3); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); - EntityHornBill var5 = (EntityHornBill) par7Entity; - float lookingDirX = Math.min(Math.max(f4, -15), +15) * (float) (Math.PI / 180f); - if (var5.getEntityState() == EntityStates.attacking) { - HEADROT.rotateAngleX = (float) (+50 * Math.PI / 180) + lookingDirX; - } else { - HEADROT.rotateAngleX = (float) (0 * Math.PI / 180) + lookingDirX; - } - HEADROT.rotateAngleY = Math.min(Math.max(f3, -20), +20) * (float) (Math.PI / 180f); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/4053e4f7c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/4053e4f7c42100141fce95f06aba7e85 deleted file mode 100644 index f0cdb83..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/4053e4f7c42100141fce95f06aba7e85 +++ /dev/null @@ -1,54 +0,0 @@ -package com.ngb.projectzulu.common.api; - - -import java.util.EnumSet; -import java.util.HashMap; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; - -import com.google.common.base.CharMatcher; -import com.google.common.base.Optional; - -public enum CustomEntityList { - CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, - MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, - CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER; - - public Optional modData = Optional.absent(); - private static final HashMap lookupEnum = new HashMap(); - static { - for (CustomEntityList entry : EnumSet.allOf(CustomEntityList.class)) - lookupEnum.put(entry.toString().toLowerCase(), entry); - } - - public static CustomEntityList getByName(String mobName) { - if (mobName == null) { - return null; - } - - String[] nameParts = CharMatcher.anyOf(" ").removeFrom(mobName).toLowerCase().split("\\."); - CustomEntityList result; - if (nameParts.length > 1) { - result = lookupEnum.get(nameParts[nameParts.length - 1]); - } else { - result = lookupEnum.get(nameParts[0]); - } - if (result == null) { -// ProjectZuluLog.info("Custom Entity Lookup Failed %s Does not Seem to Exist", CharMatcher.anyOf(" ") -// .removeFrom(mobName).toLowerCase()); - } - return result; - } - - public static CustomEntityList getByEntity(Entity entity) { - String mobName = EntityList.getEntityString(entity); - if(mobName != null){ - return getByName(mobName); - }else{ - return null; - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/41f6aef8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/41f6aef8c42100141fce95f06aba7e85 deleted file mode 100644 index ede6613..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/41f6aef8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,178 +0,0 @@ -package com.ngb.projectzulu.common.mobs.models; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.MathHelper; - -import org.lwjgl.opengl.GL11; - -import com.ngb.projectzulu.common.core.ModelHelper; -import com.ngb.projectzulu.common.mobs.entity.EntityFox; -import com.ngb.projectzulu.common.mobs.entity.EntityStates; - -public class ModelFox extends ModelBase { - ModelRenderer BODYROT; - ModelRenderer HEADROT; - private ModelRenderer TAILROT; - private ModelRenderer LEG4ROT; - private ModelRenderer LEG3ROT; - private ModelRenderer LEG1ROT; - private ModelRenderer LEG2ROT; - private ModelRenderer EARROTL; - private ModelRenderer EARROTR; - - public ModelFox() { - textureWidth = 64; - textureHeight = 32; - setTextureOffset("BODYROT.Body", 0, 9); - setTextureOffset("TAILROT.Tail", 0, 22); - setTextureOffset("LEG4ROT.Leg4", 42, 22); - setTextureOffset("LEG3ROT.Leg3", 34, 22); - setTextureOffset("LEG1ROT.Leg1", 18, 22); - setTextureOffset("LEG2ROT.Leg2", 26, 22); - setTextureOffset("HEADROT.Head", 0, 0); - setTextureOffset("HEADROT.Nose", 16, 0); - setTextureOffset("EARROTL.Ear1", 22, 4); - setTextureOffset("EARROTR.Ear2", 16, 4); - - BODYROT = new ModelRenderer(this, "BODYROT"); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(BODYROT, 0F, 0F, 0F); - BODYROT.mirror = true; - BODYROT.addBox("Body", -2.5F, -2.5F, 0F, 5, 5, 8); - TAILROT = new ModelRenderer(this, "TAILROT"); - TAILROT.setRotationPoint(0F, -1F, 7.5F); - setRotation(TAILROT, 0F, 0F, 0F); - TAILROT.mirror = true; - TAILROT.addBox("Tail", -1F, -1F, 0F, 2, 2, 7); - BODYROT.addChild(TAILROT); - LEG4ROT = new ModelRenderer(this, "LEG4ROT"); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - setRotation(LEG4ROT, 0F, 0F, 0F); - LEG4ROT.mirror = true; - LEG4ROT.addBox("Leg4", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG4ROT); - LEG3ROT = new ModelRenderer(this, "LEG3ROT"); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - setRotation(LEG3ROT, 0F, 0F, 0F); - LEG3ROT.mirror = true; - LEG3ROT.addBox("Leg3", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG3ROT); - LEG1ROT = new ModelRenderer(this, "LEG1ROT"); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - setRotation(LEG1ROT, 0F, 0F, 0F); - LEG1ROT.mirror = true; - LEG1ROT.addBox("Leg1", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG1ROT); - LEG2ROT = new ModelRenderer(this, "LEG2ROT"); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - setRotation(LEG2ROT, 0F, 0F, 0F); - LEG2ROT.mirror = true; - LEG2ROT.addBox("Leg2", -1F, 0F, -1F, 2, 4, 2); - BODYROT.addChild(LEG2ROT); - HEADROT = new ModelRenderer(this, "HEADROT"); - HEADROT.setRotationPoint(0F, 17.5F, -5F); - setRotation(HEADROT, 0F, 0F, 0F); - HEADROT.mirror = true; - HEADROT.addBox("Head", -2.5F, -2.5F, -3F, 5, 5, 3); - HEADROT.addBox("Nose", -1F, 0F, -5F, 2, 2, 2); - EARROTL = new ModelRenderer(this, "EARROTL"); - EARROTL.setRotationPoint(-0.5F, -2.5F, -2F); - setRotation(EARROTL, 0F, 0F, 0F); - EARROTL.mirror = true; - EARROTL.addBox("Ear1", -2F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTL); - EARROTR = new ModelRenderer(this, "EARROTR"); - EARROTR.setRotationPoint(0.5F, -2.5F, -2F); - setRotation(EARROTR, 0F, 0F, 0F); - EARROTR.mirror = true; - EARROTR.addBox("Ear2", 0F, -3F, -0.5F, 2, 3, 1); - HEADROT.addChild(EARROTR); - } - - @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float field_78145_g = 4.0f; - float field_78151_h = 3.0f; - if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.8F / var8, 1.8F / var8, 1.8F / var8); - GL11.glTranslatef(0.0F, field_78145_g * f5, field_78151_h * f5); - HEADROT.render(f5); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); - GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); - BODYROT.render(f5); - GL11.glPopMatrix(); - } else { - if (((EntityFox) entity).getEntityState() == EntityStates.sitting) { - HEADROT.render(f5 * 1.1f); - BODYROT.render(f5); - } else { - HEADROT.render(f5); - BODYROT.render(f5); - } - } - } - - @Override - public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - EntityFox var5 = (EntityFox) par1EntityLiving; - - if (var5.getEntityState() == EntityStates.sitting) { - TAILROT.rotateAngleX = (float) (10 * Math.PI / 180); - - LEG1ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG1ROT.setRotationPoint(-1.4F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (-55 * Math.PI / 180); - LEG2ROT.setRotationPoint(1.4F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG3ROT.setRotationPoint(-1.5F, 3.0F, 1.0F); - LEG4ROT.rotateAngleX = (float) (20 * Math.PI / 180); - LEG4ROT.setRotationPoint(1.5F, 3.0F, 1.0F); - - BODYROT.rotateAngleX = (float) (-35 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17f, -5F); - - } else { - TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); - LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); - LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); - - LEG3ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3ROT.setRotationPoint(-1.5F, 2.5F, 0F); - LEG4ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4ROT.setRotationPoint(1.5F, 2.5F, 0F); - - BODYROT.rotateAngleX = (float) (0 * Math.PI / 180); - BODYROT.setRotationPoint(0F, 17.5F, -5F); - } - } - - private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; - } - - @Override - public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, - Entity par7Entity) { - super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.HEADROT.rotateAngleX = par5 / (180F / (float) Math.PI); - this.HEADROT.rotateAngleY = par4 / (180F / (float) Math.PI); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/9068ff9ec52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/9068ff9ec52100141a6cb1c64d7b6ba1 deleted file mode 100644 index c041098..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/9068ff9ec52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,43 +0,0 @@ -package projectzulu.common.mobs.entityai; - -import net.minecraft.entity.EntityLivingBase; -import projectzulu.common.mobs.entity.EntityGenericTameable; - -public class EntityAIOwnerHurtTarget extends EntityAITarget{ - EntityGenericTameable theDefendingTameable; - EntityLivingBase theTarget; - - public EntityAIOwnerHurtTarget(EntityGenericTameable par1EntityTameable){ - super(par1EntityTameable, 32.0F, false); - this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - - /** - * Returns whether the EntityAIBase should begin execution. - */ - public boolean shouldExecute(){ - if (!this.theDefendingTameable.isTamed()){ - return false; - } - else{ - EntityLivingBase var1 = this.theDefendingTameable.getOwner(); - - if (var1 == null){ - return false; - }else{ - this.theTarget = var1.getAITarget(); - return this.isSuitableTarget(this.theTarget, false); - } - } - } - - /** - * Execute a one shot task or start executing a continuous task - */ - public void startExecuting(){ - this.taskOwner.setAttackTarget(this.theTarget); - super.startExecuting(); - } -} - diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/90814cffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/90814cffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index a644773..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/90814cffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,75 +0,0 @@ -package com.ngb.projectzulu.common.world2.architect; - -import java.awt.Point; - -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.MazeCell; -import projectzulu.common.world2.blueprint.BPSetGenericCardinal; -import projectzulu.common.world2.blueprint.BPSetGenericCarved; -import projectzulu.common.world2.blueprint.BPSetGenericEdge; -import projectzulu.common.world2.blueprint.BPSetGenericLimited; -import projectzulu.common.world2.blueprint.BPSetGenericUncarved; -import projectzulu.common.world2.blueprint.BlueprintSet; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeDiagonal; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomMid; -import projectzulu.common.world2.blueprints.oasis.BPOasisEdgeRandomPoint; -import projectzulu.common.world2.blueprints.oasis.BPOasisGrass; -import projectzulu.common.world2.blueprints.oasis.BPOasisPool; -import projectzulu.common.world2.blueprints.oasis.BPOasisSandCorner; -import projectzulu.common.world2.blueprints.oasis.BPOasisTreeGrass; - -public class ArchitectOasis extends ArchitectBase { - BlueprintSetStockpile edgeStockpile; - BPSetGenericCarved sandCorner = new BPSetGenericCarved(new BPOasisSandCorner()); - - public ArchitectOasis(World world) { - super(world); - edgeStockpile = new BlueprintSetStockpile(world.rand); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomPoint())); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeDiagonal(true))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(false))); - edgeStockpile.addBlueprintSet(new BPSetGenericEdge(new BPOasisEdgeRandomMid(true))); - edgeStockpile.addBlueprintSet(sandCorner); - stockpile.addBlueprintSet(new BPSetGenericUncarved(new BPOasisPool())); - stockpile.addBlueprintSet(new BPSetGenericCardinal(new BPOasisGrass(), 1)); - stockpile.addBlueprintSet(new BPSetGenericLimited(new BPOasisTreeGrass(), 1, 3)); - } - - @Override - public void assignBlueprint(MazeCell[][] cells, Point buildCoords, int pass, int maxPass) { - BlueprintSet set = null; - if (CellHelper.isCorner(cells, buildCoords)) { - set = sandCorner; - } - if (set == null) { - set = edgeStockpile.getRandomApplicable(cells, buildCoords); - } - if (set == null) { - set = stockpile.getRandomApplicable(cells, buildCoords); - } - - if (set != null) { - set.assignCellsWithBlueprints(cells, buildCoords, random); - } - } - - @Override - public BlockWithMeta getBlockFromBlueprint(MazeCell cell, ChunkCoordinates piecePos) { - BlueprintSet set; - set = edgeStockpile.getBlueprintSet(cell); - if (set != null) { - return edgeStockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - set = stockpile.getBlueprintSet(cell); - if (set != null) { - return stockpile.getBlueprintSet(cell).getBlockFromBlueprint(piecePos, cell.size, cell.getHeight(), - cell.getDirection(), random, cell.getBuildingID()); - } - return null; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/917aede5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/917aede5c42100141fce95f06aba7e85 deleted file mode 100644 index dea8457..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/917aede5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionDigslowdown extends SubItemPotionHalfPower { - - public SubItemPotionDigslowdown(Item itemID, int subID) { - super(itemID, subID, "Fatique"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 12, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.digSlowdown); - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/e0fd4ea1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/e0fd4ea1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5aa9050..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/e0fd4ea1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,236 +0,0 @@ -package projectzulu.common.mobs.entity; - -import java.util.EnumSet; -import java.util.UUID; - -import net.minecraft.entity.ai.EntityAISwimming; -import net.minecraft.entity.ai.attributes.AttributeModifier; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import projectzulu.common.api.BlockList; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; -import projectzulu.common.mobs.entityai.EntityAIFollowParent; -import projectzulu.common.mobs.entityai.EntityAIHurtByTarget; -import projectzulu.common.mobs.entityai.EntityAIMate; -import projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; -import projectzulu.common.mobs.entityai.EntityAIPanic; -import projectzulu.common.mobs.entityai.EntityAIStayStill; -import projectzulu.common.mobs.entityai.EntityAITempt; -import projectzulu.common.mobs.entityai.EntityAIWander; -import net.minecraft.util.Vec3; -import cpw.mods.fml.common.Loader; - -public class EntityArmadillo extends EntityGenericAnimal implements IAnimals { - - public static final UUID field_110179_h = UUID.fromString("E199AD22-BA8B-4C53-8A13-1182D5C69D3A"); - public static final AttributeModifier CHARGING_BONUS = (new AttributeModifier(field_110179_h, - "Fleeing speed bonus", -0.3D, 2)).setSaved(false); - - /* Model Assist Variables, Legacy: Code should be Reworked without them */ - public EntityModelRotation eWHOLE = new EntityModelRotation(); - public EntityModelRotation eHEADPIECE = new EntityModelRotation(); - public EntityModelRotation eREARRTR1 = new EntityModelRotation(); - public EntityModelRotation eREARRTR2 = new EntityModelRotation(); - public EntityModelRotation eREARRTR3 = new EntityModelRotation(); - public EntityModelRotation etail = new EntityModelRotation(); - public EntityModelRotation eleg3 = new EntityModelRotation(); - public EntityModelRotation eleg4 = new EntityModelRotation(); - - /* General Ability Variabeles */ - int ticksToCheckAbilities = 3; - - /* In Cover Variables */ - int inCoverTimer = 0; - static final int inCoverTimerMax = 20; - - /* Charge Variables */ - protected boolean isCharging = false; - - public boolean isCharging() { - return isCharging; - } - - protected float timeSinceLastCharge = 5f; - protected float chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - protected float chargeTime = 0.2f * chargeTriggerThreshold; - protected int chargeSpeedModifier = 2; - - public EntityArmadillo(World par1World) { - super(par1World); - boundingBox.setBounds(-0.05, -0.05, -0.15, 0.05, 1.8, 0.15); - - getNavigator().setAvoidsWater(true); - tasks.addTask(0, new EntityAISwimming(this)); - tasks.addTask(1, new EntityAIPanic(this, 1.25f)); - - tasks.addTask(2, new EntityAIStayStill(this, EntityStates.inCover)); - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); - // this.tasks.addTask(4, new EntityAIFollowOwner(this, this.moveSpeed, 10.0F, 2.0F)); - - tasks.addTask(5, new EntityAIMate(this, 1.0f)); - tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); - tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); - tasks.addTask(9, new EntityAIWander(this, 1.0f, 120)); - - // this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this)); - // this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this)); - targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); - targetTasks.addTask(4, - new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), - EntityPlayer.class, 16.0F, 0, true)); - // this.targetTasks.addTask(4, new EntityAINearestAttackableTarget(this, EntityLiving.class, 16.0F, 0, false, - // true, IMob.mobSelector)); - - } - - @Override - protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { - return super.isValidLocation(world, xCoord, yCoord, zCoord) - && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); - } - - /** - * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue - */ - @Override - public int getTotalArmorValue() { - if (getEntityState() == EntityStates.inCover) { - return 30; - } else { - return 4; - } - } - - /** - * Returns the sound this mob makes while it's alive. - */ - @Override - protected String getLivingSound() { - return DefaultProps.coreKey + ":" + DefaultProps.entitySounds + "armadilloliving"; - } - - @Override - public void updateAIState() { - if (inCoverTimer > 0) { - entityState = EntityStates.inCover; - } else { - super.updateAIState(); - } - } - - @Override - protected void updateAITasks() { - super.updateAITasks(); - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* - * Checks if There is a player that can see Armadillo and is using a bow. If so, Take Cover /* Also, if - * there is no Target, then don't take cover - */ - EntityPlayer tempE = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - boolean canSee = false; - boolean isFacing = false; - if (tempE != null) { - // Condition 1: Check if player is using an item, and if so is it a bow - - // Condition 2: Is the player facing the target. "boolean canSee" - double angleEntToPlayer = Math.atan2(posX - tempE.posX, tempE.posZ - posZ) * (180.0 / Math.PI) + 180; - double playerRotationYaw = tempE.rotationYaw; - double difference = Math.abs(MathHelper.wrapAngleTo180_double(normalizeTo360(angleEntToPlayer) - - normalizeTo360(playerRotationYaw))); - if (difference < 90) { - isFacing = true; - } - - // Condition 3: Can the player see the target - canSee = this.worldObj.rayTraceBlocks( - //worldObj.getWorldVec3Pool().getVecFromPool(tempE.posX, tempE.posY + tempE.getEyeHeight(), tempE.posZ), - //worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ) - - Vec3.createVectorHelper((double)tempE.posX, (double) tempE.posY + tempE.getEyeHeight(),(double) tempE.posZ), - Vec3.createVectorHelper((double)this.posX, (double) this.posY,(double) this.posZ) - ) == null; - } - /* If any of the conditions above failed, then Armadillo should not be in Cover */ - if (tempE == null || canSee == false || tempE.isUsingItem() == false || isFacing == false - || tempE.inventory.getCurrentItem().getItem() != Items.bow) { - inCoverTimer = Math.max(inCoverTimer - ticksToCheckAbilities, 0); - } else { - /* Reminder: This only occurs when all the above are true. */ - inCoverTimer = inCoverTimerMax; - } - } - - } - - @Override - public void onLivingUpdate() { - if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { - heal(1); - } - - if (ticksExisted % ticksToCheckAbilities == 0) { - /* Check If Entity Should START Charging */ - if (this.timeSinceLastCharge > chargeTriggerThreshold && !isCharging) { - this.isCharging = true; - this.timeSinceLastCharge = 0; - chargeTriggerThreshold = 10f * 20f + rand.nextInt(10 * 20); - } - - /* Check If Entity Should STOP Charging */ - if (isCharging && this.timeSinceLastCharge > chargeTime) { - this.isCharging = false; - } - - /* Increase Time Since Last Charge */ - this.timeSinceLastCharge += ticksToCheckAbilities; - } - - super.onLivingUpdate(); - } - - @Override - public float getAIMoveSpeed() { - float baseSpeed = super.getAIMoveSpeed(); - return isCharging ? baseSpeed * chargeSpeedModifier : baseSpeed; - } - - private double normalizeTo360(double angle) { - - while (angle < 0 || angle > 360) { - if (angle < 0.0) { - angle += 360; - } - if (angle > 360.0) { - angle -= 360; - } - } - return angle; - } - - @Override - public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.spider_eye) { - return true; - } else { - return super.isValidBreedingItem(itemStack); - } - } - - @Override - protected void dropRareDrop(int par1) { - if (Loader.isModLoaded(DefaultProps.BlocksModId)) { - if (BlockList.mobHeads.isPresent()) { - entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 2), 1); - } - } - super.dropRareDrop(par1); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/f0e37e309eac0014171585e4f63f5ff8 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/f0e37e309eac0014171585e4f63f5ff8 new file mode 100644 index 0000000..dafa38a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/fe/f0e37e309eac0014171585e4f63f5ff8 @@ -0,0 +1,299 @@ +package com.stek101.projectzulu.common.core; + +import java.io.File; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; +import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class EventHookContainerClass { + // zLevel is protected float copied from GUI along with drawTexturedModelRect + protected float zLevel = 0.0F; + boolean nearBossTriggered = false; + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate = 5; + private int stickSpawnRate = 5; + Random classRand = new Random(); + + + + @SubscribeEvent + public void onPlayerUpdateStarve(LivingUpdateEvent event) { + World worldObj = event.entity.worldObj; + if (worldObj != null && event.entity != null && event.entity instanceof EntityPlayer) { + + EntityPlayer thePlayer = (EntityPlayer) event.entity; + + int var1 = MathHelper.floor_double(thePlayer.posX); + int var2 = MathHelper.floor_double(thePlayer.boundingBox.minY); + int var3 = MathHelper.floor_double(thePlayer.posZ); + BiomeGenBase currentBiome = worldObj.getBiomeGenForCoords(var1, var3); + boolean isDesertSun = worldObj.canBlockSeeTheSky(var1, var2, var3) && worldObj.isDaytime() == true + && (currentBiome == BiomeGenBase.desert || currentBiome == BiomeGenBase.desertHills); + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + if (!thePlayer.capabilities.isCreativeMode && isDesertSun == true + && Loader.isModLoaded(DefaultProps.BlocksModId)) { + float exhaustion = 0.0032f; + switch (worldObj.difficultySetting) { + case PEACEFUL: + exhaustion = 0.0f; + break; + case EASY: + exhaustion = 0.0032f * 1; + break; + case NORMAL: + exhaustion = 0.0032f * 2; + break; + case HARD: + exhaustion = 0.0032f * 3; + default: + break; + } + + for (int i = 0; i < 4; i++) { + if (thePlayer.inventory.armorInventory[i] == null) { + exhaustion -= (exhaustion - exhaustion * 0.4) / 4f; + break; + } + } + thePlayer.addExhaustion(Math.max(exhaustion, 0)); + } + } + } + + /* Armor Effect Only Occurs When Block/Item Package is Installed */ + @SubscribeEvent + public void cactusArmorDamage(LivingHurtEvent event) { + if (Loader.isModLoaded(DefaultProps.BlocksModId) && event.entity != null + && event.entity instanceof EntityPlayer && event.source.getSourceOfDamage() instanceof EntityLiving) { + EntityPlayer hurtEntity = (EntityPlayer) event.entity; + EntityLiving attackingEntity = (EntityLiving) event.source.getSourceOfDamage(); + if (attackingEntity != null && event.source.getDamageType() == "mob") { + + double cactusDamage = 0; + if (hurtEntity.inventory.armorInventory[3] != null && ItemList.cactusArmorHead.isPresent() + && hurtEntity.inventory.armorInventory[3].getItem() == ItemList.cactusArmorHead.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[2] != null && ItemList.cactusArmorChest.isPresent() + && hurtEntity.inventory.armorInventory[2].getItem() == ItemList.cactusArmorChest.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[1] != null && ItemList.cactusArmorLeg.isPresent() + && hurtEntity.inventory.armorInventory[1].getItem() == ItemList.cactusArmorLeg.get()) { + cactusDamage += 0.5; + } + if (hurtEntity.inventory.armorInventory[0] != null && ItemList.cactusArmorBoots.isPresent() + && hurtEntity.inventory.armorInventory[0].getItem() == ItemList.cactusArmorBoots.get()) { + cactusDamage += 0.5; + } + + if (cactusDamage > 0) { + attackingEntity.attackEntityFrom(DamageSource.causeThornsDamage(hurtEntity), + MathHelper.ceiling_double_int(cactusDamage)); + } + + } + } + } + + /** + * Used to Notify nearby Treeents they should be attacking this Player. Triggered by the Player breaking Wood Only + * notifies TreeEnts that are looking at the Player + */ + @SubscribeEvent + public void treeEntDefendForest(BreakSpeed event) { + if (Loader.isModLoaded(DefaultProps.MobsModId)) { + if (event.entity != null && event.entity instanceof EntityPlayer + && (event.block == Blocks.log || event.block == Blocks.log2)) { + EntityPlayer player = (EntityPlayer) (event.entity); + World worldObj = player.worldObj; + AxisAlignedBB playerBounding = player.boundingBox.copy(); + playerBounding = playerBounding.expand(24, 24, 24); + List listOfTreeEnts = player.worldObj + .getEntitiesWithinAABB(EntityTreeEnt.class, playerBounding); + if (!listOfTreeEnts.isEmpty()) { + Iterator entIterator = listOfTreeEnts.iterator(); + while (entIterator.hasNext()) { + Entity entity = (Entity) entIterator.next(); + if (((EntityTreeEnt) entity).getAngerLevel() <= 0 + && worldObj.rayTraceBlocks( + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ)) == null) { + // worldObj.getWorldVec3Pool().getVecFromPool(player.posX, + // player.posY + player.getEyeHeight(), player.posZ), + Vec3.createVectorHelper((double)player.posX, (double)player.posY + player.getEyeHeight(), (double)player.posZ), + // worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY, + // entity.posZ) + Vec3.createVectorHelper((double)entity.posX, (double)entity.posY, (double) entity.posZ) + ) == null) { + if (!worldObj.isRemote) { + ((EntityTreeEnt) entity).setAttackTarget(player); + } + ((EntityTreeEnt) entity).setAngerLevel(60); + } + } + } + } + } + + } + + @SubscribeEvent + public void onBreakBlock(BreakEvent event) + { + Random rand1 = new Random(); + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + + config.load(); + + bugRelease = config.get("mob controls", "Spawn Ambient Bugs on Block Break", this.bugRelease).getBoolean(bugRelease); + bugReleaseRate = config.get("mob controls", "Spawn Rate of Ambient Bugs on Block Break", this.bugReleaseRate).getInt(bugReleaseRate); + stickSpawn = config.get("mob controls", "Spawn Wood Sticks on Block Break", this.stickSpawn).getBoolean(stickSpawn); + stickSpawnRate = config.get("mob controls", "Spawn Rate of Wood Sticks on Block Break", this.stickSpawnRate).getInt(stickSpawnRate); + + config.save(); + + //System.out.println("***** Done setting up the config for spawned bugs"); + if (stickSpawn == true) { + if (event.block == Blocks.leaves || event.block == Blocks.leaves2){ + int stickDrop = rand1.nextInt(101); + + if (stickDrop <= stickSpawnRate) { + ItemStack itemstack1 = new ItemStack(Items.stick, 1); + + double xrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (event.world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(event.world, (double) event.x + xrand, (double) event.y + yrand, (double) event.z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + event.world.spawnEntityInWorld(itemDrop1); + + } + } + } + if (CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.BEETLEAS.modData.isPresent() && CustomEntityList.CENTIPEDE.modData.isPresent()) { + if (bugRelease == true) { + + //TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z); + if (event.block == Blocks.tallgrass || event.block == Blocks.vine + || event.block == Blocks.brown_mushroom_block || event.block == Blocks.yellow_flower + || event.block == Blocks.red_flower || event.block == Blocks.deadbush || event.block == Blocks.double_plant + || event.block == Blocks.leaves || event.block == Blocks.leaves2) + { + // Makes sure to only run on server, entity spawns must be done on server + if (!event.world.isRemote && rand1.nextInt(101) <= bugReleaseRate) { + int bugType = rand1.nextInt(10); + int bugCount1 = rand1.nextInt(2); + int bugCount2 = rand1.nextInt(2); + int bugCount3 = rand1.nextInt(2); + + if (bugType <= 2 ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + for (int i=0; i <= bugCount2; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + + } else if ((bugType >= 3) && (bugType <= 5) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleAS entity = new EntityBeetleAS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else if ((bugType >= 6) && (bugType <= 8) ) { + for (int i=0; i <= bugCount1; i++) { + EntityBeetleBS entity = new EntityBeetleBS(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } else { + for (int i=0; i <= bugCount3; i++) { + EntityCentipede entity = new EntityCentipede(event.world); + + // Places the entity close to the coords of the block (par2 = x, par3 = y, par4 = z) + entity.setLocationAndAngles((double)event.x + 0.5D, (double)event.y, (double)event.z + 0.5D, 0.0F, 0.0F); + + // Insert the bug in the world + event.world.spawnEntityInWorld(entity); + + // Creates the "puff" effect + entity.spawnExplosionParticle(); + } + } + } + } + } + } + } + +} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/0022bc01c82100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/0022bc01c82100141a6cb1c64d7b6ba1 deleted file mode 100644 index 5d30545..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/0022bc01c82100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,325 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprint.cathedral; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.WeightedRandom; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.BoundaryPair; -import projectzulu.common.world2.CellHelper; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BPCathedralEastTower implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.NorthWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.NorthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.EastWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.WestWall), cellSize, - cellHeight, random, cellIndexDirection); - } else if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - return getTowerBlock(CellHelper.rotateCellTo(piecePos, cellSize, CellIndexDirection.SouthWall), cellSize, - cellHeight, random, cellIndexDirection); - } - return null; - } - - public BlockWithMeta getTowerBlock(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - BlockWithMeta woodenPlank = new BlockWithMeta(Blocks.planks, 1); - BlockWithMeta carvedStone = new BlockWithMeta(Blocks.stonebrick, 3); - - List wallBlocks = new ArrayList(3); - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 2, 8)); // Cracked - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 1, 8)); // Mossy - wallBlocks.add(new BlockWithMeta(Blocks.stonebrick, 0, 100)); // Regular - - int diagonalIndex = piecePos.posZ + piecePos.posX; - int stairSegmentHeight = 2; - - /* Tower Bell */ - if (piecePos.posY > cellHeight - 6 && piecePos.posX > cellSize - 3 && piecePos.posZ > cellSize - 3) { - if (piecePos.posY == cellHeight - 2 && piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return carvedStone; - } - - if (piecePos.posY < cellHeight - 2) { - if (piecePos.posX == cellSize - 1 && piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.iron_block); - } - - if (piecePos.posY == cellHeight - 5) { - return carvedStone; - } else if (piecePos.posX == cellSize - 1 || piecePos.posZ == cellSize - 1) { - return carvedStone; - } - } - } - - /* Ceiling */ - if (piecePos.posY > cellHeight - cellSize * 2) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - diagonalIndex - 1, 1, - BoundaryPair.createPair(1, (cellSize) * 2), cellHeight); - if (slope == 0) { - return woodenPlank; - } else if (slope > 0) { - return new BlockWithMeta(Blocks.air); - } - } - - if (piecePos.posX == 0 && piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.air); - } - - /* Create Outside Walls */ - if (piecePos.posX == 0 || piecePos.posZ == 0) { - if (piecePos.posX == 1 || piecePos.posZ == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - if (piecePos.posX == 0) { - if (cellIndexDirection == CellIndexDirection.NorthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posZ <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ == 2 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posZ > 3 || piecePos.posZ == cellSize - 2) { - if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - true, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - - if (piecePos.posZ == 0) { - if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posY > 0 - && piecePos.posY <= 10) { - if (piecePos.posY % 5 == 0 || piecePos.posX <= 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (piecePos.posY == 0 || piecePos.posY == 1) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX == 2 || piecePos.posX == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } else if (piecePos.posX > 3 || piecePos.posX == cellSize - 2) { - if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, true, piecePos.posY % 4)); - } else { - return new BlockWithMeta(Blocks.stone_brick_stairs, getWindowMeta(cellIndexDirection, - false, false, piecePos.posY % 4)); - } - } - return new BlockWithMeta(Blocks.air); - } - } - - /* Create Stairs */ - if (0 < piecePos.posZ && piecePos.posZ < 3) { - /* Rising West-East */ - int slope = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 2, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, piecePos.posX - 1, 1, - BoundaryPair.createPair(1, stairSegmentHeight), getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, false)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } else if (0 < piecePos.posX && piecePos.posX < 3) { - int slope = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 1, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - int slopeBelow = CellHelper.getSlopeIndex(piecePos, cellSize - piecePos.posZ - 0, 1, - BoundaryPair.createPair(0, stairSegmentHeight - 1), - getStairSegmentTop(piecePos, cellIndexDirection)); - if (slope == 0) { - return slope != slopeBelow ? new BlockWithMeta(Blocks.stone_brick_stairs, getStairMeta( - cellIndexDirection, true)) : (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - } - - /* Tower-MidCathEntrance Floor */ - if (piecePos.posY % cellSize == 5 && (piecePos.posZ < 1 || piecePos.posX < 1)) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Tower Rooms */ - if (isRoomForRoom(piecePos, cellSize, cellHeight) && piecePos.posX > 2 && piecePos.posZ > 2 - && piecePos.posY > 0) { - if (piecePos.posY % (stairSegmentHeight * 2) == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Ensure the Door doesn't generate into the floor */ - if (piecePos.posY != 0 && piecePos.posY - 1 != 0) { - if (cellIndexDirection == CellIndexDirection.NorthEastCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 4) { - return new BlockWithMeta(Blocks.wooden_door, 1); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 5) { - return new BlockWithMeta(Blocks.wooden_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.SouthWestCorner && piecePos.posX == 3 - && piecePos.posZ == 4) { - if (piecePos.posY % (stairSegmentHeight * 4) == 0) { - return new BlockWithMeta(Blocks.wooden_door, 3); - } else if (piecePos.posY % (stairSegmentHeight * 4) == 1) { - return new BlockWithMeta(Blocks.wooden_door, 11); - } - } - } - - /* Room Walls */ - if (piecePos.posX == 3 || piecePos.posZ == 3) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - /* Room Contents: Bed */ - if (cellIndexDirection == CellIndexDirection.SouthEastCorner) { - if ((piecePos.posX == 4 || piecePos.posZ == 4)) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0 - || (piecePos.posY % (stairSegmentHeight * 2) == 1 && random.nextInt(3) == 0)) { - return new BlockWithMeta(Blocks.bookshelf); - } - } - } - - /* Room Contents: Bookshelf */ - if (cellIndexDirection == CellIndexDirection.NorthWestCorner) { - if (piecePos.posY % (stairSegmentHeight * 2) == 0) { - if (piecePos.posX == 4 && (piecePos.posZ == 4 || piecePos.posZ == 5)) { - return piecePos.posZ == 5 ? new BlockWithMeta(Blocks.bed, 2) : new BlockWithMeta( - Blocks.bed, 10); - } - } - } - } - - /* Tower Floor */ - if (piecePos.posY == 0) { - return (BlockWithMeta) WeightedRandom.getRandomItem(random, wallBlocks); - } - - return new BlockWithMeta(Blocks.air); - } - - private boolean isRoomForRoom(ChunkCoordinates piecePos, int cellSize, int cellHeight) { - int roomHeight = 2 * 2; - int ceilingClearance = 8; - for (int i = 0; i < roomHeight; i++) { - if ((piecePos.posY + i) % roomHeight == 3) { - if (piecePos.posY + i + ceilingClearance <= cellHeight) { - return true; - } else { - return false; - } - } - } - return false; - } - - private int getStairSegmentTop(ChunkCoordinates piecePos, CellIndexDirection cellIndexDirection) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return (int) (6 + Math.floor(piecePos.posY / 8) * 8); - case NorthEastCorner: - return (int) (4 + Math.floor(piecePos.posY / 8) * 8); - case SouthEastCorner: - return (int) (2 + Math.floor(piecePos.posY / 8) * 8); - case SouthWestCorner: - return (int) (8 + Math.floor(piecePos.posY / 8.01D) * 8); - } - } - - private int getStairMeta(CellIndexDirection cellIndexDirection, boolean high) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return high ? 2 : 1; - case NorthEastCorner: - return high ? 1 : 3; - case SouthEastCorner: - return high ? 3 : 0; - case SouthWestCorner: - return high ? 0 : 2; - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean otherWall, boolean edge, int height) { - if (otherWall) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - return getWindowMeta(CellIndexDirection.NorthEastCorner, edge, height); - case NorthEastCorner: - return getWindowMeta(CellIndexDirection.SouthEastCorner, edge, height); - case SouthEastCorner: - return getWindowMeta(CellIndexDirection.SouthWestCorner, edge, height); - case SouthWestCorner: - return getWindowMeta(CellIndexDirection.NorthWestCorner, edge, height); - } - } else { - return getWindowMeta(cellIndexDirection, edge, height); - } - } - - private int getWindowMeta(CellIndexDirection cellIndexDirection, boolean edge, int height) { - switch (cellIndexDirection) { - case NorthWestCorner: - default: - if (edge) { - return height == 0 ? 5 : height == 1 ? 4 : height == 2 ? 0 : 1; - } else { - return height % 2 == 0 ? 1 : 5; - } - case NorthEastCorner: - if (edge) { - return height == 0 ? 7 : height == 1 ? 6 : height == 2 ? 2 : 3; - } else { - return height % 2 == 0 ? 3 : 7; - } - case SouthEastCorner: - if (edge) { - return height == 0 ? 4 : height == 1 ? 5 : height == 2 ? 1 : 0; - } else { - return height % 2 == 0 ? 0 : 4; - } - case SouthWestCorner: - if (edge) { - return height == 0 ? 6 : height == 1 ? 7 : height == 2 ? 3 : 2; - } else { - return height % 2 == 0 ? 2 : 6; - } - } - } - - @Override - public String getIdentifier() { - return "CathedralEastTower"; - } - - @Override - public int getWeight() { - return 0; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/0079f8ffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/0079f8ffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4355bd4..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/0079f8ffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,196 +0,0 @@ -package com.ngb.projectzulu.common.blocks.tombstone; - -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.client.renderer.entity.RenderManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.entity.Entity; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.blocks.ModelTombstone; -import projectzulu.common.core.DefaultProps; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class TileEntityTombstoneRenderer extends TileEntitySpecialRenderer { - /** The ModelSign instance used by the TileEntityTombstoneRenderer */ - private ModelTombstone modelSign = new ModelTombstone(); - public static final ResourceLocation TOMBSTONE = new ResourceLocation(DefaultProps.blockKey, "Tombstone.png"); - public static final ResourceLocation BEACON = new ResourceLocation("textures/entity/beacon_beam.png"); - - public void renderTileEntityTombstoneAt(TileEntityTombstone par1TileEntityTombstone, double par2, double par4, - double par6, float par8) { - int meta; - float rotation; - if (par8 == -1) { - meta = 4; - rotation = meta * 360 / 8; - } else { - meta = par1TileEntityTombstone.getBlockMetadata(); - rotation = par1TileEntityTombstone.getBlockMetadata() * 360 / 8; - } - this.bindTexture(TOMBSTONE); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.9f, -0.8F, 0.9F); - this.modelSign.render1((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glRotatef(0.0f, 0.0f, 1.0F, 0.0f); - GL11.glTranslatef((float) par2 + 0.5f, (float) par4 + 0.88f, (float) par6 + 0.5f); - GL11.glScalef(-0.899f, -0.8F, 0.899F); - this.modelSign.render2((Entity) null, 0, 0, 0, 0, 0, 0.0459f, -rotation); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - float var10 = 0.6666667F; - GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F); - GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); // Var11 is getMetaData Rotation - - FontRenderer var17 = this.func_147498_b(); - float var12 = 0.016666668F * 0.8f * var10; - float xOffset = 0.0f; - float zOffset = 0.15f; - float yOffset = -0.32f; - GL11.glTranslatef(0.0F + xOffset, 0.5F * var10 + yOffset, 0.07F * var10 + zOffset); - GL11.glScalef(var12, -var12, var12); - GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); - GL11.glDepthMask(false); - byte var13 = 0; - - for (int var14 = 0; var14 < par1TileEntityTombstone.signText.length; ++var14) { - String var15 = par1TileEntityTombstone.signText[var14]; - if (var14 == par1TileEntityTombstone.lineBeingEdited) { - var15 = "> " + var15 + " <"; - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } else { - var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - - par1TileEntityTombstone.signText.length * 5, var13); - } - } - GL11.glDepthMask(true); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPopMatrix(); - - if (par1TileEntityTombstone.getEntityOrb() != null) { - GL11.glPushMatrix(); - long time = par1TileEntityTombstone.getWorldObj().getWorldInfo().getWorldTotalTime(); - float orbOrbitRadius = 0.3f; - float periodScale = 6.0f; - GL11.glTranslatef((float) par2 + 0.5f, (float) (par4 + 1.1f + 0.05f * Math.cos(time / 20f)), - (float) par6 + 0.5F); - for (int orb = 1; orb <= 3; orb++) { - float xTrans = getOrbitTransformationX(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationX(time, orb - 1, 3, orbOrbitRadius, periodScale); - float zTrans = getOrbitTransformationZ(time, orb, 3, orbOrbitRadius, periodScale) - - getOrbitTransformationZ(time, orb - 1, 3, orbOrbitRadius, periodScale); - GL11.glTranslatef(xTrans, 0.0F, zTrans); - RenderManager.instance.renderEntityWithPosYaw(par1TileEntityTombstone.getEntityOrb(), 0.0D, 0.0D, 0.0D, - 0.0F, par8); - } - GL11.glPopMatrix(); - renderBeacon(par1TileEntityTombstone.getWorldObj(), par2, par4, par6, par8); - } - } - - public void renderBeacon(World world, double par2, double par4, double par6, float par8) { - float f1 = 1.0f; - Tessellator tessellator = Tessellator.instance; - this.bindTexture(BEACON); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - float f2 = (float) world.getTotalWorldTime() + par8; - float f3 = -f2 * 0.2F - (float) MathHelper.floor_float(-f2 * 0.1F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(false); - tessellator.startDrawingQuads(); - tessellator.setColorRGBA(255, 255, 255, 32); - double d18 = 0.01D; - double d19 = 0.01D; - double d20 = 0.99D; - double d21 = 0.01D; - double d22 = 0.01D; - double d23 = 0.99D; - double d24 = 0.99D; - double d25 = 0.99D; - double d26 = (double) (256.0F * f1); - double d27 = 0.0D; - double d28 = 1.0D; - double d29 = (double) (-1.0F + f3); - double d30 = (double) (256.0F * f1) + d29; - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d28, d30); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d28, d29); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d27, d29); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d27, d30); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d28, d30); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d28, d29); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d27, d29); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d27, d30); - tessellator.addVertexWithUV(par2 + d20, par4 + d26, par6 + d21, d28, d30); - tessellator.addVertexWithUV(par2 + d20, par4, par6 + d21, d28, d29); - tessellator.addVertexWithUV(par2 + d24, par4, par6 + d25, d27, d29); - tessellator.addVertexWithUV(par2 + d24, par4 + d26, par6 + d25, d27, d30); - tessellator.addVertexWithUV(par2 + d22, par4 + d26, par6 + d23, d28, d30); - tessellator.addVertexWithUV(par2 + d22, par4, par6 + d23, d28, d29); - tessellator.addVertexWithUV(par2 + d18, par4, par6 + d19, d27, d29); - tessellator.addVertexWithUV(par2 + d18, par4 + d26, par6 + d19, d27, d30); - tessellator.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - - public String reverse(String s) { - return new StringBuffer(s).reverse().toString(); - } - - /** - * - * @param time - * @param orb Current Orb being Rendered. Index 1. - * @param maxOrbs Maximum Orbs in a single orbit. Used to calculate offset within orbit. - * @param orbitRadius Radius of Orb orbit - * @param orbitPeriod Scaling factor that effects period of orbit. - * @return - */ - private float getOrbitTransformationX(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0f; - } else { - return orbitRadius * (float) Math.cos(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - private float getOrbitTransformationZ(float time, int orb, int maxOrbs, float orbitRadius, float orbitPeriod) { - if (orb <= 0) { - return 0; - } else { - return orbitRadius * (float) Math.sin(time / orbitPeriod + orb * Math.PI * 2 / maxOrbs); - } - } - - @Override - public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - this.renderTileEntityTombstoneAt((TileEntityTombstone) par1TileEntity, par2, par4, par6, par8); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/206721f9c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/206721f9c42100141fce95f06aba7e85 deleted file mode 100644 index e3751db..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/206721f9c42100141fce95f06aba7e85 +++ /dev/null @@ -1,40 +0,0 @@ -package com.ngb.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.api.CustomEntityList; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseBlack extends EntityHorseBase{ - - public EntityHorseBlack(World par1World) { - super(par1World); - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/20f1a5f4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/20f1a5f4c42100141fce95f06aba7e85 deleted file mode 100644 index 07f9153..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/20f1a5f4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,543 +0,0 @@ -//package com.ngb.projectzulu.common.temperature; -// -//import java.util.ArrayList; -//import java.util.EnumSet; -//import java.util.HashMap; -//import java.util.Map; -// -//import net.minecraft.src.BiomeGenBase; -//import net.minecraft.src.Block; -//import net.minecraft.src.EntityLiving; -//import net.minecraft.src.EntityPlayer; -//import net.minecraft.src.EntityPlayerMP; -//import net.minecraft.src.Material; -//import net.minecraft.src.NBTTagCompound; -//import net.minecraft.src.Potion; -//import net.minecraft.src.PotionEffect; -//import net.minecraft.src.World; -//import cpw.mods.fml.common.IPlayerTracker; -//import cpw.mods.fml.common.ITickHandler; -//import cpw.mods.fml.common.TickType; -// -//public class TemperatureTickerAttempt2 implements ITickHandler, IPlayerTracker{ -// -// public static final int tempDataWatcher = 18; -// -// /* Player Tempurature HashMaps */ -// private static float playerTemperature = 0; -//// private static Map temperatureMap = new HashMap(); -// private static String lastWorldName; -// private static Map lastWorldNameMap = new HashMap(); -// private static Map playerLocTempMap = new HashMap(); -// -//// private static Map playerOuterTempModifierMap = new HashMap(); -// -//// private static float[] blockTempMod = new float[4096]; -// -// /* Variables for Saving and Writing */ -// public static long inGameTicks = 0; -// private static float defaultTemperature = 0; -// -// private short DirtyFlag = 0; -// public TemperatureTickerAttempt2(){ -// lastWorldName = ""; -// } -// -// private static ArrayList playerList = new ArrayList(); -// private static ArrayList stringList = new ArrayList(); -// -// -// @Override -// public void tickStart(EnumSet type, Object... tickData) { -// -// } -// -// @Override -// public void tickEnd(EnumSet type, Object... tickData) { -// for (TickType tickType : type) { -// -// /* Handle Calculation of Temperature by Client/Server for eacg Player, TickType = Player (Passes in Player) */ -// if( tickType.equals(TickType.PLAYER) ){ -// -// /** -// * Get Player and World -// */ -// EntityPlayer player = (EntityPlayer)tickData[0]; -// World worldObj = player.worldObj; -// -// /** -// * Check if Player is In tempMap -// * If Present, get playerTemperature and LastWorld -// * Otherwise, addPlayer to Map -// */ -// if( lastWorldNameMap.containsKey( player.getEntityName() ) ){ -//// playerTemperature = temperatureMap.get( player.getEntityName() ); -// playerTemperature = getTempFromDataWatcher(player, tempDataWatcher); -// lastWorldName = lastWorldNameMap.get( player.getEntityName() ); -// }else{ -// addPlayer(player); -// playerTemperature = 0; -// lastWorldName = ""; -// } -// -// /* Check if We Should Read / Handle Reading (Only On Servers) */ -// if( player instanceof EntityPlayerMP){ -// String worldName = player.worldObj.getWorldInfo().getWorldName(); -// /** -// * If World Name Has Changed (i.e. we have changed maps or just started Minecraft) -// * We Should Reset playerTemperature and then mark that we need a new value from file -// * */ -//// System.out.println("Should be Reading :".concat(worldName).concat(lastWorldName) ); -// -// if (lastWorldName != worldName ){ -// lastWorldName = worldName; -// playerTemperature = 0; -// SetPendingRead(); -// readNBTFromFile(player); -// -//// System.out.println( "SETUP" ); -// -// /* Save WorldName to Map */ -// lastWorldNameMap.put(player.getEntityName(), worldName); -// } -// -//// /* Read From File */ -//// if ( HasPendingRead() ){ -//// readNBTFromFile(player); -//// ClearPendingRead(); -////// System.out.println( "READ" ); -//// } -// -// } -// -// /* Get Outside Temperature */ -// Float playerLocationTemperature = worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature(); -// -// /* Untouched playerTemp and Location Temp used to hand to items/blocks to determine their contribution */ -// Float unTouchedPlayerLocationTemperature = playerLocationTemperature; -// Float unTouchedPlayerTemperature = playerTemperature; -// float heatTransferRate = 0.0001f; -// boolean useFastHeatTransfer = false; -// -// /* Check Special Blocks that Effect Temperature (i.e. Water) */ -// if(player.isInWater()){ -//// playerLocationTemperature -= 0.1f*Math.abs(worldObj.getBiomeGenForCoords( (int)player.posX, (int)player.posZ).getFloatTemperature()); -// playerLocationTemperature -= playerLocationTemperature > 1.5f ? 0.75f : playerLocationTemperature < -0.5f ? 1.0f : 0.5f; -// useFastHeatTransfer = true; -// } -// if(player.isInsideOfMaterial(Material.lava)){ -// playerLocationTemperature += 2.0f; -// useFastHeatTransfer = true; -// } -// if( !worldObj.canBlockSeeTheSky( (int)player.posX, (int)player.posY, (int)player.posZ) ){ -// playerLocationTemperature -= 0.02f; -// -// } -// if( !worldObj.isDaytime() ){ -// playerLocationTemperature -= 0.03f; -// } -// -// /* Check Item Being Held */ -// if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ITempItem ){ -// ITempItem item = (ITempItem) player.inventory.getCurrentItem().getItem(); -// -// /* Item in Hand */ -//// playerLocationTemperature += item.getAddToPlayTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -//// playerTemperature += item.getAddToLocTempWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// -// heatTransferRate += item.getAddToHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferWithCurItem(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// -// } -// -// /* Check Armor That is Equipped */ -// for (int i = 0; i < player.inventory.armorInventory.length; i++) { -// if(player.inventory.armorInventory[i] != null && player.inventory.armorInventory[i].getItem() instanceof ITempArmor ){ -// ITempArmor item = (ITempArmor) player.inventory.armorInventory[i].getItem(); -// -// playerLocationTemperature += item.getAddToPlayTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += item.getAddToLocTempOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += item.getAddToHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// useFastHeatTransfer = item.getBooleanCauseFastHeatTransferOnEquip(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// } -// } -// -// /* Check Nearby Blocks in 8x8x8 Square*/ -// int innerBlockRadius = 4; -// for (int i = -innerBlockRadius; i <= innerBlockRadius; i++) { -// for (int k = -innerBlockRadius; k <= innerBlockRadius; k++) { -// for (int j = -innerBlockRadius; j <= innerBlockRadius; j++) { -// int curX = (int) (player.posX+i); -// int curY = (int) (player.posY+j); -// int curZ = (int) (player.posZ+k); -// if( Block.blocksList[worldObj.getBlockId(curX, curY, curZ)] instanceof ITempBlock ){ -// ITempBlock currentBlock = (ITempBlock)Block.blocksList[worldObj.getBlockId(curX, curY, curZ)]; -// -// playerLocationTemperature += currentBlock.getAddToLocTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// playerTemperature += currentBlock.getAddToPlayTempByNearbyBlock(player, curX, curY, curZ, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature); -// heatTransferRate += currentBlock.getAddToHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature,heatTransferRate); -// useFastHeatTransfer = currentBlock.getBooleanCauseFastHeatTransferByBlock(player, unTouchedPlayerTemperature, unTouchedPlayerLocationTemperature, heatTransferRate); -// }else{ -// playerLocationTemperature += evaluateBlockAtLocForLocation(worldObj, curX, curY, curZ); -// playerTemperature += evaluateBlockAtLocForPlayer(worldObj, curX, curY, curZ); -// -// } -// } -// } -// } -// -// /* Perform Heat Transfer From Environment to Player*/ -// if(useFastHeatTransfer){ -// playerTemperature += 0.01f * (playerLocationTemperature - playerTemperature); -// }else{ -// playerTemperature += heatTransferRate * (playerLocationTemperature - playerTemperature); -// } -// -// /* Convert to Human Readable Number that we can work with for assigning effects*/ -// float playerTemperatureDegrees = decimalToDegrees(playerTemperature); -// if(!worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell)){ -// /* Handle Effect Of Temperature on Player */ -// if( playerTemperatureDegrees < 20){ -// /* Handle Very Cold */ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 1, 100 - (int)playerTemperatureDegrees)); -// -// }else if( playerTemperatureDegrees < 30 ){ -// /* Handle Medium Cold */ -// -// }else if ( playerTemperatureDegrees < 40 ){ -// /* Handle Little Cold */ -// -// }else if( playerTemperatureDegrees > 100 ){ -// /* Handle High Heat */ -// if(inGameTicks % 80 > 8){ -// ((EntityLiving)player).addPotionEffect(new PotionEffect(Potion.confusion.id, 62,100)); -// } -// -// }else if( playerTemperatureDegrees > 90 ){ -// /* Handle Medium Heat */ -// -// }else if( playerTemperatureDegrees > 80 ){ -// /* Handle Little Heat */ -// } -// -// }else{ -// playerTemperature = 3.0f; -// } -// -// /* Set Temperature To Datawatcher on Server Side */ -// if(player instanceof EntityPlayerMP){ -// updateTempInDataWatcher(player, tempDataWatcher, playerTemperature); -// } -// -// /* Save Temperature To Map*/ -//// temperatureMap.put( player.getEntityName(), playerTemperature); -// playerLocTempMap.put( player.getEntityName(), playerLocationTemperature); -// /* Set Data to Be Written to Disk*/ -// SetPendingWrite(); -// -// /*Debugging Shit, Make Sure Crap Actually Works*/ -// if( player instanceof EntityPlayerMP ){ -//// System.out.println( player.getEntityName().concat("File ").concat( player.worldObj.getWorldInfo().getWorldName() )); -//// System.out.println( player.getEntityName().concat("Loc ").concat( Float.toString(playerLocationTemperature*100) )); -//// System.out.println( player.getEntityName().concat("PlayServ ").concat( Float.toString(playerTemperature*100) )); -//// System.out.println( player.getEntityName().concat("Serv Loops ").concat( Long.toString(inGameTicks) )); -// }else{ -//// System.out.println( player.getEntityName().concat("PlayClie ").concat( Float.toString(playerTemperature*100) )); -// } -// -//// /* Handle Sending Packet With Updated Temperature From Server To Client (Only on Server, by definition)*/ -//// if(player instanceof EntityPlayerMP){ -//// -//// ByteArrayOutputStream bytes = new ByteArrayOutputStream(); -//// DataOutputStream data = new DataOutputStream(bytes); -////// System.out.println( player.getEntityName().concat("Preparing To Send: ").concat( Float.toString(playerTemperature*100) )); -//// try { -//// data.writeFloat(playerTemperature); -//// } catch (Exception e) { -//// e.printStackTrace(); -//// } -//// -//// Packet250CustomPayload packet = new Packet250CustomPayload(); -//// packet.channel = "Channel_Zulu"; // CHANNEL MAX 16 CHARS -//// packet.data = bytes.toByteArray(); -//// packet.length = packet.data.length; -//// PacketDispatcher.sendPacketToPlayer(packet, (Player) player); -////// System.out.println( player.getEntityName().concat("Sent Packet ")); -//// } -// -// /* Handle Writing (Only On Servers) */ -// if(player instanceof EntityPlayerMP){//) && HasPendingWrite() ){ -// writeNBTToFile(player); -// ClearPendingWrite(); -//// System.out.println( "WRITE" ); -// } -// -// -// } -// } -// -// -// inGameTicks++; -// } -// -// -// @Override -// public EnumSet ticks() { -// return EnumSet.of(TickType.PLAYER); -// } -// -// @Override -// public String getLabel() { -// return "TempTicker"; -// } -// -// private void SetPendingRead(){ -// DirtyFlag |= 1; -// } -// -// private void SetPendingWrite(){ -// DirtyFlag |= 2; -// } -// -// private void ClearPendingRead(){ -// DirtyFlag &= ~1; -// } -// -// private void ClearPendingWrite(){ -// DirtyFlag &= ~2; -// } -// -// private boolean HasPendingRead(){ -// return (DirtyFlag & 1) == 1; -// } -// -// private boolean HasPendingWrite(){ -// return (DirtyFlag & 2) == 2; -// } -// -// private void writeNBTToFile(EntityPlayer player){ -// try -// { -// -////// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// // File file = new File(ModLoader.getMinecraftInstance().getMinecraftDir() + "/saves/" + ModLoader.getMinecraftInstance().theWorld.saveHandler.getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// if(!file.exists()) -//// { -//// file.createNewFile(); -//// } -//// FileOutputStream fileoutputstream = new FileOutputStream(file); -//// NBTTagCompound nbttagcompound = new NBTTagCompound(); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), getTempFromDataWatcher(player, tempDataWatcher) ); -// -//// nbttagcompound.setFloat(player.getEntityName().concat("zulu_temperature_a"), playerTemperature); -// -//// CompressedStreamTools.writeCompressed(nbttagcompound, fileoutputstream); -//// fileoutputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -// private void readNBTFromFile( EntityPlayer player){ -// try -// { -//// /*Method 1: Custom NBT System */ -//// File file = new File(System.getProperty("user.dir") + "/saves/" + player.worldObj.getSaveHandler().getSaveDirectoryName() + "", "any_name_you_want.dat"); -//// File parentDir = file.getParentFile(); -//// if(! parentDir.exists()){ -//// parentDir.mkdirs(); -//// } -//// -//// if(!file.exists()) -//// { -//// return; -//// } -//// FileInputStream fileinputstream = new FileInputStream(file); -//// NBTTagCompound nbttagcompound = CompressedStreamTools.readCompressed(fileinputstream); -// -// /*Method 2: Forge has a NBT System for custom Data Already I guess */ -// NBTTagCompound nbttagcompound = player.getEntityData(); -// -// if (nbttagcompound.hasKey( player.getEntityName().concat("zulu_temperature_a") )){ -// updateTempInDataWatcher(player, tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -// -//// player.getDataWatcher().updateObject(tempDataWatcher, nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") )); -//// this.playerTemperature = nbttagcompound.getFloat( player.getEntityName().concat("zulu_temperature_a") ); -// } -// -//// fileinputstream.close(); -// } -// catch(Exception exception) -// { -// exception.printStackTrace(); -// } -// } -// -//// public static void updateTemperatureFromPacket(DataInputStream data, EntityPlayer sender){ -//// -//// /* Get Relevent Data From DataStream */ -//// float tempTemp = playerTemperature; -//// try { -//// tempTemp = data.readFloat(); -//// } catch (IOException e) { -//// e.printStackTrace(); -//// } -//// -//// /* Make Sure Player Exists, then Assign data to map */ -//// if(temperatureMap.containsKey(sender.getEntityName())){ -//// temperatureMap.put(sender.getEntityName(), tempTemp); -////// System.out.println( sender.getEntityName().concat("Received Packet ")); -//// -//// } -//// -//// -//// } -// /** -// * Evaluates the block at the given Coordinate and return its effect on Player Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForPlayer(World worldObj, int posX, int posY, int posZ){ -// -// return 0; -// } -// -// /** -// * Evaluates the block at the given Coordinate and return its effect on Location Temperature -// * @param posX,Y,Z of Block -// * @return -// */ -// private float evaluateBlockAtLocForLocation(World worldObj, int posX, int posY, int posZ){ -// float tempModifier = 0f; -// int blockID = worldObj.getBlockId(posX, posY, posZ); -// if( blockID == Block.ice.blockID ){ -// tempModifier -= 0.02f; -// -// }else if( blockID == Block.snow.blockID ){ -// tempModifier -= 0.01f; -// -// }else if(blockID == Block.lavaMoving.blockID || blockID == Block.lavaStill.blockID){ -// tempModifier += 0.02f; -// } -// return tempModifier; -// } -// -// /** -// * Add Player to temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void addPlayer(EntityPlayer player){ -//// temperatureMap.put(player.getEntityName(), 0.0f); -// -// lastWorldNameMap.put(player.getEntityName(), ""); -// player.getDataWatcher().addObject(tempDataWatcher, (int)playerTemperature); -// } -// -// /** -// * Remove Player from temperatureMap and LastWorldNameMap -// * @param player -// */ -// public void removePlayer(EntityPlayer player){ -//// temperatureMap.remove(player.getEntityName()); -// lastWorldNameMap.remove(player.getEntityName()); -// } -// -// @Override -// public void onPlayerLogin(EntityPlayer player) { -// addPlayer(player); -// -// } -// -// @Override -// public void onPlayerLogout(EntityPlayer player) { -// removePlayer(player); -// -// } -// -// @Override -// public void onPlayerChangedDimension(EntityPlayer player) { -// -// if(!player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ).equals(BiomeGenBase.hell) && !player.worldObj.isRemote){ -// player.getDataWatcher().updateObject(tempDataWatcher, defaultTemperature); -//// temperatureMap.put(player.getEntityName(), defaultTemperature); -// } -// -// } -// -// @Override -// public void onPlayerRespawn(EntityPlayer player) { -//// System.out.println("Player Respawned"); -// -// } -// -// /** -// * Gets the Temperature for the Provided if player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerTemperature(EntityPlayer player){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) getTempFromDataWatcher(player, tempDataWatcher); -//// return temperatureMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static void updateTempInDataWatcher(EntityPlayer player, int index, float value){ -// player.getDataWatcher().updateObject(index, (int)value); -// } -// /** -// * Helper Functions to set and read from PlayerDatawatcher while maintaining a scale -// */ -// private static Float getTempFromDataWatcher(EntityPlayer player, int index){ -// if(lastWorldNameMap.containsKey(player.getEntityName())){ -// return (float) player.getDataWatcher().getWatchableObjectInt(index); -// } -// return 0f; -// } -// /** -// * Gets the Temperature at the provided player if it exists -// * @param player -// * @return temperature if player is present in map, null if player is not in map -// */ -// public static Float getPlayerLocTemperature(EntityPlayer player){ -// if(playerLocTempMap.containsKey(player.getEntityName())){ -// return playerLocTempMap.get(player.getEntityName()); -// } -// return null; -// } -// -// /** -// * USed to Convert from Minecraft Decimal Temperatures to a human readable scale -// * @param value -// * @param set1min -// * @param set1max -// * @param set2min -// * @param set2max -// * @return -// */ -// private static float decimalToDegrees(float value){ -// -// return 120 - mapValueofSet1ToSet2(value, 3.5f, -2.5f, 0, 120); -// } -// -// private static float mapValueofSet1ToSet2(float value, float set1min, float set1max, float set2min, float set2max){ -//// return (float) (Math.pow(set1max,-3f)/set2max*Math.pow(value, -3f)); -// return (value - set1min)*( (set2max - set2min) / (set1max - set1min) ) + set2min; -// } -// -//} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/30c56dffc72100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/30c56dffc72100141a6cb1c64d7b6ba1 deleted file mode 100644 index d4174bb..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/30c56dffc72100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,46 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import projectzulu.common.world.CellIndexDirection; -import projectzulu.common.world.dataobjects.BlockWithMeta; -import projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemetaryFountain2 implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } else { - return new BlockWithMeta(Blocks.water); - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "CemetaryFountain2"; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/601cfee5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/601cfee5c42100141fce95f06aba7e85 deleted file mode 100644 index 1f18cb7..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/601cfee5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,20 +0,0 @@ -package projectzulu.common.potion.subitem; - -import net.minecraft.item.Item; -import net.minecraft.potion.Potion; - -import com.google.common.base.Optional; - -public class SubItemPotionResistance extends SubItemPotionHalfPower { - - public SubItemPotionResistance(Item itemID, int subID) { - super(itemID, subID, "Resistance"); - setSubItemBounds(4, 4, 4, 0); - setEffectScale(20 * 20, 20 * 5, 13, 10, 1); - } - - @Override - Optional getPotion() { - return Optional.of(Potion.resistance); - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/60fe02e6c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/60fe02e6c42100141fce95f06aba7e85 deleted file mode 100644 index 75a5a2a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/60fe02e6c42100141fce95f06aba7e85 +++ /dev/null @@ -1,21 +0,0 @@ -package projectzulu.common.potion; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import net.minecraft.potion.Potion; - -public class ZuluPotionHelper{ - public static void setVanillaPotionProperties() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{ - Potion potionToEdit = Potion.potionTypes[Potion.blindness.getId()]; - Method[] potionMethods = potionToEdit.getClass().getDeclaredMethods(); - int doubleCounter = 0; - for (int i = 0; i < potionMethods.length; i++) { - /* Look for setEffectiveness : It has 1 Parameter and it is a double : No other method fits that criteria */ - if(potionMethods[i].getParameterTypes().length == 1 && (potionMethods[i].getParameterTypes())[0].toString().equals("double")){ - potionMethods[i].setAccessible(true); - potionMethods[i].invoke(potionToEdit, 0.03D); - } - } - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b0dc49e4c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b0dc49e4c42100141fce95f06aba7e85 deleted file mode 100644 index 3005cbe..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/b0dc49e4c42100141fce95f06aba7e85 +++ /dev/null @@ -1,39 +0,0 @@ -package projectzulu.common.blocks.itemblockdeclarations; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import projectzulu.common.api.BlockList; -import projectzulu.common.blocks.BlockPalmTreeLog; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.itemblockdeclaration.BlockDeclaration; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.registry.GameRegistry; - -public class PalmTreeLogDeclaration extends BlockDeclaration { - - public PalmTreeLogDeclaration() { - super("PalmTreeLog"); - } - - @Override - protected boolean createBlock() { - BlockList.palmTreeLog = Optional.of(new BlockPalmTreeLog().setBlockName(name.toLowerCase()) - .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); - return true; - } - - @Override - protected void registerBlock() { - Block block = BlockList.palmTreeLog.get(); - GameRegistry.registerBlock(block, name.toLowerCase()); - OreDictionary.registerOre("log", new ItemStack(block)); - OreDictionary.registerOre("logWood", new ItemStack(block)); - OreDictionary.registerOre("logPalm", new ItemStack(block)); - Blocks.fire.setFireInfo(block, 5, 20); - } - -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/c00003a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/c00003a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index a51477b..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/c00003a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,67 +0,0 @@ -package projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.channel.ChannelHandlerContext; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import projectzulu.common.core.PZPacket; -import projectzulu.common.dungeon.TileEntityLimitedMobSpawner; - -public class PacketMobSpawner extends PacketDataStream { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(ChannelHandlerContext ctx, DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(ChannelHandlerContext ctx, DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/e0dc0fa2c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/e0dc0fa2c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index d87c2ff..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/e0dc0fa2c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,76 +0,0 @@ -package projectzulu.common.mobs.renders; - -import net.minecraft.block.Block; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; - -import org.lwjgl.opengl.GL11; - -import projectzulu.common.core.DefaultProps; -import projectzulu.common.mobs.models.ModelHauntedArmor; - -public class RenderHauntedArmor extends RenderGenericLiving { - - ModelHauntedArmor hauntedModel; - - public RenderHauntedArmor(ModelBase modelBase, float shadowSize) { - super(modelBase, shadowSize, new ResourceLocation(DefaultProps.mobKey, "mammoth.png")); - // Unused Resource Location so It doesn't yell in the log - hauntedModel = (ModelHauntedArmor) modelBase; - } - - @Override - protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2) { - renderItemInHand(par1EntityLiving); - } - - private void renderItemInHand(EntityLivingBase par1EntityLiving) { - ItemStack var3 = par1EntityLiving.getHeldItem(); - if (var3 != null) { - GL11.glPushMatrix(); - hauntedModel.swordhand.postRender(0.0625F); - float var4; - - if (var3.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(var3.getItem()).getRenderType())) { - var4 = 0.5F; - GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); - var4 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } else if (var3.getItem() == Items.bow) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else if (var3.getItem().isFull3D()) { - var4 = 0.625F; - GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - GL11.glScalef(var4, -var4, var4); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { - var4 = 0.375F; - GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var4, var4, var4); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 0); - - if (var3.getItem().requiresMultipleRenderPasses()) { - this.renderManager.itemRenderer.renderItem(par1EntityLiving, var3, 1); - } - GL11.glPopMatrix(); - } - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/e152a9a1c52100141a6cb1c64d7b6ba1 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/e152a9a1c52100141a6cb1c64d7b6ba1 deleted file mode 100644 index 4b7a193..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/e152a9a1c52100141a6cb1c64d7b6ba1 +++ /dev/null @@ -1,78 +0,0 @@ -package projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; -import projectzulu.common.api.CustomMobData; -import projectzulu.common.api.ItemList; -import projectzulu.common.core.ConfigHelper; -import projectzulu.common.core.DefaultProps; -import projectzulu.common.core.ItemGenerics; -import projectzulu.common.core.entitydeclaration.EntityProperties; -import projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import projectzulu.common.mobs.entity.EntityBlackBear; -import projectzulu.common.mobs.models.ModelBlackBear; -import projectzulu.common.mobs.renders.RenderGenericLiving; -import projectzulu.common.mobs.renders.RenderWrapper; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class BearBlackDeclaration extends SpawnableDeclaration { - - public BearBlackDeclaration() { - super("Black Bear", 16, EntityBlackBear.class, EnumCreatureType.creature); - setSpawnProperties(10, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 2); - - eggColor1 = (0 << 16) + (0 << 8) + 0; - eggColor2 = (23 << 16) + (17 << 8) + 17; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.furPelt, 0, 8); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericLiving(new ModelBlackBear(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "bearblack.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.taiga.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.taigaHills.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Mountain Taiga"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Snow Forest"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - defaultBiomesToSpawn.addAll(typeToArray(Type.FOREST)); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/f0760ef5c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/f0760ef5c42100141fce95f06aba7e85 deleted file mode 100644 index 0307d02..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/f0760ef5c42100141fce95f06aba7e85 +++ /dev/null @@ -1,184 +0,0 @@ -package com.ngb.projectzulu.common.potion.brewingstands; - -import java.util.EnumSet; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockBrewingStand; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import com.ngb.projectzulu.common.core.RenderHelper; -import com.ngb.projectzulu.common.core.RenderHelper.Surface; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; - -public class RenderBrewingStandSingle implements ISimpleBlockRenderingHandler { - - @Override - public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - - } - - @Override - public boolean shouldRender3DInInventory(int modelId) { - return false; - } - - @Override - public int getRenderId() { - return 0; - } - - @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - return render(world, x, y, z, block, modelId, renderer); - } - - public boolean render(IBlockAccess blockAccess, int posX, int posY, int posZ, Block par1Block, int modelId, - RenderBlocks renderer) { - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(blockAccess, posX, posY, posZ)); - float var6 = 1.0F; - int var7 = par1Block.colorMultiplier(blockAccess, posX, posY, posZ); - float var8 = (var7 >> 16 & 255) / 255.0F; - float var9 = (var7 >> 8 & 255) / 255.0F; - float var10 = (var7 & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; - var8 = var11; - var9 = var12; - var10 = var13; - } - tessellator.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); - - TileEntity tileEntity = blockAccess.getTileEntity(posX, posY, posZ); - int potionNumber = 1; - if (tileEntity != null && tileEntity instanceof TileEntityBrewingBase) { - potionNumber = ((TileEntityBrewingBase) tileEntity).brewingItemStacks.length - 1; - } - - IIcon brewingPlateIcon = ((BlockBrewingStand) Blocks.brewing_stand).getIconBrewingStandBase(); - IIcon bowlIcon = renderer.getBlockIconFromSideAndMetadata(Blocks.glass, 2, 0); - IIcon bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.cobblestone, 2, 0); - IIcon legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 2, 0); - IIcon legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.log, 1, 0); - if (potionNumber > 1) { - bowlRing = renderer.getBlockIconFromSideAndMetadata(Blocks.glowstone, 1, 0); - legSkin = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - legBottom = renderer.getBlockIconFromSideAndMetadata(Blocks.nether_brick, 1, 0); - } - - /* Brewing Plates and Pipes */ - for (int i = 0; i < potionNumber; i++) { - switch (i) { - case 0: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 1.0f, renderer, posX, posY, posZ, 0.20f, 0.05f, - 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.38f, posZ, 0.08f, 0.2f, - 0.08f, 0); - break; - case 1: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ + 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ + 0.145, 0.27f, - 0.08f, 0.08f, 0); - break; - case 2: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX, posY, posZ - 0.30f, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.30f, posZ - 0.13f, 0.28f, - 0.08f, 0.08f, 0); - break; - case 3: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX + 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX + 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - case 4: - RenderHelper.renderRotatedRectangle(brewingPlateIcon, 2.0f, renderer, posX - 0.30f, posY, posZ, 0.20f, - 0.05f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX - 0.16, posY + 0.30f, posZ, 0.23f, - 0.08f, 0.08f, 90); - break; - } - } - - /* Glass Bowl */ - // RenderHelper.renderRotatedRectangle(bowlIcon, 1.10f, renderer, posX, posY + 0.52f, posZ, 0.23f, 0.2f, 0.23f, - // 0, - // EnumSet.of(Surface.RIGHT, Surface.LEFT, Surface.FRONT, Surface.BACK, Surface.BOTTOM)); - - /* Stone Ring */ - float ringScale = 2.0f; - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.00f, posY + 0.415f, posZ, 0.3f, - 0.1f, 0.3f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.20f, posY + 0.40f, posZ, 0.19f, - 0.2f, 0.10f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ + 0.20f, 0.10f, - 0.189f, 0.20f, 0); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX, posY + 0.410f, posZ - 0.20f, 0.10f, - 0.189f, 0.20f, 0); - - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, 45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX + 0.14f, posY + 0.405f, posZ + 0.14f, - 0.10f, 0.189f, 0.19f, -45); - RenderHelper.renderRotatedRectangle(bowlRing, ringScale, renderer, posX - 0.14f, posY + 0.405f, posZ - 0.14f, - 0.10f, 0.189f, 0.19f, -45); - - /* Legs */ - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ + 0.13f, 0.10f, - 0.20, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.2f, posZ - 0.13f, 0.10f, - 0.20f, 0.10f, 45); - - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ + 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.13f, posY + 0.01f, posZ - 0.13f, 0.10f, - 0.19f, 0.10f, 45 + 180); - - /* Feet */ - EnumSet plainSides = EnumSet.of(Surface.LEFT); - EnumSet barkSides = EnumSet.allOf(Surface.class); - barkSides.remove(Surface.LEFT); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, barkSides); - RenderHelper.renderRotatedRectangle(legSkin, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, barkSides); - - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, -45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, -45 + 180, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX + 0.23f, posY, posZ + 0.23f, 0.099f, 0.10f, - 0.20f, +45, plainSides); - RenderHelper.renderRotatedRectangle(legBottom, 3.0f, renderer, posX - 0.23f, posY, posZ - 0.23f, 0.099f, 0.10f, - 0.20f, +45 + 180, plainSides); - return true; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/f1db00f8c42100141fce95f06aba7e85 b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/f1db00f8c42100141fce95f06aba7e85 deleted file mode 100644 index 061728a..0000000 --- a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/ff/f1db00f8c42100141fce95f06aba7e85 +++ /dev/null @@ -1,95 +0,0 @@ -package com.ngb.projectzulu.common.world2.blueprints; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; -import net.minecraft.util.ChunkCoordinates; -import com.ngb.projectzulu.common.world.CellIndexDirection; -import com.ngb.projectzulu.common.world.dataobjects.BlockWithMeta; -import com.ngb.projectzulu.common.world.dataobjects.ChestWithMeta; -import com.ngb.projectzulu.common.world2.blueprint.Blueprint; - -public class BlueprintCemeteryTomb implements Blueprint { - - @Override - public BlockWithMeta getBlockFromBlueprint(ChunkCoordinates piecePos, int cellSize, int cellHeight, Random random, - CellIndexDirection cellIndexDirection) { - if (piecePos.posY == 0) { - return new BlockWithMeta(Blocks.grass); - } - - if (piecePos.posY == 1 && piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new ChestWithMeta(Blocks.chest, 1, new TileEntityChest(), 15); - } - - if (cellIndexDirection == CellIndexDirection.NorthMiddle && piecePos.posX == cellSize / 2 && piecePos.posZ == 0) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 3); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 11); - } - } else if (cellIndexDirection == CellIndexDirection.SouthMiddle && piecePos.posX == cellSize / 2 - && piecePos.posZ == cellSize - 1) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 1); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 9); - } - } else if (cellIndexDirection == CellIndexDirection.WestMiddle && piecePos.posX == 0 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 2); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 10); - } - } else if (cellIndexDirection == CellIndexDirection.EastMiddle && piecePos.posX == cellSize - 1 - && piecePos.posZ == cellSize / 2) { - if (piecePos.posY == 1) { - return new BlockWithMeta(Blocks.iron_door, 0); - } else if (piecePos.posY == 2) { - return new BlockWithMeta(Blocks.iron_door, 8); - } - } - - if (piecePos.posY < cellHeight) { - if (piecePos.posY == cellHeight - 1) { - if (piecePos.posX == cellSize / 2 && piecePos.posZ == cellSize / 2) { - return new BlockWithMeta(Blocks.stone_slab, 5); - } - } else if (piecePos.posY % 2 == 1) { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } else { - if (piecePos.posX == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 0 + 4); - } else if (piecePos.posX == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 1 + 4); - } else if (piecePos.posZ == 0) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 2 + 4); - } else if (piecePos.posZ == cellSize - 1) { - return new BlockWithMeta(Blocks.stone_brick_stairs, 3); - } - } - } - return new BlockWithMeta(Blocks.air); - } - - @Override - public int getWeight() { - return 2; - } - - @Override - public String getIdentifier() { - return "cemeterytomb"; - } -} diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location index 8313868..1c045c7 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.location differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap index 91d6c54..0b992ea 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap index 91d6c54..0b992ea 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders/.syncinfo.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/22/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/22/history.index deleted file mode 100644 index c4307a0..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/22/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/63/15/73/b5/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/63/15/73/b5/history.index deleted file mode 100644 index 1b89312..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/63/15/73/b5/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/81/96/a8/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/81/96/a8/history.index deleted file mode 100644 index d73b3d6..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/81/96/a8/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/81/96/d1/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/81/96/d1/history.index deleted file mode 100644 index 7550e4d..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/68/e4/b9/22/81/96/d1/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/40/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/40/cb/history.index deleted file mode 100644 index f33e205..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/40/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/40/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/40/history.index deleted file mode 100644 index 33e8a20..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/40/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/87/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/87/history.index deleted file mode 100644 index 1c8fc24..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/87/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/93/c/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/93/c/history.index deleted file mode 100644 index 69f5cbd..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/93/c/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/93/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/93/history.index deleted file mode 100644 index 9b466bf..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/93/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/b/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/b/history.index deleted file mode 100644 index 1d2214c..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/b/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/e1/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/e1/history.index deleted file mode 100644 index 4cbe28d..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/e1/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/history.index deleted file mode 100644 index ed7aaf7..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/20/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/3/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/3/history.index deleted file mode 100644 index dc294cd..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/3/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/ad/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/ad/history.index deleted file mode 100644 index 6ed97dc..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/ad/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/fe/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/fe/history.index deleted file mode 100644 index 52daff0..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/fe/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/history.index deleted file mode 100644 index cfc8cd2..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/6d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/15/history.index deleted file mode 100644 index b656368..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/1d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/1d/history.index deleted file mode 100644 index 0b7f362..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/1d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/35/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/35/history.index deleted file mode 100644 index ae6c7a0..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/35/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/96/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/96/history.index deleted file mode 100644 index 2248b05..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/96/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/9d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/9d/history.index deleted file mode 100644 index 264933d..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/9d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/b5/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/b5/history.index deleted file mode 100644 index b740a2e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/b5/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/history.index deleted file mode 100644 index 6d41efe..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/73/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/74/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/74/history.index deleted file mode 100644 index 7155947..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/74/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/15/history.index deleted file mode 100644 index e784a1c..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/2/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/2/history.index deleted file mode 100644 index 2ae069b..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/2/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/2a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/2a/history.index deleted file mode 100644 index 4ef7283..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/2a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/6/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/6/history.index deleted file mode 100644 index 2b6c5b5..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/6/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/93/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/93/history.index deleted file mode 100644 index bc1e1b1..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/93/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/cb/history.index deleted file mode 100644 index 36dc287..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/history.index deleted file mode 100644 index 22fadc1..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/7a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/cb/history.index deleted file mode 100644 index eef3770..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/d6/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/d6/history.index deleted file mode 100644 index fcd9608..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/d6/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/history.index deleted file mode 100644 index 6ebe85f..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/92/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/15/history.index deleted file mode 100644 index 1583df8..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/b7/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/b7/history.index deleted file mode 100644 index cdeae46..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/b7/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/cb/history.index deleted file mode 100644 index 397fb11..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/e0/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/e0/history.index deleted file mode 100644 index b968eb0..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/e0/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/history.index deleted file mode 100644 index 6c2fb7d..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/9f/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/15/history.index deleted file mode 100644 index b4121de..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/78/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/78/history.index deleted file mode 100644 index 1a06a92..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/78/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/23/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/23/history.index deleted file mode 100644 index b5d0e81..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/23/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/f4/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/f4/history.index deleted file mode 100644 index f1428ae..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/f4/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/history.index deleted file mode 100644 index 56f7cba..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/98/9a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/e0/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/e0/history.index deleted file mode 100644 index 60112e8..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/e0/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/history.index deleted file mode 100644 index 609847c..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/ba/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/fa/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/fa/history.index deleted file mode 100644 index d116ac9..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/fa/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/history.index deleted file mode 100644 index 87421f7..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/18/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/18/history.index deleted file mode 100644 index 70c191a..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/63/18/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/81/c9/63/15/1a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/81/c9/63/15/1a/history.index deleted file mode 100644 index 8267b36..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/81/c9/63/15/1a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/81/c9/63/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/81/c9/63/15/history.index deleted file mode 100644 index dd94422..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/6e/48/22/81/c9/63/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/22/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/22/history.index deleted file mode 100644 index bc10614..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/22/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/1a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/1a/history.index deleted file mode 100644 index 32ab0ed..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/1a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/73/1d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/73/1d/history.index deleted file mode 100644 index 3a3e62e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/73/1d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/73/b5/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/73/b5/history.index deleted file mode 100644 index 47cd897..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/73/b5/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/ba/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/ba/15/history.index deleted file mode 100644 index 8ecaef2..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/ba/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/history.index deleted file mode 100644 index 7ee25f9..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/63/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/80/ec/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/80/ec/history.index deleted file mode 100644 index 1ab2446..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/80/ec/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/1d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/1d/history.index new file mode 100644 index 0000000..ab4c8d2 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/1d/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/96/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/96/history.index new file mode 100644 index 0000000..b3c1cd1 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/96/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/history.index new file mode 100644 index 0000000..a7571fc Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/73/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/9f/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/9f/history.index new file mode 100644 index 0000000..1a6b418 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/9f/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/history.index new file mode 100644 index 0000000..cd3f009 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/35/63/15/history.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/a8/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/a8/history.index deleted file mode 100644 index 54e60aa..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/a8/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/d1/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/d1/history.index deleted file mode 100644 index 6a57422..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/d1/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/f1/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/f1/history.index deleted file mode 100644 index 47963a4..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/96/f1/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/1a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/1a/history.index deleted file mode 100644 index 085ca75..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/1a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/40/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/40/cb/history.index deleted file mode 100644 index 1b29bad..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/40/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/40/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/40/history.index deleted file mode 100644 index 619fd45..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/40/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/87/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/87/history.index deleted file mode 100644 index fd6c5c9..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/87/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/93/c/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/93/c/history.index deleted file mode 100644 index f46758d..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/93/c/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/93/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/93/history.index deleted file mode 100644 index 300caf1..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/93/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/b/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/b/history.index deleted file mode 100644 index b67e4ff..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/b/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/e1/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/e1/history.index deleted file mode 100644 index 8c4b1cf..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/e1/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/history.index deleted file mode 100644 index 1be3823..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/20/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/3/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/3/history.index deleted file mode 100644 index 11be9a9..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/3/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/ad/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/ad/history.index deleted file mode 100644 index 2fc2aa4..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/ad/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/fe/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/fe/history.index deleted file mode 100644 index e14d91f..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/fe/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/history.index deleted file mode 100644 index b2947d8..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/6d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/15/history.index deleted file mode 100644 index 620461e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/1d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/1d/history.index deleted file mode 100644 index a7f54ed..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/1d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/35/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/35/history.index deleted file mode 100644 index 2850bb0..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/35/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/96/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/96/history.index deleted file mode 100644 index 949111e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/96/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/9d/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/9d/history.index deleted file mode 100644 index 612d231..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/9d/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/b5/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/b5/history.index deleted file mode 100644 index 5fa318e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/b5/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/history.index deleted file mode 100644 index ed8af84..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/73/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/74/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/74/history.index deleted file mode 100644 index a8a8909..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/74/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/15/history.index deleted file mode 100644 index 1a12cf2..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/2/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/2/history.index deleted file mode 100644 index 3be915f..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/2/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/2a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/2a/history.index deleted file mode 100644 index f4c1275..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/2a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/6/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/6/history.index deleted file mode 100644 index d6a1513..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/6/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/93/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/93/history.index deleted file mode 100644 index 7b31379..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/93/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/cb/history.index deleted file mode 100644 index afe1a5c..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/history.index deleted file mode 100644 index 08ef888..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/7a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/cb/history.index deleted file mode 100644 index 6f131f2..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/d6/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/d6/history.index deleted file mode 100644 index f6ec97e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/d6/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/history.index deleted file mode 100644 index b78c6af..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/92/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/15/history.index deleted file mode 100644 index 52ccbdb..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/b7/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/b7/history.index deleted file mode 100644 index 5a0671c..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/b7/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/cb/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/cb/history.index deleted file mode 100644 index 18b6bd1..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/cb/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/e0/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/e0/history.index deleted file mode 100644 index de3adbc..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/e0/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/history.index deleted file mode 100644 index 7a9caf9..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/9f/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/15/history.index deleted file mode 100644 index 0320d97..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/78/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/78/history.index deleted file mode 100644 index c960cc2..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/78/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/23/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/23/history.index deleted file mode 100644 index a6367ee..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/23/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/f4/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/f4/history.index deleted file mode 100644 index e1f547f..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/f4/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/history.index deleted file mode 100644 index b6eab59..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/98/9a/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/e0/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/e0/history.index deleted file mode 100644 index 592db4e..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/e0/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/history.index deleted file mode 100644 index b0ba323..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/ba/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/history.index deleted file mode 100644 index 22f4828..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/15/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/18/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/18/history.index deleted file mode 100644 index db7d258..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/81/c9/63/18/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/f8/history.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/f8/history.index deleted file mode 100644 index c4911cc..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.indexes/e4/b9/22/f8/history.index and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location index e69de29..11370be 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.location differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers index 779454c..26c1ffd 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap index 91d6c54..17c64fc 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap index 91d6c54..0b992ea 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/Minecraft/.syncinfo.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap index 91d6c54..0b992ea 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap index 91d6c54..0b992ea 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index index 322708a..7412428 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap index 91d6c54..0b992ea 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree deleted file mode 100644 index 897e2b8..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/0.tree and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree new file mode 100644 index 0000000..32f6184 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/1.tree differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/25.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/25.tree deleted file mode 100644 index 89cfdc0..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/25.tree and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/8.tree b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/8.tree new file mode 100644 index 0000000..8e33b02 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.root/8.tree differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index 7575bd4..7e45a07 100644 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/.snap deleted file mode 100644 index d03e846..0000000 Binary files a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.snap and /dev/null differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/1.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/1.snap new file mode 100644 index 0000000..2874ea2 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/1.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/8.snap b/eclipse/.metadata/.plugins/org.eclipse.core.resources/8.snap new file mode 100644 index 0000000..75f6035 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.core.resources/8.snap differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs index 94c5676..af02aa3 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.debug.ui.prefs @@ -1,7 +1,7 @@ -#Sun Jun 05 19:03:53 CEST 2011 -eclipse.preferences.version=1 -org.eclipse.debug.ui.UseContextualLaunch=false Console.highWaterMark=88000 +StringVariablePreferencePage=130,107,107,86, +eclipse.preferences.version=1 org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=\r\n\r\n +org.eclipse.debug.ui.UseContextualLaunch=false org.eclipse.debug.ui.user_view_bindings=\r\n\r\n\r\n\r\n\r\n\r\n -StringVariablePreferencePage=130,107,107,86, +preferredTargets=default\:default| diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs index 12ec368..d4a2907 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -1,14 +1,14 @@ -#Sun Sep 18 16:44:39 NZST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.visibilityCheck=enabled +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore org.eclipse.jdt.core.compiler.problem.deprecation=ignore -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore -org.eclipse.jdt.core.compiler.problem.unusedImport=ignore -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.unusedImport=ignore +org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.source=1.6 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..719c5ce --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_VM_XML=\r\n\r\n\r\n\r\n\r\n\r\n diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..52cfa51 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,19 @@ +content_assist_disabled_computers=org.eclipse.jdt.ui.textProposalCategory\u0000org.eclipse.jdt.ui.javaAllProposalCategory\u0000org.eclipse.jdt.ui.javaTypeProposalCategory\u0000org.eclipse.jdt.ui.javaNoTypeProposalCategory\u0000 +content_assist_lru_history= +content_assist_number_of_computers=21 +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +fontPropagated=true +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.ui.editor.tab.width= +org.eclipse.jdt.ui.formatterprofiles.version=12 +org.eclipse.jdt.ui.javadoclocations.migrated=true +org.eclipse.jdt.ui.text.custom_templates= +org.eclipse.jdt.ui.text.templates_migrated=true +org.eclipse.jface.textfont=1|Courier New|10.0|0|WINDOWS|1|0|0|0|0|0|0|0|0|1|0|0|0|0|Courier New; +proposalOrderMigrated=true +spelling_locale_initialized=true +tabWidthPropagated=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs new file mode 100644 index 0000000..553bb96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.j2ee.webservice.ui.prefs @@ -0,0 +1,2 @@ +areThereWebServices=false +eclipse.preferences.version=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs new file mode 100644 index 0000000..67b1d96 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.m2e.discovery.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.m2e.discovery.pref.projects= diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs new file mode 100644 index 0000000..43e97e4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.context.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +mylyn.attention.migrated=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs new file mode 100644 index 0000000..2a6fe50 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.java.ui.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.java.ui.run.count.3_10_0=1 +org.eclipse.mylyn.java.ui.run.count.3_1_0=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs new file mode 100644 index 0000000..8d462a6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.monitor.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.mylyn.monitor.activity.tracking.enabled.checked=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs new file mode 100644 index 0000000..5330e43 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.mylyn.tasks.ui.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +migrated.task.repositories.secure.store=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching=true +org.eclipse.mylyn.tasks.ui.filters.nonmatching.encouraged=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs new file mode 100644 index 0000000..d2ed603 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.pde.api.tools.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +knownEEFragments= diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs new file mode 100644 index 0000000..084a4fe --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.rse.systemtype.local.systemType.defaultUserId=BELFAM_ADMIN +useridperkey=belfam_laptop1.Local\=BELFAM_ADMIN; diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs new file mode 100644 index 0000000..dc78d0a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.rse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.rse.preferences.order.connections=belfam_laptop1.Local diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs new file mode 100644 index 0000000..cec65c4 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.search.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.search.defaultPerspective=org.eclipse.search.defaultPerspective.none diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs new file mode 100644 index 0000000..f9e585b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.cvs.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +pref_first_startup=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs new file mode 100644 index 0000000..56cd496 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.team.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.team.ui.first_time=false diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs index ae368ab..39f3d42 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -1,9 +1,8 @@ -#Sun Jun 05 18:58:07 CEST 2011 IMPORT_FILES_AND_FOLDERS_MODE=prompt IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt +PROBLEMS_FILTERS_MIGRATE=true SAVE_ALL_BEFORE_BUILD=true eclipse.preferences.version=1 -tipsAndTricks=true -platformState=1287081747687 +platformState=1407631824496 quickStart=false -PROBLEMS_FILTERS_MIGRATE=true +tipsAndTricks=true diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..ccd7360 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,4 @@ +//org.eclipse.ui.commands/state/org.eclipse.wst.xml.views.XPathView.processor.xpathprocessor/org.eclipse.ui.commands.radioState=xpath10 +ENABLED_DECORATORS=org.eclipse.jst.ws.jaxws.dom.integration.navigator.WebServiceDecorator\:true,org.eclipse.m2e.core.mavenVersionDecorator\:false,org.eclipse.wst.server.ui.decorator\:false,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.DependencyDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.ColumnDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.ForeignKeyDecoration\:true,org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.IndexTriggerDecoration\:true,org.eclipse.datatools.connectivity.internal.core.ui.bookmarkDecoration\:true,org.eclipse.datatools.connectivity.internal.core.ui.FilterNodeDecoration\:true,org.eclipse.datatools.connectivity.ui.decorator.contentextension\:false,org.eclipse.datatools.enablement.ingres.ui.providers.decorators.SynonymDecorationService\:true,org.eclipse.datatools.enablement.ingres.internal.ui.providers.decorators.ParameterDecorationService\:true,org.eclipse.datatools.enablement.sybase.asa.proxytabledecorator\:true,org.eclipse.datatools.enablement.sybase.ase.webservicetabledecorator\:true,org.eclipse.datatools.enablement.sybase.systemtabledecorator\:true,org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator\:true,org.eclipse.jdt.ui.override.decorator\:true,org.eclipse.jdt.ui.interface.decorator\:false,org.eclipse.jdt.ui.buildpath.decorator\:true,org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator_ejb\:true,org.eclipse.jst.j2ee.navigator.internal.J2EEProjectDecorator\:true,org.eclipse.jst.jee.ui.internal.navigator.ejb.BeanDecorator\:true,org.eclipse.jst.jee.navigator.internal.JEEProjectDecorator\:true,org.eclipse.jst.j2ee.internal.ui.util.AnnotationIconDecorator_servlet\:true,org.eclipse.m2e.core.maven2decorator\:true,org.eclipse.mylyn.context.ui.decorator.interest\:true,org.eclipse.mylyn.tasks.ui.decorators.task\:true,org.eclipse.mylyn.team.ui.changeset.decorator\:true,org.eclipse.pde.ui.binaryProjectDecorator\:false,org.eclipse.rse.core.virtualobject.decorator\:true,org.eclipse.rse.core.binary.executable.decorator\:true,org.eclipse.rse.core.script.executable.decorator\:true,org.eclipse.rse.core.java.executable.decorator\:true,org.eclipse.rse.core.library.decorator\:true,org.eclipse.rse.core.link.decorator\:true,org.eclipse.rse.subsystems.error.decorator\:true,org.eclipse.team.cvs.ui.decorator\:true,org.eclipse.ui.LinkedResourceDecorator\:true,org.eclipse.ui.SymlinkDecorator\:true,org.eclipse.ui.VirtualResourceDecorator\:true,org.eclipse.ui.ContentTypeDecorator\:true,org.eclipse.ui.ResourceFilterDecorator\:false,org.eclipse.wst.jsdt.ui.override.decorator\:true,org.eclipse.wst.server.ui.navigatorDecorator\:true, +PLUGINS_NOT_ACTIVATED_ON_STARTUP=org.eclipse.m2e.discovery; +eclipse.preferences.version=1 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs new file mode 100644 index 0000000..6696959 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.ws.service.policy.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsiap.defaultProtocol=http\://schemas.xmlsoap.org/wsdl/soap/ +org.eclipse.wst.ws.service.policy.ui.servicepols.wsiprofilecomp.wsissbp.defaultProtocol=http\://schemas.xmlsoap.org/wsdl/soap/ diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml new file mode 100644 index 0000000..364579b --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/dialog_settings.xml @@ -0,0 +1,8 @@ + +

+
+ + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml index 1208f60..4f31d87 100644 --- a/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml +++ b/eclipse/.metadata/.plugins/org.eclipse.debug.ui/launchConfigurationHistory.xml @@ -1,18 +1,18 @@ - - + + + + + - - - - - + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..ef09ec0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,2676 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + ModelMigrationProcessor.001 + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.rse.core.search.searchActionSet + persp.actionSet:org.eclipse.search.searchActionSet + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.mylyn.doc.actionSet + persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation + persp.actionSet:org.eclipse.ui.cheatsheets.actionSet + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.jst.j2ee.J2eeMainActionSet + persp.actionSet:org.eclipse.jdt.ui.JavaActionSet + persp.actionSet:org.eclipse.debug.ui.launchActionSet + persp.actionSet:org.eclipse.debug.ui.debugActionSet + persp.actionSet:org.eclipse.ui.NavigateActionSet + persp.viewSC:org.eclipse.ui.navigator.ProjectExplorer + persp.viewSC:org.eclipse.wst.server.ui.ServersView + persp.viewSC:org.eclipse.datatools.connectivity.DataSourceExplorerNavigator + persp.viewSC:org.eclipse.ui.views.BookmarkView + persp.viewSC:org.eclipse.ui.views.ContentOutline + persp.viewSC:org.eclipse.ui.views.PropertySheet + persp.viewSC:org.eclipse.ui.views.ResourceNavigator + persp.viewSC:org.eclipse.wst.common.snippets.internal.ui.SnippetsView + persp.viewSC:org.eclipse.ui.views.AllMarkersView + persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks + persp.viewSC:org.eclipse.search.ui.views.SearchView + persp.viewSC:org.eclipse.ui.console.ConsoleView + persp.showIn:org.eclipse.ui.navigator.ProjectExplorer + persp.newWizSC:org.eclipse.jpt.jpa.ui.wizard.newJpaProject + persp.perspSC:org.eclipse.jpt.ui.jpaPerspective + persp.perspSC:org.eclipse.debug.ui.DebugPerspective + persp.perspSC:org.eclipse.jdt.ui.JavaPerspective + persp.perspSC:org.eclipse.ui.resourcePerspective + persp.perspSC:org.eclipse.wst.web.ui.webDevPerspective + persp.newWizSC:org.eclipse.jst.j2ee.ui.project.facet.EarProjectWizard + persp.newWizSC:org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard + persp.newWizSC:org.eclipse.jst.ejb.ui.project.facet.EjbProjectWizard + persp.newWizSC:org.eclipse.jst.j2ee.jca.ui.internal.wizard.ConnectorProjectWizard + persp.newWizSC:org.eclipse.jst.j2ee.ui.project.facet.appclient.AppClientProjectWizard + persp.newWizSC:org.eclipse.wst.web.ui.internal.wizards.SimpleWebProjectWizard + persp.newWizSC:org.eclipse.jpt.ui.wizard.newJpaProject + persp.newWizSC:org.eclipse.jst.servlet.ui.internal.wizard.AddServletWizard + persp.newWizSC:org.eclipse.jst.ejb.ui.internal.wizard.AddSessionBeanWizard + persp.newWizSC:org.eclipse.jst.ejb.ui.internal.wizard.AddMessageDrivenBeanWizard + persp.newWizSC:org.eclipse.jpt.ui.wizard.newEntity + persp.newWizSC:org.eclipse.jst.ws.creation.ui.wizard.serverwizard + persp.newWizSC:org.eclipse.ui.wizards.new.folder + persp.newWizSC:org.eclipse.ui.wizards.new.file + persp.actionSet:org.eclipse.wst.server.ui.internal.webbrowser.actionSet + persp.actionSet:org.eclipse.debug.ui.breakpointActionSet + persp.newWizSC:org.eclipse.m2e.core.wizards.Maven2ProjectWizard + persp.actionSet:org.eclipse.wst.ws.explorer.explorer + + + newtablook + + + + + + + + + + newtablook + Minimized + + + + + + newtablook + Minimized + noFocus + active + + + + + + + + + + + + + + + + + + + + + + + + View + categoryTag:Help + + + View + categoryTag:Help + + + View + categoryTag:General + + + + newtablook + org.eclipse.e4.primaryDataStack + EditorStack + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu + + + + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java Browsing + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:General + + + View + categoryTag:Server + + + View + categoryTag:Data Management + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + + View + categoryTag:General + active + + ViewMenu + menuContribution:menu + + + menuContribution:popup + popup:org.eclipse.debug.ui.ProcessConsoleType.#ContextMenu + + + + + View + categoryTag:General + + + View + categoryTag:General + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + View + categoryTag:Mylyn + + + + toolbarSeparator + + + + Draggable + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + + toolbarSeparator + + + + Draggable + + + Draggable + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + + Draggable + + Opaque + + + Opaque + + + Opaque + + + + Draggable + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + + Draggable + + Opaque + + + Opaque + + + + Draggable + + Opaque + + + Opaque + + + + toolbarSeparator + + + + Draggable + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + Opaque + + + + Opaque + + + Opaque + + + Opaque + + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + Opaque + + + Opaque + + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + + TrimStack + MinimizedAndShowing + + + TrimStack + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + + + View + categoryTag:Ant + + + View + categoryTag:Data Management + + + View + categoryTag:Data Management + + + View + categoryTag:Data Management + + + View + categoryTag:Help + + + View + categoryTag:Debug + + + View + categoryTag:Java + + + View + categoryTag:JPA + + + View + categoryTag:JPA + + + View + categoryTag:JavaServer Faces + + + View + categoryTag:JavaServer Faces + + + View + categoryTag:Web Services + + + View + categoryTag:Maven + + + View + categoryTag:Maven + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:Remote Systems + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:CVS + + + View + categoryTag:CVS + + + View + categoryTag:Team + + + View + categoryTag:Team + + + View + categoryTag:Terminal + + + View + categoryTag:General + + + View + categoryTag:Help + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:Debug + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:JavaScript + + + View + categoryTag:Server + + + View + categoryTag:XML + + + View + categoryTag:XML + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Debug + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:Git + + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java Browsing + + + View + categoryTag:Java + + + View + categoryTag:General + + + View + categoryTag:Java + + + View + categoryTag:Java + + + View + categoryTag:Mylyn + + + View + categoryTag:Mylyn + + + View + categoryTag:Mylyn + + + View + categoryTag:API Tools + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Plug-in Development + + + View + categoryTag:Plug-in Development + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:General + + + View + categoryTag:XML + + + View + categoryTag:XML + + + View + categoryTag:XML + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project new file mode 100644 index 0000000..b7eac3d --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project @@ -0,0 +1,18 @@ + + + .org.eclipse.jdt.core.external.folders + + + + + + + + + + .link0 + 2 + C:/Users/BELFAM_ADMIN/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.2.1291/start + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1052857711.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1052857711.index new file mode 100644 index 0000000..7054274 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1052857711.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1098371184.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1098371184.index new file mode 100644 index 0000000..8856652 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1098371184.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1101424302.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1101424302.index new file mode 100644 index 0000000..f9fe97b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1101424302.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118309519.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118309519.index new file mode 100644 index 0000000..70b45fb Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/118309519.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1221077128.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1221077128.index new file mode 100644 index 0000000..b94c51c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1221077128.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1244022644.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1244022644.index new file mode 100644 index 0000000..7f92335 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1244022644.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1369127545.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1369127545.index new file mode 100644 index 0000000..ae60b8c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1369127545.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/152417710.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/152417710.index new file mode 100644 index 0000000..cebefcf Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/152417710.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1538849528.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1538849528.index new file mode 100644 index 0000000..1b612ed Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1538849528.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1611401267.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1611401267.index new file mode 100644 index 0000000..289e683 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1611401267.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1645669158.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1645669158.index new file mode 100644 index 0000000..789d99b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1645669158.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1684446089.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1684446089.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1684446089.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1691994056.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1691994056.index new file mode 100644 index 0000000..8ac64af Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1691994056.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1700302528.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1700302528.index new file mode 100644 index 0000000..8b9949f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1700302528.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1751657460.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1751657460.index new file mode 100644 index 0000000..d46b1a0 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1751657460.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1821145857.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1821145857.index new file mode 100644 index 0000000..288b556 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1821145857.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/182735413.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/182735413.index new file mode 100644 index 0000000..edc091f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/182735413.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1956400885.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1956400885.index new file mode 100644 index 0000000..d874bc1 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/1956400885.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2010491873.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2010491873.index new file mode 100644 index 0000000..9a41285 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2010491873.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2060131720.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2060131720.index new file mode 100644 index 0000000..2e34903 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2060131720.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2097454686.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2097454686.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2097454686.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2161353423.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2161353423.index new file mode 100644 index 0000000..e832290 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2161353423.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/238188904.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/238188904.index new file mode 100644 index 0000000..aa097df Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/238188904.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2386222545.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2386222545.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2386222545.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2389961009.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2389961009.index new file mode 100644 index 0000000..e3345ba Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2389961009.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2394657268.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2394657268.index new file mode 100644 index 0000000..00dc82d Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2394657268.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2450825834.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2450825834.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2450825834.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2457829919.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2457829919.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2457829919.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2497256829.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2497256829.index new file mode 100644 index 0000000..dbbdd6e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2497256829.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2503134553.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2503134553.index new file mode 100644 index 0000000..64b0e4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2503134553.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2506227017.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2506227017.index new file mode 100644 index 0000000..be6850a Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2506227017.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2516313630.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2516313630.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2516313630.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2519713.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2519713.index new file mode 100644 index 0000000..c3f5130 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2519713.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2573849602.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2573849602.index new file mode 100644 index 0000000..274baa3 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2573849602.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2705315894.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2705315894.index new file mode 100644 index 0000000..59d0a63 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2705315894.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/270724262.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/270724262.index new file mode 100644 index 0000000..5f272cd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/270724262.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2708055714.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2708055714.index new file mode 100644 index 0000000..7ba0980 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2708055714.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2718416753.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2718416753.index new file mode 100644 index 0000000..e41a79b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2718416753.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index new file mode 100644 index 0000000..1b0aa45 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/286606776.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2906365617.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2906365617.index new file mode 100644 index 0000000..264b1f1 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2906365617.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2943934462.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2943934462.index new file mode 100644 index 0000000..ec56b16 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2943934462.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2954190136.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2954190136.index new file mode 100644 index 0000000..37332fd Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/2954190136.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3012441036.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3012441036.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3012441036.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016090828.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016090828.index new file mode 100644 index 0000000..bb72e39 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016090828.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016371023.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016371023.index new file mode 100644 index 0000000..cd533e4 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3016371023.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3051738776.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3051738776.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3051738776.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3063041929.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3063041929.index new file mode 100644 index 0000000..ae69821 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3063041929.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3162266258.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3162266258.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3162266258.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3167461448.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3167461448.index new file mode 100644 index 0000000..d3d7c56 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3167461448.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3224974857.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3224974857.index new file mode 100644 index 0000000..2228d29 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3224974857.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3384726767.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3384726767.index new file mode 100644 index 0000000..42aa99a Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3384726767.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3414163197.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3414163197.index new file mode 100644 index 0000000..590de9f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3414163197.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3468416279.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3468416279.index new file mode 100644 index 0000000..54581b2 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3468416279.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3549880408.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3549880408.index new file mode 100644 index 0000000..74ec028 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3549880408.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3586105114.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3586105114.index new file mode 100644 index 0000000..a6c1a61 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3586105114.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3622643147.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3622643147.index new file mode 100644 index 0000000..723831e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3622643147.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3708397438.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3708397438.index new file mode 100644 index 0000000..ce07e54 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3708397438.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3716563934.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3716563934.index new file mode 100644 index 0000000..feedfda Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3716563934.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3784454021.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3784454021.index new file mode 100644 index 0000000..fffb696 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3784454021.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3816558584.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3816558584.index new file mode 100644 index 0000000..d1cd323 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3816558584.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3826651658.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3826651658.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3826651658.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3829748403.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3829748403.index new file mode 100644 index 0000000..6db835e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3829748403.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926188048.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926188048.index new file mode 100644 index 0000000..e3f9ce0 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/3926188048.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4058166084.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4058166084.index new file mode 100644 index 0000000..e84ad75 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4058166084.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4097989794.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4097989794.index new file mode 100644 index 0000000..c51c3b3 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4097989794.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4162861437.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4162861437.index new file mode 100644 index 0000000..43f0504 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4162861437.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4183445374.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4183445374.index new file mode 100644 index 0000000..b5247b8 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4183445374.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4204397735.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4204397735.index new file mode 100644 index 0000000..f630b23 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4204397735.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4223854747.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4223854747.index new file mode 100644 index 0000000..70b45fb Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4223854747.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index new file mode 100644 index 0000000..3dcdd55 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/4257325822.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/539610362.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/539610362.index new file mode 100644 index 0000000..e556c2f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/539610362.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/648820999.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/648820999.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/648820999.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/730660110.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/730660110.index new file mode 100644 index 0000000..8c6da66 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/730660110.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/735681076.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/735681076.index new file mode 100644 index 0000000..600cff6 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/735681076.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/836682720.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/836682720.index new file mode 100644 index 0000000..0ab3d4b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/836682720.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/859056245.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/859056245.index new file mode 100644 index 0000000..8688337 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/859056245.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/904470838.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/904470838.index new file mode 100644 index 0000000..0959ff0 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/904470838.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/973982085.index b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/973982085.index new file mode 100644 index 0000000..723831e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/973982085.index differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/assumedExternalFilesCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache new file mode 100644 index 0000000..507d009 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalFilesCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..34f9719 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt new file mode 100644 index 0000000..32e47ed --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/indexNamesMap.txt @@ -0,0 +1 @@ +INDEX VERSION 1.127 diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache new file mode 100644 index 0000000..593f470 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/invalidArchivesCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache new file mode 100644 index 0000000..d544ade Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/nonChainingJarsCache differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt new file mode 100644 index 0000000..edb26dc --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -0,0 +1,79 @@ +INDEX VERSION 1.127+E:\forge-1.7.10-10.13.2.1291\eclipse\.metadata\.plugins\org.eclipse.jdt.core +152417710.index +238188904.index +2097454686.index +3829748403.index +4223854747.index +1751657460.index +2708055714.index +3826651658.index +2954190136.index +3063041929.index +3549880408.index +1098371184.index +2394657268.index +3224974857.index +1538849528.index +2906365617.index +3414163197.index +2718416753.index +3384726767.index +735681076.index +4257325822.index +1684446089.index +904470838.index +270724262.index +3051738776.index +286606776.index +3468416279.index +1956400885.index +3622643147.index +4204397735.index +2060131720.index +539610362.index +2943934462.index +2161353423.index +4162861437.index +3167461448.index +4183445374.index +1611401267.index +1221077128.index +1700302528.index +3586105114.index +182735413.index +3162266258.index +3012441036.index +1101424302.index +3016090828.index +2573849602.index +3816558584.index +2457829919.index +2386222545.index +1369127545.index +3784454021.index +1244022644.index +730660110.index +4097989794.index +973982085.index +836682720.index +4058166084.index +118309519.index +3708397438.index +2705315894.index +1821145857.index +648820999.index +2503134553.index +1691994056.index +3016371023.index +2497256829.index +1645669158.index +2506227017.index +2519713.index +2516313630.index +2010491873.index +2450825834.index +3716563934.index +2389961009.index +859056245.index +1052857711.index +3926188048.index diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..5ca492b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml new file mode 100644 index 0000000..6dd51b9 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml @@ -0,0 +1,4 @@ + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml new file mode 100644 index 0000000..bbea2c5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..9e390f5 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml new file mode 100644 index 0000000..14fcee7 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/dialog_settings.xml @@ -0,0 +1,13 @@ + +
+ +
+
+
+ +
+
+
+
+
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png new file mode 100644 index 0000000..a6abcd8 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/0.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png new file mode 100644 index 0000000..a930fe1 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/1.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/10.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/10.png new file mode 100644 index 0000000..a95f608 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/10.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/11.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/11.png new file mode 100644 index 0000000..3629023 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/11.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/12.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/12.png new file mode 100644 index 0000000..56554ec Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/12.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/13.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/13.png new file mode 100644 index 0000000..33b93a3 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/13.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/14.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/14.png new file mode 100644 index 0000000..476665e Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/14.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/15.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/15.png new file mode 100644 index 0000000..834bd74 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/15.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png new file mode 100644 index 0000000..9abe3c5 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/2.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png new file mode 100644 index 0000000..0d5567b Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/3.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png new file mode 100644 index 0000000..d198a93 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/4.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png new file mode 100644 index 0000000..9258421 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/5.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png new file mode 100644 index 0000000..2856a9f Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/6.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/7.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/7.png new file mode 100644 index 0000000..31311ab Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/7.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/8.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/8.png new file mode 100644 index 0000000..c5df4a4 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/8.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/9.png b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/9.png new file mode 100644 index 0000000..38192cf Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.jdt.ui/jdt-images/9.png differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/f0228c0af52000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log similarity index 100% rename from eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/1c/f0228c0af52000141769cb1ed0c338cd rename to eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/0.log diff --git a/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml new file mode 100644 index 0000000..e33758c --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.m2e.logback.configuration/logback.1.5.0.20140606-0033.xml @@ -0,0 +1,43 @@ + + + + %date [%thread] %-5level %logger{35} - %msg%n + + + OFF + + + + + ${org.eclipse.m2e.log.dir}/0.log + + ${org.eclipse.m2e.log.dir}/%i.log + 1 + 10 + + + 100MB + + + %date [%thread] %-5level %logger{35} - %msg%n + + + + + + WARN + + + + + + + + + + + + + + + diff --git a/eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties b/eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties new file mode 100644 index 0000000..33108c0 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.pde.core/.cache/clean-cache.properties @@ -0,0 +1,2 @@ +#Cached timestamps +#Thu Feb 05 11:56:20 EST 2015 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/70e7c734f52000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.rse.core/.log similarity index 100% rename from eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/2c/70e7c734f52000141769cb1ed0c338cd rename to eclipse/.metadata/.plugins/org.eclipse.rse.core/.log diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/c0c73746f32000141769cb1ed0c338cd b/eclipse/.metadata/.plugins/org.eclipse.rse.core/initializerMarks/org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark similarity index 100% rename from eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/56/c0c73746f32000141769cb1ed0c338cd rename to eclipse/.metadata/.plugins/org.eclipse.rse.core/initializerMarks/org.eclipse.rse.internal.core.RSELocalConnectionInitializer.mark diff --git a/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/FP.local.files_0/node.properties b/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/FP.local.files_0/node.properties new file mode 100644 index 0000000..e678760 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/FP.local.files_0/node.properties @@ -0,0 +1,57 @@ +# RSE DOM Node +00-name=belfam_laptop1\:local.files +01-type=FilterPool +03-attr.default=true +03-attr.deletable=true +03-attr.id=local.files +03-attr.nonRenamable=false +03-attr.owningParentName=null +03-attr.release=200 +03-attr.singleFilterStringOnly=false +03-attr.singleFilterStringOnlyESet=false +03-attr.stringsCaseSensitive=true +03-attr.supportsDuplicateFilterStrings=false +03-attr.supportsNestedFilters=true +03-attr.type=default +06-child.00000.00-name=My Home +06-child.00000.01-type=Filter +06-child.00000.03-attr.default=false +06-child.00000.03-attr.filterType=default +06-child.00000.03-attr.id=My Home +06-child.00000.03-attr.nonChangable=false +06-child.00000.03-attr.nonDeletable=false +06-child.00000.03-attr.nonRenamable=false +06-child.00000.03-attr.promptable=false +06-child.00000.03-attr.relativeOrder=0 +06-child.00000.03-attr.release=200 +06-child.00000.03-attr.singleFilterStringOnly=false +06-child.00000.03-attr.stringsCaseSensitive=false +06-child.00000.03-attr.stringsNonChangable=false +06-child.00000.03-attr.supportsDuplicateFilterStrings=false +06-child.00000.03-attr.supportsNestedFilters=true +06-child.00000.06-child.00000.00-name=C\:\\Users\\BELFAM_ADMIN\\* +06-child.00000.06-child.00000.01-type=FilterString +06-child.00000.06-child.00000.03-attr.default=false +06-child.00000.06-child.00000.03-attr.string=C\:\\Users\\BELFAM_ADMIN\\* +06-child.00000.06-child.00000.03-attr.type=default +06-child.00001.00-name=Drives +06-child.00001.01-type=Filter +06-child.00001.03-attr.default=false +06-child.00001.03-attr.filterType=default +06-child.00001.03-attr.id=Drives +06-child.00001.03-attr.nonChangable=false +06-child.00001.03-attr.nonDeletable=false +06-child.00001.03-attr.nonRenamable=false +06-child.00001.03-attr.promptable=false +06-child.00001.03-attr.relativeOrder=0 +06-child.00001.03-attr.release=200 +06-child.00001.03-attr.singleFilterStringOnly=false +06-child.00001.03-attr.stringsCaseSensitive=false +06-child.00001.03-attr.stringsNonChangable=false +06-child.00001.03-attr.supportsDuplicateFilterStrings=false +06-child.00001.03-attr.supportsNestedFilters=true +06-child.00001.06-child.00000.00-name=* +06-child.00001.06-child.00000.01-type=FilterString +06-child.00001.06-child.00000.03-attr.default=false +06-child.00001.06-child.00000.03-attr.string=* +06-child.00001.06-child.00000.03-attr.type=default diff --git a/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/H.local_16/node.properties b/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/H.local_16/node.properties new file mode 100644 index 0000000..1307c4a --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/H.local_16/node.properties @@ -0,0 +1,25 @@ +# RSE DOM Node +00-name=Local +01-type=Host +03-attr.description= +03-attr.hostname=LOCALHOST +03-attr.offline=false +03-attr.promptable=false +03-attr.systemType=org.eclipse.rse.systemtype.local +03-attr.type=Local +06-child.00000.00-name=Local Connector Service +06-child.00000.01-type=ConnectorService +06-child.00000.03-attr.group=Local Connector Service +06-child.00000.03-attr.port=0 +06-child.00000.03-attr.useSSL=false +06-child.00000.06-child.00000.00-name=Local Files +06-child.00000.06-child.00000.01-type=SubSystem +06-child.00000.06-child.00000.03-attr.hidden=false +06-child.00000.06-child.00000.03-attr.type=local.files +06-child.00000.06-child.00000.06-child.00000.00-name=belfam_laptop1___belfam_laptop1\:local.files +06-child.00000.06-child.00000.06-child.00000.01-type=FilterPoolReference +06-child.00000.06-child.00000.06-child.00000.03-attr.refID=local.files +06-child.00000.06-child.00001.00-name=Local Shells +06-child.00000.06-child.00001.01-type=SubSystem +06-child.00000.06-child.00001.03-attr.hidden=false +06-child.00000.06-child.00001.03-attr.type=local.shells diff --git a/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/node.properties b/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/node.properties new file mode 100644 index 0000000..478bcf8 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.rse.core/profiles/PRF.belfam_laptop1_0/node.properties @@ -0,0 +1,7 @@ +# RSE DOM Node +00-name=belfam_laptop1 +01-type=Profile +03-attr.defaultPrivate=true +03-attr.isActive=true +05-ref.00000=FP.local.files_0 +05-ref.00001=H.local_16 diff --git a/eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/10567ffd2f2000141dbfc2e92eb0e949 b/eclipse/.metadata/.plugins/org.eclipse.rse.ui/.log similarity index 100% rename from eclipse/.metadata/.plugins/org.eclipse.core.resources/.history/b1/10567ffd2f2000141dbfc2e92eb0e949 rename to eclipse/.metadata/.plugins/org.eclipse.rse.ui/.log diff --git a/eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml new file mode 100644 index 0000000..a4ad640 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.search/dialog_settings.xml @@ -0,0 +1,115 @@ + +
+
+ +
+
+ +
+
+ +
+
+ + + + + +
+ + + + + + + + + + +
+
+ +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.team.cvs.core/.running b/eclipse/.metadata/.plugins/org.eclipse.team.cvs.core/.running new file mode 100644 index 0000000..e69de29 diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml new file mode 100644 index 0000000..177d3df --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/dialog_settings.xml @@ -0,0 +1,15 @@ + +
+
+ + + + + + + + + + +
+
diff --git a/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..fa28ed2 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..de18300 Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/externalLibsTimeStamps differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js new file mode 100644 index 0000000..2fc99ea --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/baseBrowserLibrary.js @@ -0,0 +1,5393 @@ +/******************************************************************************* + * Copyright (c) 2008, 2013 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +/** + * Object DOMException() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function DOMException(){}; +DOMException.prototype = new Object(); +/** + * Constant DOMException.INDEX_SIZE_ERR=1 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INDEX_SIZE_ERR=1; +/** + * Constant DOMException.DOMSTRING_SIZE_ERR=2 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.DOMSTRING_SIZE_ERR=2; +/** + * Constant DOMException.HIERARCHY_REQUEST_ERR=3 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.HIERARCHY_REQUEST_ERR=3; +/** + * Constant DOMException.WRONG_DOCUMENT_ERR=4 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.WRONG_DOCUMENT_ERR=4; +/** + * Constant DOMException.INVALID_CHARACTER_ERR=5 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_CHARACTER_ERR=5; +/** + * Constant DOMException.NO_DATA_ALLOWED_ER=6 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NO_DATA_ALLOWED_ER=6; +/** + * Constant DOMException.NO_MODIFICATION_ALLOWED_ERR=7 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NO_MODIFICATION_ALLOWED_ERR=7; +/** + * Constant DOMException.NOT_FOUND_ERR=8 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NOT_FOUND_ERR=8; +/** + * Constant DOMException.NOT_SUPPORTED_ERR=9 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NOT_SUPPORTED_ERR=9; +/** + * Constant DOMException.INUSE_ATTRIBUTE_ERR=10 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INUSE_ATTRIBUTE_ERR=10; +/** + * Constant DOMException.INVALID_STATE_ERR=11 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_STATE_ERR=11; +/** + * Constant DOMException.SYNTAX_ERR=12 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.SYNTAX_ERR=12; +/** + * Constant DOMException.INVALID_MODIFICATION_ER=13 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_MODIFICATION_ER=13; +/** + * Constant DOMException.NAMESPACE_ERR=14 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.NAMESPACE_ERR=14; +/** + * Constant DOMException.NVALID_ACCESS_ERR=15 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.INVALID_ACCESS_ERR=15; +/** + * Property code + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMException.prototype.code=0; + +/** + * Object DOMImplementation() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function DOMImplementation(){}; +DOMImplementation.prototype = new Object(); +/** + * function hasFeature(feature, version) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DOMImplementation.prototype.hasFeature = function(feature, version){return false;}; +/** + * function createDocumentType(qualifiedName, publicId, systemId) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} qualifiedName + * @param {String} publicId + * @param {String} systemId + * @returns {DocumentType} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentType + */ +DOMImplementation.prototype.createDocumentType = function(qualifiedName, publicId, systemId){return new DocumentType();}; +/** + * function createDocument(namespaceURI, qualifiedName, doctype) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {DocumentType} doctype + * @returns {Document} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Document + */ +DOMImplementation.prototype.createDocument = function(namespaceURI, qualifiedName, doctype){return new HTMLDocument();}; + +/** + * Object DocumentFragment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function DocumentFragment(){}; +DocumentFragment.prototype=new Node(); + +/** + * Object Document() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Document(){}; +Document.prototype = new Node(); +/** + * Property defaultView + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Window + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Window + */ +Document.prototype.defaultView = new Window(); +/** + * Property doctype + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type DocumentType + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentType + */ +Document.prototype.doctype = new DocumentType(); +/** + * Property implementation + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type DOMImplementation + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DOMImplementation + */ +Document.prototype.implementation = new DOMImplementation(); +/** + * Property documentElement + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.documentElement= new HTMLElement(); +/** + * Property styleSheets + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Document.prototype.styleSheets= new Array(); +/** + * function createElement(tagName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} tagName + * @returns {Element} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createElement=function(tagName){return new HTMLElement();}; +/** + * function createDocumentFragment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {DocumentFragment} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see DocumentFragment + */ +Document.prototype.createDocumentFragment=function(){return new DocumentFragment();}; +/** + * function createTextNode(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {Text} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +Document.prototype.createTextNode=function(data){return new Text();}; +/** + * function createComment(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {Comment} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Comment + */ +Document.prototype.createComment=function(data){return new Comment();}; +/** + * function createCDATASection(data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} data + * @returns {CDATASection} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CDATASection + */ +Document.prototype.createCDATASection=function(data){}; +/** + * function createProcessingInstruction(target, data) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type ProcessingInstruction + * @param {String} target + * @param {String} data + * @returns {ProcessingInstruction} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see ProcessingInstruction +*/ +Document.prototype.createProcessingInstruction=function(target, data){return new ProcessingInstruction();}; +/** + * function createAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Attr + */ +Document.prototype.createAttribute=function(name){return new Attr();}; +/** + * function createEntityReference(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {EntityReference} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see EntityReference + */ +Document.prototype.createEntityReference=function(name){return new EntityReference();}; +/** + * function getElementsByTagName(tagname) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} tagname + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList + */ +Document.prototype.getElementsByTagName=function(tagname){return new NodeList();}; +/** + * function importNode(importedNode, deep) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} importedNode + * @param {Boolean} deep + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Document.prototype.importNode=function(importedNode, deep){return new Node();}; +/** + * function createElementNS(namespaceURI, qualifiedName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Element} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createElementNS=function(namespaceURI, qualifiedName){return new HTMLElement();}; +/** + * function createEvent(String eventType) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} eventType + * @returns {Object} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.createEvent=function(eventType){return new Object();}; +/** + * function createAttributeNS(namespaceURI, qualifiedName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Attr + */ +Document.prototype.createAttributeNS=function(namespaceURI, qualifiedName){return new Attr();}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList + */ +Document.prototype.getElementsByTagNameNS=function(namespaceURI, localName){return new NodeList();}; +/** + * function getElementById(elementId) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} elementId + * @returns {Element} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Document.prototype.getElementById=function(elementId){return new HTMLElement();}; + +/** + * Object Node() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @memberOf Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see EventTarget + */ +function Node(){}; +Node.prototype=new EventTarget(); +/** + * Constant Node.ELEMENT_NODE=1 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ELEMENT_NODE=1; +/** + * Constant Node.ATTRIBUTE_NODE=2 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ATTRIBUTE_NODE=2; +/** + * Constant Node.TEXT_NODE=3 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.TEXT_NODE=3; +/** + * Constant Node.CDATA_SECTION_NODE=4 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.CDATA_SECTION_NODE=4; +/** + * Constant Node.ENTITY_REFERENCE_NODE=5 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.ENTITY_REFERENCE_NODE=5; +/** + * Constant Node.ENTITY_NODE=6 + * @type Number + * @memberOf Node + * @see Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html +*/ +Node.ENTITY_NODE=6; +/** + * Constant Node.PROCESSING_INSTRUCTION_NODE=7 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.PROCESSING_INSTRUCTION_NODE=7; +/** + * Constant Node.COMMENT_NODE=8 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.COMMENT_NODE=8; +/** + * Constant Node.DOCUMENT_NODE=9 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_NODE=9; +/** + * Constant Node.DOCUMENT_TYPE_NODE=10 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_TYPE_NODE=10; +/** + * Constant Node.DOCUMENT_FRAGMENT_NODE=11 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.DOCUMENT_FRAGMENT_NODE=11; +/** + * Constant Node.NOTATION_NODE=12 + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @constant + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.NOTATION_NODE=12; +/** + * Property nodeName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeName = ""; +/** + * Property nodeValue + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeValue = ""; +/** + * Property nodeType + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.nodeType = 0; +/** + * Property parentNode + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.parentNode=new Node(); +/** + * Property childNodes + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NodeList + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NodeList +*/ +Node.prototype.childNodes=new NodeList(); +/** + * Property firstChild + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.firstChild=new Node(); +/** + * Property lastChild + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.lastChild=new Node(); +/** + * Property previousSibling + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.previousSibling=new Node(); +/** + * Property nextSibling + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Node + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.nextSibling=new Node(); +/** + * Property attributes + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see NamedNodeMap + */ +Node.prototype.attributes=new NamedNodeMap(); +/** + * Property ownerDocument + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Document + */ +Node.prototype.ownerDocument = new HTMLDocument(); +/** + * Property namespaceURI + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.namespaceURI=""; +/** + * Property prefix + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.prefix = ""; +/** + * Property localName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.localName= ""; +/** + * function insertBefore(newChild, refChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @param {Node} refChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.insertBefore = function(newChild, refChild){return new Node();}; +/** + * function replaceChild(newChild, oldChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.replaceChild = function(newChild, oldChild){return new Node();}; +/** + * function removeChild(oldChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} oldChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.removeChild = function(oldChild){return new Node();}; +/** + * function appendChild(newChild) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} newChild + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.appendChild = function(newChild){return new Node();}; +/** + * function hasChildNodes() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.hasChildNodes=function(){return false;}; +/** + * function cloneNode(deep) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Boolean} deep + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +Node.prototype.cloneNode=function(deep){return new Node();}; +/** + * function normalize() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.normalize = function(){}; +/** + * function isSupported(feature, version) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} feature + * @param {String} version + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.isSupported=function(feature, version){return false;}; +/** + * function hasAttributes() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Node.prototype.hasAttributes=function(){return false;}; + +/** + * Object NodeList() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function NodeList(){}; +NodeList.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +NodeList.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node +*/ +NodeList.prototype.item = function(index){return new Node();}; + +/** + * Object NamedNodeMap() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Object + */ +function NamedNodeMap(){}; +NamedNodeMap.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +NamedNodeMap.prototype.length=0; +/** + * function getNamedItem(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.getNamedItem=function(name){return new Node();}; +/** + * function setNamedItem(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.setNamedItem=function(arg){return new Node();}; +/** + * function removeNamedItem(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.removeNamedItem=function(name){return new Node();}; +/** + * function item(index) + * Note: This object can also be dereferenced using square bracket notation (e.g. obj[1]). Dereferencing with an integer index is equivalent to invoking the item method with that index. + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.item=function(index){return new Node();}; +/** + * function getNamedItemNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.getNamedItemNS=function(namespaceURI, localName){return new Node();}; +/** + * function setNamedItemNS(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Node} arg + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.setNamedItemNS=function(arg){return new Node();}; +/** + * function removeNamedItemNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Node} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +NamedNodeMap.prototype.removeNamedItemNS=function(namespaceURI, localName){return new Node();}; + +/** + * Object CharacterData() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function CharacterData(){}; +CharacterData.prototype=new Node(); +/** + * Property data + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.data=""; +/** + * Property length + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.length=0; +/** + * function substringData(offset, count) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @returns {String} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.substringData=function(offset, count){return "";}; +/** + * function appendData(arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.appendData=function(arg){}; +/** + * function insertData(offset, arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.insertData=function(offset, arg){}; +/** + * function deleteData(offset, count) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.deleteData=function(offset, count){}; +/** + * function replaceData(offset, count, arg) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @param {Number} count + * @param {String} arg + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +CharacterData.prototype.replaceData=function(offset, count, arg){}; + +/** + * Object Attr() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Attr(){}; +Attr.prototype = new Node(); +/** + * Property name + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.name = ""; +/** + * Property specified + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.specified = false; +/** + * Property value + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Attr.prototype.value = ""; +/** + * Property ownerElement + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type Element + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Element + */ +Attr.prototype.ownerElement = new Element(); + +/** + * Object Element() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Element(){}; +Element.prototype=new Node(); +/** + * Property tagName + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.tagName=""; +/** + * function addEventListener(Stirng type, Function listener, Boolean useCapture) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @param {Boolean} useCapture + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.addEventListener=function(type, listener, useCapture){}; +/** + * function attachEvent(String type, Function listener) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.attachEvent=function(type, listener){}; +/** + * function detachEvent(String type, Function listener) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} type + * @param {Function} listener + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.detachEvent=function(type, listener){}; +/** + * function dispatchEvent(Object event) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Object} event + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.dispatchEvent=function(event){return false;}; +/** + * function getAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttribute=function(name){return "";}; +/** + * function setAttribute(name, value) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttribute=function(name, value){}; +/** + * function removeAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttribute=function(name){}; +/** + * function getAttributeNode(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Attr} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNode=function(name){return new Attr();}; +/** + * function setAttributeNode(newAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNode=function(newAttr){return new Attr();}; +/** + * function removeAttributeNode(oldAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} oldAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttributeNode=function(oldAttr){return new Attr();}; +/** + * function getElementsByTagName(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getElementsByTagName=function(name){return new NodeList();}; +/** + * function getAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {String} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNS=function(namespaceURI, localName){return "";}; +/** + * function setAttributeNS(namespaceURI, qualifiedName, value) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} qualifiedName + * @param {String} value + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNS=function(namespaceURI, qualifiedName, value){}; +/** + * function removeAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.removeAttributeNS=function(namespaceURI, localName){}; +/** + * function getAttributeNodeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Attr} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getAttributeNodeNS=function(namespaceURI, localName){return new Attr();}; +/** + * function setAttributeNodeNS(newAttr) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Attr} newAttr + * @returns {Attr} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.setAttributeNodeNS=function(newAttr){return new Attr();}; +/** + * function getElementsByTagNameNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.getElementsByTagNameNS=function(namespaceURI, localName){return new NodeList();}; +/** + * function hasAttribute(name) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} name + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.hasAttribute=function(name){return false;}; +/** + * function hasAttributeNS(namespaceURI, localName) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {String} namespaceURI + * @param {String} localName + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Element.prototype.hasAttributeNS=function(namespaceURI, localName){return false;}; + +/** + * Object Text() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments CharacterData + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CharacterData + */ +function Text(){}; +Text.prototype = new CharacterData(); +/** + * function splitText(offset) + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @param {Number} offset + * @returns {Text} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +Text.prototype.splitText = function(offset) {return new Text();}; + +/** + * Object Comment() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments CharacterData + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see CharacterData + */ +function Comment(){}; +Comment.prototype = new CharacterData(); + +/** + * Object CDATASection() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Text + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Text + */ +function CDATASection(){}; +CDATASection.prototype = new Text(); + +/** + * Object DocumentType() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function DocumentType(){}; +DocumentType.prototype = new Node(); +/** + * Property name + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.name=""; +/** + * Property entities + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.entities = new NamedNodeMap(); +/** + * Property notations + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type NamedNodeMap + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.notations=new NamedNodeMap(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.systemId=""; +/** + * Property internalSubset + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +DocumentType.prototype.internalSubset=""; + +/** + * Object Notation() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Notation(){}; +Notation.prototype=new Node(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Notation.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Notation.prototype.systemId=""; + +/** + * Object Entity() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function Entity(){}; +Entity.prototype=new Node(); +/** + * Property publicId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.publicId=""; +/** + * Property systemId + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.systemId=""; +/** + * Property notationName + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Entity.prototype.notationName=""; + +/** + * Object EntityReference() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function EntityReference(){}; +EntityReference.prototype=new Node(); + +/** + * Object ProcessingInstruction() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @augments Node + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + * @see Node + */ +function ProcessingInstruction(){}; +ProcessingInstruction.prototype=new Node(); +/** + * Property target + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +ProcessingInstruction.prototype.target=""; +/** + * Property target + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +ProcessingInstruction.prototype.data=""; + + +/*HTML DOM Below this line*/ + +/** + * Object HTMLCollection() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +function HTMLCollection(){}; +HTMLCollection.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.item = function(index){return new Node();}; +/** + * function namedItem(name) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLCollection.prototype.namedItem = function(index){return new Node();}; + +/** + * Object HTMLOptionsCollection() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +function HTMLOptionsCollection(){}; +HTMLOptionsCollection.prototype = new Object(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.length=0; +/** + * function item(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.item = function(index){return new Node();}; +/** + * function namedItem(name) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} name + * @returns {Node} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionsCollection.prototype.namedItem = function(index){return new Node();}; + +/** + * Object HTMLDocument() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Document + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see Document + */ +function HTMLDocument(){}; +HTMLDocument.prototype = new Document(); +/** + * Property title + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.title=""; +/** + * Property referrer + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.referrer=""; +/** + * Property domain + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.domain=""; +/** + * Property URL + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.URL=""; +/** + * Property body + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.body=new HTMLElement(); +/** + * Property images + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.images=new HTMLCollection(); +/** + * Property applets + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.applets=new HTMLCollection(); +/** + * Property links + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.links=new HTMLCollection(); +/** + * Property forms + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.forms=new HTMLCollection(); +/** + * Property anchors + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.anchors=new HTMLCollection(); +/** + * Property cookie + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.cookie=""; +/** + * Property lastModified + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.lastModified=""; +/** + * function open() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.open = function(){}; +/** + * function close() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.close = function(){}; +/** + * function write(text) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.write = function(text){}; +/** + * function writeln(text) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} text + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.writeln = function(text){}; +/** + * function getElementsByName(elementName) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {String} elementName + * @returns {NodeList} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDocument.prototype.getElementsByName = function(elementName){return new NodeList();}; + +/** + * Object HTMLElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments Element + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see Element + */ +function HTMLElement(){}; +HTMLElement.prototype = new Element(); +/** + * Property id + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.id=""; +/** + * Property title + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.title=""; +/** + * Property lang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.lang=""; +/** + * Property dir + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.dir=""; +/** + * Property className + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLElement.prototype.className=""; +/** + * Property innerHTML + * + * @type String + */ +HTMLElement.prototype.innerHTML=""; +/** + * Property offsetHeight + * + * @type Number + */ +HTMLElement.prototype.offsetHeight=0; +/** + * Property offsetWidth + * + * @type Number + */ +HTMLElement.prototype.offsetWidth=0; +/** + * Property offsetLeft + * + * @type Number + */ +HTMLElement.prototype.offsetLeft=0; +/** + * Property offsetTop + * + * @type Number + */ +HTMLElement.prototype.offsetTop=0; +/** + * Property offsetParent + * + * @type HTMLElement + */ +HTMLElement.prototype.offsetParent = new HTMLElement(); +/** + * Property scrollHeight + * + * @type Number + */ +HTMLElement.prototype.scrollHeight=0; +/** + * Property scrollWidth + * + * @type Number + */ +HTMLElement.prototype.scrollWidth=0; +/** + * Property scrollLeft + * + * @type Number + */ +HTMLElement.prototype.scrollLeft=0; +/** + * Property scrollTop + * + * @type Number + */ +HTMLElement.prototype.scrollTop=0; +/** + * Property style + * + * @type CSS2Properties + */ +HTMLElement.prototype.style = new CSS2Properties(); + +/** + * Object HTMLHtmlElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHtmlElement(){}; +HTMLHtmlElement.prototype = new HTMLElement(); +/** + * Property version + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHtmlElement.prototype.version=""; + +/** + * Object HTMLHeadElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHeadElement(){}; +HTMLHeadElement.prototype = new HTMLElement(); +/** + * Property profile + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHeadElement.prototype.profile=""; + +/** + * Object HTMLLinkElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLinkElement(){}; +HTMLLinkElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.disabled=false; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.charset=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.href=""; +/** + * Property hreflang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.hreflang=""; +/** + * Property media + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.media=""; +/** + * Property rel + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.rel=""; +/** + * Property rev + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.rev=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.target=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLinkElement.prototype.type=""; + +/** + * Object HTMLTitleElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTitleElement(){}; +HTMLTitleElement.prototype = new HTMLElement(); +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTitleElement.prototype.text=""; + +/** + * Object HTMLMetaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMetaElement(){}; +HTMLMetaElement.prototype = new HTMLElement(); +/** + * Property content + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.content=""; +/** + * Property httpEquiv + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.httpEquiv=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.name=""; +/** + * Property scheme + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMetaElement.prototype.scheme=""; + +/** + * Object HTMLBaseElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBaseElement(){}; +HTMLBaseElement.prototype = new HTMLElement(); +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseElement.prototype.href=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseElement.prototype.target=""; + +/** + * Object HTMLIsIndexElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLIsIndexElement(){}; +HTMLIsIndexElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIsIndexElement.prototype.form=new HTMLFormElement(); +/** + * Property prompt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIsIndexElement.prototype.prompt=""; + +/** + * Object HTMLStyleElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLStyleElement(){}; +HTMLStyleElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.disabled=false; +/** + * Property media + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.media=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLStyleElement.prototype.type=""; + +/** + * Object HTMLBodyElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBodyElement(){}; +HTMLBodyElement.prototype = new HTMLElement(); +/** + * Property aLink + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.aLink=""; +/** + * Property background + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.background=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.bgColor=""; +/** + * Property link + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.link=""; +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.text=""; +/** + * Property vLink + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBodyElement.prototype.vLink=""; + +/** + * Object HTMLFormElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFormElement(){}; +HTMLFormElement.prototype = new HTMLElement(); +/** + * Property elements + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.elements=new HTMLCollection(); +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.length=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.name=""; +/** + * Property acceptCharset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.acceptCharset=""; +/** + * Property action + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.action=""; +/** + * Property enctype + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.enctype=""; +/** + * Property method + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.method=""; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.target=""; +/** + * function submit() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.submit = function(){}; +/** + * function reset() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFormElement.prototype.reset = function(){}; + +/** + * Object HTMLSelectElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLSelectElement(){}; +HTMLSelectElement.prototype = new HTMLElement(); +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.type=""; +/** + * Property selectedIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.selectedIndex=0; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.value=""; +/** + * Property length + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.length=0; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.form = new HTMLFormElement(); +/** + * Property options + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLOptionsCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.options= new HTMLOptionsCollection(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.disabled=false; +/** + * Property multiple + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.multiple=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.name=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.size=0; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.tabIndex=0; +/** + * function add(element, before) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {HTMLElement} element + * @param {HTMLElement} before + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.add = function(element, before){}; +/** + * function remove(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.remove = function(index){}; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLSelectElement.prototype.focus = function(){}; + +/** + * Object HTMLOptGroupElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOptGroupElement(){}; +HTMLOptGroupElement.prototype = new HTMLElement(); +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptGroupElement.prototype.disabled=false; +/** + * Property label + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptGroupElement.prototype.label=""; + +/** + * Object Option() + * @constructor + * @param {String} text + * @param {String} value + * @param {Boolean} defaultSelected + * @param {Boolean} selected + */ +function Option(text, value, defaultSelected, selected){}; +Option.prototype = new HTMLOptionElement(); +/** + * Object HTMLOptionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOptionElement(){}; +HTMLOptionElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.form = new HTMLFormElement(); +/** + * Property defaultSelected + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.defaultSelected=false; +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.text=""; +/** + * Property index + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.index=0; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.disabled=false; +/** + * Property label + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.label=""; +/** + * Property selected + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.selected=false; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOptionElement.prototype.value=""; + +/** + * Object HTMLInputElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLInputElement(){}; +HTMLInputElement.prototype = new HTMLElement(); +/** + * Property defaultValue + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.defaultValue=""; +/** + * Property defaultChecked + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.defaultChecked=false; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.form = new HTMLFormElement(); +/** + * Property accept + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.accept=""; +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.accessKey=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.alt=""; +/** + * Property checked + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.checked=false; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.disabled=false; +/** + * Property masLength + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.maxLenght=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.name=""; +/** + * Property readOnly + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.readOnly=false; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.size=0; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.src=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.type=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.useMap=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.value=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.focus = function(){}; +/** + * function select() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.select = function(){}; +/** + * function click() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLInputElement.prototype.click = function(){}; + +/** + * Object HTMLTextAreaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTextAreaElement(){}; +HTMLTextAreaElement.prototype = new HTMLElement(); +/** + * Property defaultValue + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.defaultValue=""; +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.form= new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.accessKey=""; +/** + * Property cols + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.cols=0; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.disabled=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.name=""; +/** + * Property readOnly + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.readOnly=false; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.rows=0; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.value=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.focus = function(){}; +/** + * function select() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTextAreaElement.prototype.select = function(){}; + +/** + * Object HTMLButtonElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLButtonElement(){}; +HTMLButtonElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.accessKey = ""; +/** + * Property disabled + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.disabled=false; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.name=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLButtonElement.prototype.value=""; + +/** + * Object HTMLLabelElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLabelElement(){}; +HTMLLabelElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.accessKey=""; +/** + * Property htmlFor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLabelElement.prototype.htmlFor=""; + +/** + * Object HTMLFieldSetElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFieldSetElement(){}; +HTMLFieldSetElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFieldSetElement.prototype.form = new HTMLFormElement(); + +/** + * Object HTMLLegendElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLegendElement(){}; +HTMLLegendElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.form = new HTMLFormElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.accessKey=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLegendElement.prototype.align=""; + +/** + * Object HTMLUListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLUListElement(){}; +HTMLUListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLUListElement.prototype.compact=false; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLUListElement.prototype.type=""; + +/** + * Object HTMLOListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLOListElement(){}; +HTMLOListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.compact=false; +/** + * Property start + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.start=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLOListElement.prototype.type=""; + +/** + * Object HTMLDListElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDListElement(){}; +HTMLDListElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDListElement.prototype.compact=false; + +/** + * Object HTMLDirectoryElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDirectoryElement(){}; +HTMLDirectoryElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDirectoryElement.prototype.compact=false; + +/** + * Object HTMLMenuElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMenuElement(){}; +HTMLMenuElement.prototype = new HTMLElement(); +/** + * Property compact + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMenuElement.prototype.compact=false; + +/** + * Object HTMLLIElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLLIElement(){}; +HTMLLIElement.prototype = new HTMLElement(); +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLIElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLLIElement.prototype.value=0; + +/** + * Object HTMLDivElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLDivElement(){}; +HTMLDivElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLDivElement.prototype.align=""; + +/** + * Object HTMLParagraphElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLParagraphElement(){}; +HTMLParagraphElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParagraphElement.prototype.align=""; + +/** + * Object HTMLHeadingElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHeadingElement(){}; +HTMLHeadingElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHeadingElement.prototype.align=""; + +/** + * Object HTMLQuoteElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLQuoteElement(){}; +HTMLQuoteElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLQuoteElement.prototype.align=""; + +/** + * Object HTMLPreElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLPreElement(){}; +HTMLPreElement.prototype = new HTMLElement(); +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLPreElement.prototype.width=0; + +/** + * Object HTMLBRElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBRElement(){}; +HTMLBRElement.prototype = new HTMLElement(); +/** + * Property clear + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBRElement.prototype.clear=""; + +/** + * Object HTMLBaseFontElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLBaseFontElement(){}; +HTMLBaseFontElement.prototype = new HTMLElement(); +/** + * Property color + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.color=""; +/** + * Property face + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.face=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLBaseFontElement.prototype.size=0; + +/** + * Object HTMLBaseFontElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFontElement(){}; +HTMLFontElement.prototype = new HTMLElement(); +/** + * Property color + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.color=""; +/** + * Property face + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.face=""; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFontElement.prototype.size=0; + +/** + * Object HTMLHRElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLHRElement(){}; +HTMLHRElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.align=""; +/** + * Property noShade + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.noShade=false; +/** + * Property size + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.size=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLHRElement.prototype.width=""; + +/** + * Object HTMLModElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLModElement(){}; +HTMLModElement.prototype = new HTMLElement(); +/** + * Property cite + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLModElement.prototype.cite=""; +/** + * Property dateTime + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLModElement.prototype.dateTime=""; + +/** + * Object HTMLAnchorElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAnchorElement(){}; +HTMLAnchorElement.prototype = new HTMLElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.accessKey=""; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.charset=""; +/** + * Property coords + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.coords=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.href=""; +/** + * Property hreflang + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.hreflang=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.name=""; +/** + * Property rel + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.rel=""; +/** + * Property rev + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.rev=""; +/** + * Property shape + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.shape=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.tabIndex=0; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.target=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.type=""; +/** + * function blur() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.blur = function(){}; +/** + * function focus() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAnchorElement.prototype.focus = function(){}; + +/** + * Object Image() + * @constructor + * @param {Number} width + * @param {Number} height + */ +function Image(width, height){}; +Image.prototype = new HTMLImageElement(); +/** + * Object HTMLImageElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLImageElement(){}; +HTMLImageElement.prototype = new HTMLElement(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.name=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.alt=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.border=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.height=0; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.hspace=0; +/** + * Property isMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.isMap=false; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.longDesc=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.src=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.useMap=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLImageElement.prototype.width=0; + +/** + * Object HTMLObjectElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLObjectElement(){}; +HTMLObjectElement.prototype = new HTMLElement(); +/** + * Property form + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLFormElement + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.form = new HTMLFormElement(); +/** + * Property code + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.code=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.align=""; +/** + * Property archive + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.archive=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.border=""; +/** + * Property codeBase + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.codeBase=""; +/** + * Property codeType + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.codeType=""; +/** + * Property data + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.data=""; +/** + * Property declare + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.declare=false; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.height=""; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.hspace=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.name=""; +/** + * Property standby + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.standby=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.tabIndex=0; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.type=""; +/** + * Property useMap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.useMap=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.width=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLObjectElement.prototype.contentDocument= new HTMLDocument(); + +/** + * Object HTMLParamElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLParamElement(){}; +HTMLParamElement.prototype = new HTMLElement(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.name=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.type=""; +/** + * Property value + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.value=""; +/** + * Property valueType + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLParamElement.prototype.valueType=""; + +/** + * Object HTMLAppletElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAppletElement(){}; +HTMLAppletElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.align=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.alt=""; +/** + * Property archive + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.archive=""; +/** + * Property code + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.code=""; +/** + * Property codeBase + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.codeBase=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.hight=""; +/** + * Property hspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.hspace=0; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.name=""; +/** + * Property object + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.object=""; +/** + * Property vspace + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.vspace=0; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAppletElement.prototype.width=""; + +/** + * Object HTMLMapElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLMapElement(){}; +HTMLMapElement.prototype = new HTMLElement(); +/** + * Property areas + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMapElement.prototype.areas = new HTMLCollection(); +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLMapElement.prototype.name=""; + +/** + * Object HTMLAreaElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLAreaElement(){}; +HTMLAreaElement.prototype = new HTMLElement(); +/** + * Property accessKey + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.accessKey=""; +/** + * Property alt + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.alt=""; +/** + * Property coords + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.coords=""; +/** + * Property href + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.href=""; +/** + * Property noHref + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.noHref=false; +/** + * Property shape + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.shape=""; +/** + * Property tabIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.tabIndex=0; +/** + * Property target + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLAreaElement.prototype.target=""; + +/** + * Object HTMLScriptElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLScriptElement(){}; +HTMLScriptElement.prototype = new HTMLElement(); +/** + * Property text + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.text=""; +/** + * Property htmlFor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.htmlFor=""; +/** + * Property event + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.event=""; +/** + * Property charset + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.charset=""; +/** + * Property defer + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.defer=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.src=""; +/** + * Property type + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLScriptElement.prototype.type=""; + +/** + * Object HTMLTableElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableElement(){}; +HTMLTableElement.prototype = new HTMLElement(); +/** + * Property caption + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableCaptionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.caption = new HTMLTableCaptionElement(); +/** + * Property tHead + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableSectionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tHead = new HTMLTableSelectionElement(); +/** + * Property tFoot + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLTableSectionElement + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tFoot = new HTMLTableSelectionElement(); +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.rows = new HTMLCollection(); +/** + * Property tBodies + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.tBodies = new HTMLCollection(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.align=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.bgColor=""; +/** + * Property border + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.border=""; +/** + * Property cellPadding + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.cellPadding=""; +/** + * Property cellSpacing + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.cellSpacing=""; +/** + * Property frame + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.frame=""; +/** + * Property rules + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.rules=""; +/** + * Property summary + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.summary=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.width=""; +/** + * function createTHead(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createTHead = function(){return new HTMLElement();}; +/** + * function deleteTHead(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteTHead = function(){}; +/** + * function createTFoot(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createTFoot = function(){return new HTMLElement();}; +/** + * function deleteTFoot(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteTFoot = function(){}; +/** + * function createCaption(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @returns {HTMLElement} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.createCaption = function(){return new HTMLElement();}; +/** + * function deleteCaption(); + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteCaption = function(){}; +/** + * function insertRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.insertRow = function(index){return new HTMLElement();}; +/** + * function deleteRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableElement.prototype.deleteRow = function(index){}; + +/** + * Object HTMLTableCaptionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableCaptionElement(){}; +HTMLTableCaptionElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCaptionElement.prototype.align=""; + +/** + * Object HTMLTableColElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableColElement(){}; +HTMLTableColElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.align=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.chOff=""; +/** + * Property span + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.span=0; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.vAlign=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableColElement.prototype.width=""; + +/** + * Object HTMLTableSelectionElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableSelectionElement(){}; +HTMLTableSelectionElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.align=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.chOff=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.vAlign=""; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.rows=""; +/** + * function insertRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.insertRow = function(index){return new HTMLElement();}; +/** + * function deleteRow(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableSelectionElement.prototype.deleteRow = function(index){}; + +/** + * Object HTMLTableRowElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableRowElement(){}; +HTMLTableRowElement.prototype = new HTMLElement(); +/** + * Property rowIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.rowIndex=0; +/** + * Property sectionRowIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.sectionRowIndex=0; +/** + * Property cells + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type HTMLCollection + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.cells = new HTMLCollection(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.align=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.bgColor=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.chOff=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.vAlign=""; +/** + * function insertCell(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @returns {HTMLElement} + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.insertCell = function(index){return new HTMLElement();}; +/** + * function insertCell(index) + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @param {Number} index + * @throws DOMException + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableRowElement.prototype.deleteCell = function(index){}; + +/** + * Object HTMLTableRowElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLTableCellElement(){}; +HTMLTableCellElement.prototype = new HTMLElement(); +/** + * Property cellIndex + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.cellIndex=0; +/** + * Property abbr + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.abbr=""; +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.align=""; +/** + * Property axis + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.axis=""; +/** + * Property bgColor + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.bgColor=""; +/** + * Property ch + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.ch=""; +/** + * Property chOff + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.chOff=""; +/** + * Property colSpan + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.colSpan=0; +/** + * Property headers + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.headers=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.height=""; +/** + * Property noWrap + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.noWrap=false; +/** + * Property rowSpan + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.rowSpan=0; +/** + * Property scope + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.scope=""; +/** + * Property vAlign + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.vAlign=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLTableCellElement.prototype.width=""; + +/** + * Object HTMLFrameSetElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFrameSetElement(){}; +HTMLFrameSetElement.prototype = new HTMLElement(); +/** + * Property cols + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameSetElement.prototype.cols=""; +/** + * Property rows + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameSetElement.prototype.rows=""; + +/** + * Object HTMLFrameElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLFrameElement(){}; +HTMLFrameElement.prototype = new HTMLElement(); +/** + * Property frameBorder + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.frameBorder=""; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.longDesc=""; +/** + * Property marginHeight + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.marginHeight=""; +/** + * Property marginWidth + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.marginWidth=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.name=""; +/** + * Property noResize + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Boolean + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.noResize=false; +/** + * Property scrolling + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.scrolling=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.src=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLFrameElement.prototype.contentDocument= new HTMLDocument(); + +/** + * Object HTMLIFrameElement() + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @augments HTMLElement + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + * @see HTMLElement + */ +function HTMLIFrameElement(){}; +HTMLIFrameElement.prototype = new HTMLElement(); +/** + * Property align + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.align=""; +/** + * Property frameBorder + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.frameBorder=""; +/** + * Property height + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.height=""; +/** + * Property longDesc + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.longDesc=""; +/** + * Property marginHeight + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.marginHeight=""; +/** + * Property marginWidth + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.marginWidth=""; +/** + * Property name + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.name=""; +/** + * Property scrolling + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.scrolling=""; +/** + * Property src + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.src=""; +/** + * Property width + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.width=""; +/** + * Property contentDocument + * http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html + * + * @type Document + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model HTML Specification. + */ +HTMLIFrameElement.prototype.contentDocument= new HTMLDocument(); + +/* Stylesheets */ +/** + * Object CSS2Properties() + * http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/ecma-script-binding.html + * + * @augments Object + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Style Specification. + */ +function CSS2Properties(){}; +CSS2Properties.prototype = new Object(); \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/browserWindow.js b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/browserWindow.js new file mode 100644 index 0000000..cfbf452 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/browserWindow.js @@ -0,0 +1,618 @@ +/******************************************************************************* + * Copyright (c) 2008, 2013 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +function BarProp(){}; +BarProp.prototype = new Array(); + +/** + * Object Window() + * @super Global + * @constructor + * @since Common Usage, no standard +*/ +function Window(){}; +Window.prototype = new EventTarget(); +Window.prototype.self = new Window(); +Window.prototype.window = new Window(); +Window.prototype.frames = new Array(); +/** + * Property closed + * @type Boolean + * @memberOf Window + */ +Window.prototype.closed = new Boolean(); +/** + * Property defaultStatus + * @type String + * @memberOf Window + */ +Window.prototype.defaultStatus = ""; +/** + * Property document + * @type Document + * @memberOf Window + */ +Window.prototype.document= new HTMLDocument(); +/** + * Property history + * @type History + * @memberOf Window + */ +Window.prototype.history= new History(); +/** + * Property location + * @type Location + * @memberOf Window + */ +Window.prototype.location=new Location(); +/** + * Property name + * @type String + * @memberOf Window + */ +Window.prototype.name = ""; +/** + * Property navigator + * @type Navigator + * @memberOf Window + */ +Window.prototype.navigator = new Navigator(); +/** + * Property opener + * @type Window + * @memberOf Window + */ +Window.prototype.opener = new Window(); +/** + * Property outerWidth + * @type Number + * @memberOf Window + */ +Window.prototype.outerWidth = 0; +/** + * Property outerHeight + * @type Number + * @memberOf Window + */ +Window.prototype.outerHeight = 0; +/** + * Property pageXOffset + * @type Number + * @memberOf Window + */ +Window.prototype.pageXOffset = 0; +/** + * Property pageYOffset + * @type Number + * @memberOf Window + */ +Window.prototype.pageYOffset = 0; +/** + * Property parent + * @type Window + * @memberOf Window + */ +Window.prototype.parent = new Window(); +/** + * Property screen + * @type Screen + * @memberOf Window + */ +Window.prototype.screen = new Screen(); +/** + * Property status + * @type String + * @memberOf Window + */ +Window.prototype.status = ""; +/** + * Property top + * @type Window + * @memberOf Window + */ +Window.prototype.top = new Window(); + + +/* + * These properties may need to be moved into a browswer specific library. + */ + + /** + * Property innerWidth + * @type Number + * @memberOf Window + */ +Window.prototype.innerWidth = 0; +/** + * Property innerHeight + * @type Number + * @memberOf Window + */ +Window.prototype.innerHeight = 0; +/** + * Property screenX + * @type Number + * @memberOf Window + */ +Window.prototype.screenX = 0; +/** + * Property screenY + * @type Number + * @memberOf Window + */ +Window.prototype.screenY = 0; +/** + * Property screenLeft + * @type Number + * @memberOf Window + */ +Window.prototype.screenLeft = 0; +/** + * Property screenTop + * @type Number + * @memberOf Window + */ +Window.prototype.screenTop = 0; +//Window.prototype.event = new Event(); +Window.prototype.length = 0; +Window.prototype.scrollbars= new BarProp(); +Window.prototype.scrollX=0; +Window.prototype.scrollY=0; +Window.prototype.content= new Window(); +Window.prototype.menubar= new BarProp(); +Window.prototype.toolbar= new BarProp(); +Window.prototype.locationbar= new BarProp(); +Window.prototype.personalbar= new BarProp(); +Window.prototype.statusbar= new BarProp(); +Window.prototype.directories= new BarProp(); +Window.prototype.scrollMaxX=0; +Window.prototype.scrollMaxY=0; +Window.prototype.fullScreen=""; +Window.prototype.frameElement=""; +/* End properites */ + +/** + * function alert() + * @param {String} message + * @memberOf Window + */ +Window.prototype.alert = function(message){}; +/** + * function blur() + * @memberOf Window + */ +Window.prototype.blur = function(){}; +/** + * function clearInterval(intervalID) + * @param intervalID + * @memberOf Window + */ +Window.prototype.clearInterval = function(intervalID){}; +/** + * function clearTimeout(intervalID) + * @param intervalID + * @memberOf Window + */ +Window.prototype.clearTimeout = function(intervalID){}; +/** + * function close() + * @memberOf Window + */ +Window.prototype.close = function(){}; +/** + * function confirm() + * @param {String} arg + * @memberOf Window + * @returns {Boolean} + */ +Window.prototype.confirm = function(arg){return false;}; +/** + * function focus() + * @memberOf Window + */ +Window.prototype.focus = function(){}; +/** + * function getComputedStyle(element, pseudoElt ) + * @param {Element} element + * @param {String} pseudoElt + * @memberOf Window + * @returns {Object} + */ +Window.prototype.getComputedStyle = function(element,pseudoElt ){return new Object();}; +/** + * function moveTo(x, y) + * @param {Number} x + * @param {Number} y + * @memberOf Window + */ +Window.prototype.moveTo = function(x,y){}; +/** + * function moveBy(deltaX, deltaY) + * @param {Number} deltaX + * @param {Number} deltaY + * @memberOf Window + */ +Window.prototype.moveBy = function(deltaX,deltaY){}; +/** + * function open(optionalArg1, optionalArg2, optionalArg3, optionalArg4) + * @param {String} url + * @param {String} windowName + * @param {String} windowFeatures + * @param {Boolean} optionalArg4 + * @memberOf Window + * @returns {Window} + */ +Window.prototype.open = function(url, windowName, windowFeatures, optionalArg4){return new Window();}; +/** + * function print() + * @memberOf Window + */ +Window.prototype.print = function(){}; +/** + * function prompt(text, value) + * @param {String} text + * @param {String} value + * @memberOf Window + * @returns {String} + */ +Window.prototype.prompt = function(text, value){return "";}; +/** + * function resizeTo(newOuterWidth,newOuterHeight) + * @param {Number} newOuterWidth + * @param {Number} newOuterHeighr + * @memberOf Window + */ +Window.prototype.resizeTo=function(newOuterWidth,newOuterHeight){}; +/** + * function resizeBy(deltaX, deltaY) + * @param {Number} deltaX + * @param {Number} deltaY + * @memberOf Window + */ +Window.prototype.resizeBy=function(deltaX,deltaY){}; +/** + * function scrollTo(x,y) + * @param {Number} x + * @param {Number} y + * @memberOf Window + */ +Window.prototype.scrollTo=function(x,y){}; +/** + * function scrollBy(pixelX,pixelY) + * @param {Number} pixelX + * @param {Number} pixelY + * @memberOf Window + */ +Window.prototype.scrollBy=function(pixelX,pixelY){}; +/** + * function setInterval(arg1, arg2) + * @param {Function} callback + * @param {Number} delay + * @memberOf Window + * @returns {Number} + */ +Window.prototype.setInterval=function(callback, delay){return 0;}; +/** + * function setTimeout(callback, delay) + * @param {Function} callback + * @param {Number} delay + * @memberOf Window + * @returns {Number} + */ +Window.prototype.setTimeout=function(callback, delay){ return 0;}; +/** + * function atob(encodedData) + * @param {String} encodedData + * @memberOf Window + * @returns {String} + */ +Window.prototype.atob=function(encodedData){return "";}; +/** + * function btoa(arg) + * @param {String} stringToEncode + * @memberOf Window + * @returns {String} + */ +Window.prototype.btoa=function(stringToEncode){return "";}; +/** + * function setResizable(resizable) + * @param {Boolean} resizable + * @memberOf Window + */ +Window.prototype.setResizable=function(resizable){}; + +Window.prototype.captureEvents=function(eventType){}; +Window.prototype.releaseEvents=function(eventType){}; +Window.prototype.routeEvent=function(eventType){}; +Window.prototype.enableExternalCapture=function(){}; +Window.prototype.disableExternalCapture=function(){}; +Window.prototype.find=function(){}; +Window.prototype.back=function(){}; +Window.prototype.forward=function(){}; +Window.prototype.home=function(){}; +Window.prototype.stop=function(){}; +/** + * @param {Number} pixelX + * @param {Number} pixelY + */ +Window.prototype.scroll=function(pixelX,pixelY){}; +/* End functions */ + +/** + * Object History() + * @super Object + * @constructor + * @since Common Usage, no standard + */ +function History(){}; +History.prototype=new Object(); +History.prototype.history = new History(); +/** + * Property length + * @type Number + * @memberOf History + */ +History.prototype.length = 0; +/** + * function back() + * @memberOf History + */ +History.prototype.back = function(){}; +/** + * function forward() + * @memberOf History + */ +History.prototype.forward = function(){}; +/** + * function back() + * @param arg + * @memberOf History + */ +History.prototype.go = function(arg){}; + +/** + * Object Location() + * @super Object + * @constructor + * @since Common Usage, no standard + */ +function Location(){}; +Location.prototype = new Object(); +Location.prototype.location = new Location(); +/** + * Property hash + * @type String + * @memberOf Location + */ +Location.prototype.hash = ""; +/** + * Property host + * @type String + * @memberOf Location + */ +Location.prototype.host = ""; +/** + * Property hostname + * @type String + * @memberOf Location + */ +Location.prototype.hostname = ""; +/** + * Property href + * @type String + * @memberOf Location + */ +Location.prototype.href = ""; +/** + * Property pathname + * @type String + * @memberOf Location + */ +Location.prototype.pathname = ""; +/** + * Property port + * @type String + * @memberOf Location + */ +Location.prototype.port = ""; +/** + * Property protocol + * @type String + * @memberOf Location + */ +Location.prototype.protocol = ""; +/** + * Property search + * @type String + * @memberOf Location + */ +Location.prototype.search = ""; +/** + * function assign(arg) + * @param {String} arg + * @memberOf Location + */ +Location.prototype.assign = function(arg){}; +/** + * function reload(optionalArg) + * @param {Boolean} optionalArg + * @memberOf Location + */ +Location.prototype.reload = function(optionalArg){}; +/** + * function replace(arg) + * @param {String} arg + * @memberOf Location + */ +Location.prototype.replace = function(arg){}; + +/** + * Object Navigator() + * @super Object + * @constructor + * @since Common Usage, no standard +*/ +function Navigator(){}; +Navigator.prototype = new Object(); +Navigator.prototype.navigator = new Navigator(); +/** + * Property appCodeName + * @type String + * @memberOf Navigator + */ +Navigator.prototype.appCodeName = ""; +/** + * Property appName + * @type String + * @memberOf Navigator + */ +Navigator.prototype.appName = ""; +/** + * Property appVersion + * @type String + * @memberOf Navigator + */ +Navigator.prototype.appVersion = ""; +/** + * Property cookieEnabled + * @type Boolean + * @memberOf Navigator + */ +Navigator.prototype.cookieEnabled = new Boolean(); +/** + * Property mimeTypes + * @type Array + * @memberOf Navigator + */ +Navigator.prototype.mimeTypes = new Array(); +/** + * Property platform + * @type String + * @memberOf Navigator + */ +Navigator.prototype.platform = ""; +/** + * Property plugins + * @type Array + * @memberOf Navigator + */ +Navigator.prototype.plugins = new Array(); +/** + * Property userAgent + * @type String + * @memberOf Navigator + */ +Navigator.prototype.userAgent = ""; +/** + * function javaEnabled() + * @returns {Boolean} + * @memberOf Navigator + */ +Navigator.prototype.javaEnabled = function(){return false;}; + +/** + * Object Screen() + * @super Object + * @constructor + * @since Common Usage, no standard +*/ +function Screen(){}; +Screen.prototype = new Object(); +Screen.prototype.screen = new Screen(); +/** + * Property availHeight + * @type Number + * @memberOf Screen + */ +Navigator.prototype.availHeight = 0; +/** + * Property availWidth + * @type Number + * @memberOf Screen + */ +Navigator.prototype.availWidth = 0; +/** + * Property colorDepth + * @type Number + * @memberOf Screen + */ +Navigator.prototype.colorDepth = 0; +/** + * Property height + * @type Number + * @memberOf Screen + */ +Navigator.prototype.height = 0; +/** + * Property width + * @type Number + * @memberOf Screen + */ +Navigator.prototype.width = 0; + +Event.prototype=new Object(); +// PhaseType +Event.prototype.CAPTURING_PHASE = 1; +Event.prototype.AT_TARGET = 2; +Event.prototype.BUBBLING_PHASE = 3; + +Event.prototype.type=""; +Event.prototype.target=new EventTarget(); +Event.prototype.currentTarget=new EventTarget(); +Event.prototype.eventPhase=0; +Event.prototype.bubbles=false; +Event.prototype.cancelable=false; +Event.prototype.timeStamp=0; +Event.prototype.stopPropagation=function(){}; +Event.prototype.preventDefault=function(){}; +/** + * @param {String} eventTypeArg + * @param {Boolean} canBubbleArg + * @param {Boolean} cancelableArg + */ +Event.prototype.initEvent=function(eventTypeArg, + canBubbleArg, + cancelableArg){}; +function EventListener(){}; +EventListener.prototype=new Object(); +/** + * @param {Event} event + * @memberOf EventListener + */ +EventListener.prototype.handleEvent=function(event){}; + +function EventTarget(){}; +EventTarget.prototype=new Object(); +/* + * These functions may need to be moved into a browser specific library. + */ +/** + * @memberOf Window + * @param event {Event} + * @throws {EventException} + */ +EventTarget.prototype.dispatchEvent=function(event){}; + +// https://developer.mozilla.org/en-US/docs/DOM/element.addEventListener +/** + * @memberOf Window + * @param {String} type + * @param {EventListener} listener + * @param {Boolean} useCapture + */ +EventTarget.prototype.addEventListener=function(type, listener, useCapture){}; +// https://developer.mozilla.org/en-US/docs/DOM/element.removeEventListener +/** + * @memberOf Window + * @param {String} type + * @param {EventListener} listener + * @param {Boolean} useCapture + */ +EventTarget.prototype.removeEventListener=function(type, listener, useCapture){}; diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/dom5.js b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/dom5.js new file mode 100644 index 0000000..d199ab6 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/dom5.js @@ -0,0 +1,922 @@ +/******************************************************************************* + * Copyright (c) 2013 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + ******************************************************************************/ + +/** + * function querySelector(selectors) + * http://www.w3.org/TR/2012/PR-selectors-api-20121213 + * @param {String} selectors + * @memberOf Document + * @returns {Element} + */ +Document.prototype.querySelector=function(selectors){return new Element();}; + +/** + * function querySelectorAll(selectors) + * http://www.w3.org/TR/2012/PR-selectors-api-20121213 + * @param {String} selectors + * @memberOf Document + * @returns {NodeList} + */ +Document.prototype.querySelectorAll=function(selectors){return new NodeList();}; + +/** + * function querySelector(selectors) + * http://www.w3.org/TR/2012/PR-selectors-api-20121213 + * @param {String} selectors + * @memberOf DocumentFragment + * @returns {Element} + */ +DocumentFragment.prototype.querySelector=function(selectors){return new Element();}; + +/** + * function querySelectorAll(selectors) + * http://www.w3.org/TR/2012/PR-selectors-api-20121213 + * @param {String} selectors + * @memberOf DocumentFragment + * @returns {NodeList} + */ +DocumentFragment.prototype.querySelectorAll=function(selectors){return new NodeList();}; + +/** + * function querySelector(selectors) + * http://www.w3.org/TR/2012/PR-selectors-api-20121213 + * @param {String} selectors + * @memberOf Element + * @returns {Element} + */ +Element.prototype.querySelector=function(selectors){return new Element();}; + +/** + * function querySelectorAll(selectors) + * http://www.w3.org/TR/2012/PR-selectors-api-20121213 + * @param {String} selectors + * @memberOf Element + * @returns {NodeList} + */ +Element.prototype.querySelectorAll=function(selectors){return new NodeList();}; + +/** + * Property state + * @type Object + * @memberOf History + */ +History.prototype.state=new Object(); + +/** + * function pushState(data,title,url) + * http://www.w3.org/TR/2012/CR-html5-20121217/browsers.html#history + * @param {Object} data + * @param {String} title + * @param {String} url - optional + * @memberOf History + */ +History.prototype.pushState=function(data,title,url){}; + +/** + * function replaceState(data,title,url) + * http://www.w3.org/TR/2012/CR-html5-20121217/browsers.html#history + * @param {Object} data + * @param {String} title + * @param {String} url - optional + * @memberOf History + */ +History.prototype.replaceState=function(data,title,url){}; + +/** + * Property sessionStorage + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @type Storage + * @memberOf Window + */ +Window.prototype.sessionStorage=new Storage(); + +/** + * Property localStorage + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @type Storage + * @memberOf Window + */ +Window.prototype.localStorage=new Storage(); + +/** + * Object Storage + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + */ +function Storage(){}; +Storage.prototype=new Object(); + +/** + * Property length + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @type Number + * @memberOf Storage + */ +Storage.prototype.length=new Number(); + +/** + * function key(index) + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @param {Number} index + * @memberOf Storage + * @returns String + */ +Storage.prototype.key=function(index){return new String();}; + +/** + * function getItem(key) + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @param {String} key + * @memberOf Storage + * @returns String + */ +Storage.prototype.getItem=function(key){return new String();}; + +/** + * function setItem(key,value) + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @param {String} key + * @param {String} value + * @memberOf Storage + */ +Storage.prototype.setItem=function(key,value){}; + +/** + * function removeItem(key) + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @param {String} key + * @memberOf Storage + */ +Storage.prototype.removeItem=function(key){}; + +/** + * function clear() + * http://www.w3.org/TR/2011/CR-webstorage-20111208 + * @memberOf Storage + */ +Storage.prototype.clear=function(){}; + +/** + * Object WebSocket + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @constructor + * @param {String} url + */ +function WebSocket(url){}; +WebSocket.prototype=new Object(); + +/** + * Constant WebSocket.CONNECTING=0 + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @constant + * @type Number + */ +WebSocket.prototype.CONNECTING=0; + +/** + * Constant WebSocket.OPEN=1 + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @constant + * @type Number + */ +WebSocket.prototype.OPEN=1; + +/** + * Constant WebSocket.CLOSING=2 + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @constant + * @type Number + */ +WebSocket.prototype.CLOSING=2; + +/** + * Constant WebSocket.CLOSED=3 + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @constant + * @type Number + */ +WebSocket.prototype.CLOSED=3; + +/** + * Property url + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @type String + * @memberOf WebSocket + */ +WebSocket.prototype.url=new String(); + +/** + * Property readyState + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @type Number + * @memberOf WebSocket + */ +WebSocket.prototype.readyState=new Number(); + +/** + * Property bufferedAmount + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @type Number + * @memberOf WebSocket + */ +WebSocket.prototype.bufferedAmount=new Number(); + +/** + * Property extensions + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @type String + * @memberOf WebSocket + */ +WebSocket.prototype.extensions=new String(); + +/** + * Property protocol + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @type String + * @memberOf WebSocket + */ +WebSocket.prototype.protocol=new String(); + +/** + * Property binaryType + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @type String + * @memberOf WebSocket + */ +WebSocket.prototype.binaryType=new String(); + +/** + * function close(code,reason) + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @param {Number} code - optional + * @param {String} reason - optional + * @memberOf WebSocket + */ +WebSocket.prototype.close=function(code,reason){}; + +/** + * function send(data) + * http://www.w3.org/TR/2012/CR-websockets-20120920 + * @param {Object} data - may be a String, Blob, ArrayBuffer, or ArrayBufferView + * @memberOf WebSocket + */ +WebSocket.prototype.send=function(data){}; + +/** + * Property geolocation + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Geolocation + * @memberOf Navigator + */ +Navigator.prototype.geolocation=new Geolocation(); + +/** + * Object Geolocation + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + */ +function Geolocation(){}; +Geolocation.prototype=new Object(); + +/** + * function getCurrentPosition(successCallback,errorCallback,options) + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510/ + * @param {Function} successCallback (Position pos) + * @param {Function} errorCallback (PositionError error) - optional + * @param {PositionOptions} options - optional + * @memberOf Geolocation + */ +Geolocation.prototype.getCurrentPosition=function(successCallback,errorCallback,options){}; + +/** + * function watchPosition(successCallback,errorCallback,options) + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510/ + * @param {Function} successCallback (Position pos) + * @param {Function} errorCallback (PositionError error) - optional + * @param {PositionOptions} options - optional + * @memberOf Geolocation + * @returns {Number} + */ +Geolocation.prototype.watchPosition=function(successCallback,errorCallback,options){return new Number();}; + +/** + * function clearWatch(watchId) + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @param {Number} watchId + * @memberOf Geolocation + */ +Geolocation.prototype.clearWatch=function(watchId){}; + +/** + * Object Coordinates + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + */ +function Coordinates(){}; +Coordinates.prototype=new Object(); + +/** + * Property latitude + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.latitude=new Number();; + +/** + * Property longitude + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.longitude=new Number();; + +/** + * Property altitude + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.altitude=new Number();; + +/** + * Property accuracy + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.accuracy=new Number();; + +/** + * Property altitudeAccuracy + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.altitudeAccuracy=new Number();; + +/** + * Property heading + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.heading=new Number();; + +/** + * Property speed + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Coordinates + */ +Coordinates.prototype.speed=new Number(); + +/** + * Object Position + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + */ +function Position(){}; +Position.prototype=new Object(); + +/** + * Property coords + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Coordinates + * @memberOf Position + */ +Position.prototype.coords=new Coordinates(); + +/** + * Property timestamp + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf Position + */ +Position.prototype.timestamp=new Number; + +/** + * Object PositionError + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + */ +function PositionError(){}; +PositionError.prototype=new Object(); + +/** + * Constant PositionError.PERMISSION_DENIED=1 + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @constant + * @type Number + */ +PositionError.prototype.PERMISSION_DENIED=1; + +/** + * Constant PositionError.POSITION_UNAVAILABLE=2 + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @constant + * @type Number + */ +PositionError.prototype.POSITION_UNAVAILABLE=2; + +/** + * Constant PositionError.TIMEOUT=3 + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @constant + * @type Number + */ +PositionError.prototype.TIMEOUT=3; + +/** + * Property code + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf PositionError + */ +PositionError.prototype.code=new Number(); + +/** + * Property message + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type String + * @memberOf PositionError + */ +PositionError.prototype.message=new String(); + +/** + * Object PositionOptions + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + */ +function PositionOptions(){}; +PositionOptions.prototype=new Object(); + +/** + * Property enableHighAccuracy + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Boolean + * @memberOf PositionOptions + */ +PositionOptions.prototype.enableHighAccuracy=new Boolean(); + +/** + * Property timeout + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf PositionOptions + */ +PositionOptions.prototype.timeout=new Number(); + +/** + * Property maximumAge + * http://www.w3.org/TR/2012/PR-geolocation-API-20120510 + * @type Number + * @memberOf PositionOptions + */ +PositionOptions.prototype.maximumAge=new Number(); + +/** + * Object TimeRanges + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + */ +function TimeRanges(){}; +TimeRanges.prototype=new Object(); + +/** + * Property length + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf TimeRanges + */ +TimeRanges.prototype.length=new Number(); + +/** + * function start(index) + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @param {Number} index + * @memberOf TimeRanges + * @returns {Number} + */ +function start(index) {return new Number();}; + +/** + * function end(index) + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @param {Number} index + * @memberOf TimeRanges + * @returns {Number} + */ +function end(index) {return new Number();}; + +/** + * Object MediaError + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + */ +function MediaError(){}; +MediaError.prototype=new Object(); + +/** + * Constant MediaError.MEDIA_ERR_ABORTED=1 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +MediaError.prototype.MEDIA_ERR_ABORTED=1; + +/** + * Constant MediaError.MEDIA_ERR_NETWORK=2 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +MediaError.prototype.MEDIA_ERR_NETWORK=2; + +/** + * Constant MediaError.MEDIA_ERR_DECODED=3 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +MediaError.prototype.MEDIA_ERR_DECODE=3; + +/** + * Constant MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED=4 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +MediaError.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4; + +/** + * Property code + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf MediaError + */ +MediaError.prototype.code=new Number(); + +/** + * Object HTMLMediaElement + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @augments HTMLElement + * @see HTMLElement + */ +function HTMLMediaElement(){}; +HTMLMediaElement.prototype = new HTMLElement(); + +/** + * Property src + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type String + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.src=new String(); + +/** + * Property currentSrc + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type String + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.currentSrc=new String(); + +/** + * Property crossOrigin + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type String + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.crossOrigin=new String(); + +/** + * Constant HTMLMediaElement.NETWORK_EMPTY=0 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.NETWORK_EMPTY=0; + +/** + * Constant HTMLMediaElement.NETWORK_IDLE=1 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.NETWORK_IDLE=1; + +/** + * Constant HTMLMediaElement.NETWORK_LOADING=2 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.NETWORK_LOADING=2; + +/** + * Constant HTMLMediaElement.NETWORK_NO_SOURCE=3 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.NETWORK_NO_SOURCE=3; + +/** + * Property networkState + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.networkState=new Number(); + +/** + * Property preload + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type String + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.preload=new String(); + +/** + * Property buffered + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type TimeRanges + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.buffered=new TimeRanges(); + +/** + * function load() + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.load=function(){}; + +/** + * function canPlayType(type) + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @param {String} type + * @memberOf HTMLMediaElement + * @returns {String} + */ +HTMLMediaElement.prototype.canPlayType=function(type){new String();}; + +/** + * Constant HTMLMediaElement.HAVE_NOTHING=0 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.HAVE_NOTHING=0; + +/** + * Constant HTMLMediaElement.HAVE_METADATA=1 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.HAVE_METADATA=1; + +/** + * Constant HTMLMediaElement.HAVE_CURRENT_DATA=2 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.HAVE_CURRENT_DATA=2; + +/** + * Constant HTMLMediaElement.HAVE_FUTURE_DATA=3 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.HAVE_FUTURE_DATA=3; + +/** + * Constant HTMLMediaElement.HAVE_ENOUGH_DATA=4 + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @constant + * @type Number + */ +HTMLMediaElement.prototype.HAVE_ENOUGH_DATA=4; + +/** + * Property readyState + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.readyState=new Number(); + +/** + * Property seeking + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.seeking=new Boolean(); + +/** + * Property currentTime + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.currentTime=new Number(); + +/** + * Property initialTime + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.initialTime=new Number(); + +/** + * Property duration + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.duration=new Number(); + +/** + * Property startOffsetTime + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Date + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.startOffsetTime=new Date(); + +/** + * Property paused + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.paused=new Boolean(); + +/** + * Property defaultPlaybackRate + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.defaultPlaybackRate=new Number(); + +/** + * Property playbackRate + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.playbackRate=new Number(); + +/** + * Property played + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type TimeRanges + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.played=new TimeRanges(); + +/** + * Property seekable + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type TimeRanges + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.seekable=new TimeRanges(); + +/** + * Property ended + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.ended=new Boolean(); + +/** + * Property autoplay + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.autoplay=new Boolean(); + +/** + * Property loop + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.loop=new Boolean(); + +/** + * function play() + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.play=function(){}; + +/** + * function pause() + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.pause=function(){}; + +/** + * Property controls + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.controls=new Boolean(); + +/** + * Property volume + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.volume=new Number(); + +/** + * Property muted + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.muted=new Boolean(); + +/** + * Property defaultMuted + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Boolean + * @memberOf HTMLMediaElement + */ +HTMLMediaElement.prototype.defaultMuted=new Boolean(); + +/** + * Object HTMLAudioElement + * http://www.w3.org/TR/2012/WD-html5-20120329/the-audio-element.html + * @augments HTMLMediaElement + * @constructor + * @param {String} src + * @see HTMLMediaElement + */ +function HTMLAudioElement(src){}; +HTMLAudioElement.prototype = new HTMLMediaElement(); + +/** + * Object HTMLVideoElement + * http://www.w3.org/TR/2012/WD-html5-20120329/the-audio-element.html + * @augments HTMLMediaElement + * @see HTMLMediaElement + */ +function HTMLVideoElement(){}; +HTMLVideoElement.prototype = new HTMLMediaElement(); + +/** + * Property width + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLVideoElement + */ +HTMLVideoElement.prototype.width=new Number(); + +/** + * Property height + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLVideoElement + */ +HTMLVideoElement.prototype.height=new Number(); + +/** + * Property videoWidth + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLVideoElement + */ +HTMLVideoElement.prototype.videoWidth=new Number(); + +/** + * Property videoHeight + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type Number + * @memberOf HTMLVideoElement + */ +HTMLVideoElement.prototype.videoHeight=new Number(); + +/** + * Property poster + * http://www.w3.org/TR/2012/WD-html5-20120329/media-elements.html + * @type String + * @memberOf HTMLVideoElement + */ +HTMLVideoElement.prototype.poster=new String(); + diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/system.js b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/system.js new file mode 100644 index 0000000..2066ffb --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/system.js @@ -0,0 +1,1458 @@ +/******************************************************************************* + * Copyright (c) 2008, 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + ****************************************************************************** +* Please see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html +*/ + +/** + * Object Object() + * @constructor + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Object(){}; + /** + * function toString() + * @memberOf Object + * @returns {String} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.toString = function(){return "";}; + /** + * function toLocaleString() + * @memberOf Object + * @returns {String} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.toLocaleString = function(){return "";}; + /** + * function valueOf() + * @memberOf Object + * @returns {Object} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.valueOf = function(){return new Object();}; + /** + * function hasOwnProperty(name) + * @memberOf Object + * @param {String} name + * @returns {Boolean} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.hasOwnProperty = function(name){return true;}; + /** + * function isPrototypeOf(o) + * @memberOf Object + * @param {Object} o + * @returns {Boolean} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.isPrototypeOf = function(o){return true;}; + /** + * function propertyIsEnumerable(name) + * @memberOf Object + * @param {Object} name + * @returns {Boolean} + * @see Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.propertyIsEnumerable = function(name){return true;}; +/** + * Property constructor + * @type Function + * @memberOf Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Object.prototype.constructor = new Function(); + +/** + * Object String() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function String(){} +String.prototype = new Object(); +/** + * static function fromCharCode(charCode1, ...) + * @memberOf String + * @param {Number} charCode + * @returns {String} + * @static + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.fromCharCode = function(charCode){return "";}; +/** + * Property length + * @type Number + * @memberOf String + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.length = 1; + /** + * function charAt(position) + * @memberOf String + * @param {Number} position + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.charAt = function(position){return "";}; + /** + * function charCodeAt(position) + * @memberOf String + * @param {Number} position + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.charCodeAt = function(position){return 0;}; + /** + * function concat(value1, ...) + * @memberOf String + * @param {String} value + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.concat = function(value){return "";}; + /** + * function indexOf(searchString, startPosition) + * @memberOf String + * @param {String} searchString + * @param {Number} startPosition + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.indexOf = function(searchString, startPosition){return 1;}; + /** + * function lastIndexOf(searchString, startPosition) + * @memberOf String + * @param {String} searchString + * @param {Number} startPosition + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.lastIndexOf = function(searchString, startPosition){return 1;}; + /** + * function localeCompare(otherString) + * @memberOf String + * @param {String} otherString + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.localeCompare = function(otherString){return 0;}; + /** + * function match(regexp) + * @memberOf String + * @param {RegExp} regexp + * @returns {Array} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.match = function(regexp){return [];}; + /** + * function replace(regexp, replaceValue) + * @memberOf String + * @param {RegExp} regexp + * @param {String} replaceValue + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.replace = function(regexp, replaceValue){return "";}; + /** + * function search(regexp) + * @memberOf String + * @param {RegExp} regexp + * @returns {Number} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.search = function(regexp){return 1;}; + /** + * function slice(start, end) + * @memberOf String + * @param {Number} start + * @param {Number} end + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.slice = function(start, end){return "";}; + /** + * function split(separator, limit) + * @memberOf String + * @param {String} separator + * @param {Number} limit + * @returns {Array} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.split = function(separator, limit){return [];}; + /** + * function substring(start, end) + * @memberOf String + * @param {Number} start + * @param {Number} end + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.substring = function(start, end){return "";}; + /** + * function toLowerCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toLowerCase = function(){return "";}; + /** + * function toLocaleLowerCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toLocaleLowerCase = function(){return "";}; + /** + * function toUpperCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toUpperCase= function (){return "";}; + /** + * function toLocaleUpperCase() + * @memberOf String + * @returns {String} + * @see String + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +String.prototype.toLocaleUpperCase = function(){return "";}; + +/** + * Object Number() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Number(){} +Number.prototype = new Object(); +/** + * property MIN_VALUE + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.MIN_VALUE = 0; +/** + * property MAX_VALUE + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.MAX_VALUE = 0 ; +/** + * property NaN + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.NaN = 0; +/** + * property NEGATIVE_INFINITY + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.NEGATIVE_INFINITY = 0; +/** + * property POSITIVE_INFINITY + * @type Number + * @memberOf Number + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.POSITIVE_INFINITY = 0; +/** + * function toFixed(fractionDigits) + * @memberOf Number + * @param {Number} fractionDigits + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Number.prototype.toFixed = function(fractionDigits){return "";}; +/** + * function toExponential(fractionDigits) + * @memberOf Number + * @param {Number} fractionDigits + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Number.prototype.toExponential = function(fractionDigits){return "";}; +/** + * function toPrecision(precision) + * @memberOf Number + * @param {Number} fractionDigits + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Number.prototype.toPrecision = function(fractionDigits){return "";}; + +/** + * Object Boolean() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function Boolean(){}; +Boolean.prototype = new Object(); + +/** + * Object Array() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Array(){}; +Array.prototype = new Object(); +/** + * Property length + * @type Number + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.length = 1; +/** + * function concat(args) + * @param {Array} args + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.concat = function(args){return [];}; +/** + * function join(seperator) + * @param {String} seperator + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.join = function(seperator){return [];}; +/** + * function pop() + * @returns {Object} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.pop = function(){return new Object();}; +/** + * function push(args) + * @param {Array} args + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.push = function(args){}; +/** + * function reverse() + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.reverse = function(){return [];}; +/** + * function shift() + * @returns {Object} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.shift = function(){return new Object();}; +/** + * function slice(start, end) + * @param {Number} start + * @param {Number} end + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.slice = function(start, end){return [];}; +/** + * function sort(funct) + * @param {Function} funct + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.sort = function(funct){return [];}; +/** + * function splice(start, deletecount, items) + * @param {Number} start + * @param {Number} deletecount + * @param {Array} items + * @returns {Array} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.splice = function(start, deletecount, items){return [];}; +/** + * function unshift(items) + * @param {Object} values + * @returns {Number} + * @memberOf Array + * @see Array + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Array.prototype.unshift = function(values){return 1;}; + +/** + * Object Function() + * @constructor + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Function(){}; +Function.prototype = new Object(); +/** + * function apply (thisObject, argArray) + * @param {Object} thisObject + * @param {Array} argArray + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Function.prototype.apply = function(thisArg, argArray){return new Object();}; +/** + * function call (thisObject, args) + * @param {Object} thisObject + * @param {Object} args + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Function.prototype.call = function(thisObject, args){return new Object();}; +/** + * property length + * @type Number + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Function.prototype.length = 0; + +/** + * Object Date(s) + * @constructor + * @param {String} s + * @extends Object + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Date(s){}; +Date.prototype = new Object(); +/** + * function UTC(hour, min, sec, ms) + * @memberOf Date + * @param {Number} hour + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @returns {Number} + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Date.UTC = function(hour, min, sec, ms){return 0;}; +/** + * function parse(string) + * @memberOf Date + * @param {String} string + * @returns {Number} + * @static + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.parse = function(string){return 0;}; +/** + * function toDateString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toDateString = function(){return "";}; +/** + * function toTimeString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toTimeString = function(){return "";}; +/** + * function toLocaleString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toLocaleString = function(){return "";}; +/** + * function toLocaleDateString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toLocaleDateString = function(){return "";}; +/** + * function toLocaleTimeString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.toLocaleTimeString = function(){return "";}; +/** + * function valueOf() + * @memberOf Date + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.valueOf = function(){return new Object();}; +/** + * function getFullYear() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getFullYear = function(){return 0;}; +/** + * function getTime() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getTime = function(){return 0;}; +/** + * function getUTCFullYear() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCFullYear = function(){return 0;}; +/** + * function getMonth() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getMonth = function(){return 0;}; +/** + * function getUTCMonth() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCMonth = function(){return 0;}; +/** + * function getDate() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getDate = function(){return 0;}; +/** + * function getUTCDate() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCDate = function(){return 0;}; +/** + * function getDay() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getDay = function(){return 0;}; +/** + * function getUTCDay() + * @memberOf Date + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + */ +Date.prototype.getUTCDay=function(){return 0;}; +/** + * function getHours() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getHours = function(){return 0;}; +/** + * function getUTCHours() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCHours = function(){return 0;}; +/** + * function getMinutes() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getMinutes = function(){return 0;}; +/** + * function getUTCMinutes() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCMinutes = function(){return 0;}; +/** + * function getSeconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getSeconds = function(){return 0;}; +/** + * function getUTCSeconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCSeconds = function(){return 0;}; +/** + * function getMilliseconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getMilliseconds = function(){return 0;}; +/** + * function getUTCMilliseconds() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getUTCMilliseconds = function(){return 0;}; +/** + * function getTimezoneOffset() + * @memberOf Date + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.getTimezoneOffset = function(){return 0;}; +/** + * function setTime(value) + * @memberOf Date + * @returns {Number} + * @param {Number} value + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setTime = function(value){return 0;}; + +/** + * function setMilliseconds(value) + * @memberOf Date + * @returns {Number} + * @param {Number} value + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setMilliseconds = function(value){return 0;}; +/** + * function setUTCMilliseconds(ms) + * @memberOf Date + * @returns {Number} + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCMilliseconds = function(ms){return 0;}; +/** + * function setSeconds(sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setSeconds = function(sec,ms){return 0;}; +/** + * function setUTCSeconds(sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCSeconds=function(sec,ms){return 0;}; +/** + * function setMinutes(min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setMinutes=function(min,sec,ms){return 0;}; +/** + * function setUTCMinute(min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCMinute = function(min,sec,ms){return 0;}; +/** + * function setHours(hour, min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} hour + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setHours = function(hour,min,sec,ms){return 0;}; +/** + * function setUTCHours(hour, min,sec,ms) + * @memberOf Date + * @returns {Number} + * @param {Number} hour + * @param {Number} min + * @param {Number} sec + * @param {Number} ms + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCHours = function(hour,min,sec,ms){return 0;}; + +/** + * function setDate(date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setDate = function(date){return 0;}; + +/** + * function setUTCDate(date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCDate = function(date){return 0;}; + +/** + * function setMonth(month,date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @param {Number} month + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setMonth = function(month,date){return 1;}; +/** + * function setUTCMonth(month,date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @param {Number} month + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCMonth = function(month,date){return 1;}; +/** + * function setFullYear(month,date) + * @memberOf Date + * @returns {Number} + * @param {Number} date + * @param {Number} month + * @param {Number} year + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setFullYear = function(year, month,date){return 0;}; +/** + * function setUTCFullYear(month,date) + * @memberOf Date + * @returns {Date} + * @param {Number} date + * @param {Number} month + * @param {Number} year + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Date.prototype.setUTCFullYear = function(year, month,date){}; +/** + * function toUTCString() + * @memberOf Date + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +Date.prototype.toUTCString = function(){return "";}; + +/** + * Property NaN + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +var NaN=0; +/** + * Property Infinity + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +var Infinity=0; +/** + * function eval(s) + * @param {String} s + * @type Object + * @returns {Object} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function eval(s){return new Object();}; + +//@GINO: Bug 197987 (Temp Fix) +/** + * Property debugger + * @description Debugger keyword + */ +var debugger=null; + +/** + * Property undefined + * @description undefined +*/ +var undefined=null; + +/** + * function parseInt(s,radix) + * @param {String} s + * @param {Number} radix + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function parseInt(s,radix){return 0;}; +/** + * function parseFloat(s) + * @param {String} s + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function parseFloat(s){return 0;}; +/** + * function escape(s) + * @param {String} s + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function escape(s){return "";}; +/** + * function unescape(s) + * @param {String} s + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function unescape(s){return "";}; +/** + * function isNaN(number) + * @param {String} number + * @type Boolean + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function isNaN(number){return false;}; +/** + * function isFinite(number) + * @param {String} number + * @type Boolean + * @returns {Boolean} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function isFinite(number){return false;}; +/** + * function decodeURI(encodedURI) + * @param {String} encodedURI + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function decodeURI(encodedURI){return "";}; +/** + * @param {String} uriComponent + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function decodeURIComponent(uriComponent){return "";}; +/** + * function encodeURIComponent(uriComponent) + * @param {String} uriComponent + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function encodeURIComponent(uriComponent){return "";}; + +/** + * function encodeURIComponent(URI) + * @param {String} URI + * @type String + * @returns {String} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. +*/ +function encodeURI(URI){return "";}; + +/** + * Object Math(\s) + * @super Object + * @constructor + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + + */ +function Math(){}; +Math.prototype=new Object(); +/** + * Property E + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.E=0; +/** + * Property LN10 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LN10=0; +/** + * Property LN2 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LN2=0; +/** + * Property LOG2E + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LOG2E=0; +/** + * Property LOG10E + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.LOG10E=0; +/** + * Property PI + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.PI=0; +/** + * Property SQRT1_2 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.SQRT1_2=0; +/** + * Property SQRT2 + * @memberOf Math + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.SQRT2=0; +/** + * function abs(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.abs=function(x){return 0;}; +/** + * function acos(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.acos=function(x){return 0;}; +/** + * function asin(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.asin=function(x){return 0;}; +/** + * function atan(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.atan=function(x){return 0;}; +/** + * function atan2(x,y) + * @memberOf Math + * @param {Number} x + * @param {Number} y + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.atan2=function(x,y){return 0;}; +/** + * function ceil(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.ceil=function(x){return 0;}; +/** + * function cos(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.cos=function(x){return 0;}; +/** + * function exp(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.exp=function(x){return 0;}; +/** + * function floor(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.floor=function(x){return 0;}; +/** + * function log(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.log=function(x){return 0;}; +/** + * function max(arg) + * @memberOf Math + * @param {Number} args + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.max=function(args){return 0;}; +/** + * function min(arg) + * @memberOf Math + * @param {Number} args + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.min=function(args){return 0;}; +/** + * function pow(x,y) + * @memberOf Math + * @param {Number} x + * @param {Number} y + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.pow=function(x,y){return 0;}; +/** + * function pow() + * @memberOf Math + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.random=function(){return 0;}; +/** + * function round(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.round=function(x){return 0;}; +/** + * function sin(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.sin=function(x){return 0;}; +/** + * function sqrt(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.sqrt=function(x){return 0;}; +/** + * function tan(x) + * @memberOf Math + * @param {Number} x + * @type Number + * @returns {Number} + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Math.tan=function(x){return 0;}; +/** + * Object RegExp() + * @super Object + * @constructor + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function RegExp(){}; +RegExp.prototype=new Object(); +/** + * function exec(string) + * @param {String} string + * @returns {Array} + * @type Array + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.exec=function(string){return [];}; +/** + * function test(string) + * @param {String} string + * @returns {Boolean} + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.test=function(string){return false;}; +/** + * property source + * @type String + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.source=""; +/** + * property global + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.global=false; + +/** + * property ignoreCase + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.ignoreCase=false; +/** + * property multiline + * @type Boolean + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.multiline=false; +/** + * property lastIndex + * @type Number + * @memberOf RegExp + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +RegExp.prototype.lastIndex=0; +/** + * Object Error(message) + * @super Object + * @constructor + * @param {String} message + * @memberOf Error + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function Error(message){}; +Error.prototype=new Object(); +/** + * property name + * @type String + * @memberOf Error + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Error.prototype.name=""; +/** + * property message + * @type String + * @memberOf Error + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +Error.prototype.message=""; +/** + * Object EvalError() + * @super Error + * @constructor + * + * @memberOf EvalError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function EvalError(){}; +EvalError.prototype=new Error(""); +/** + * Object RangeError() + * @super Error + * @constructor + * + * @memberOf RangeError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function RangeError(){}; +RangeError.prototype=new Error(""); +/** + * Object ReferenceError() + * @super Error + * @constructor + * + * @memberOf ReferenceError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function ReferenceError(){}; +ReferenceError.prototype=new Error(""); +/** + * Object SyntaxError() + * @super Error + * @constructor + * + * @memberOf SyntaxError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function SyntaxError(){}; +SyntaxError.prototype=new Error(""); +/** + * Object TypeError() + * @super Error + * @constructor + * + * @memberOf TypeError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function TypeError(){}; +TypeError.prototype=new Error(""); +/** + * Object URIError() + * @super Error + * @constructor + * + * @memberOf URIError + * @since Standard ECMA-262 3rd. Edition + * @since Level 2 Document Object Model Core Definition. + */ +function URIError(){}; +URIError.prototype=new Error(""); + +//support for debugger keyword +var debugger = null; \ No newline at end of file diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/xhr.js b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/xhr.js new file mode 100644 index 0000000..4d6c011 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/libraries/xhr.js @@ -0,0 +1,104 @@ +/******************************************************************************* + * Copyright (c) 2009, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + ****************************************************************************** + * + * Based on information from https://developer.mozilla.org/En/XMLHttpRequest + * and http://msdn2.microsoft.com/en-us/library/ms533062.aspx + **/ + +/** +* function createRequest +* @type XMLHttpRequest +* @memberOf Window +*/ +Window.prototype.createRequest= function(){return new XMLHttpRequest();}; +/** +* Object XMLHttpRequest +* @type constructor +*/ +XMLHttpRequest.prototype=new Object(); +function XMLHttpRequest(){}; + +/** + * function onreadystatechange + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.onreadystatechange=function(){}; +/** + * property readyState + * @type Number + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.readyState=0; +/** + * property responseText + * @type String + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.responseText=""; +/** + * property responseXML + * @type Document + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.responseXML=new Document(); +/** + * property status + * @type Number + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.status=0; +/** + * property statusText + * @type String + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.statusText=""; +/** + * function abort() + * @memberOf XMLHttpRequest + */ +XMLHttpRequest.prototype.abort=function(){}; +/** +* function getAllResponseHeaders() +* @type String +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.getAllResponseHeaders=function(){return "";}; +/** +* function open(method, url, async, username, password) +* @param {String} method +* @param {String} url +* @param {Boolean} optional async +* @param {String} optional username +* @param {String} optional password +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.open=function(method, url, async, username, password){}; +/** +* function send(body) +* @param {Object} body +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.send=function(body){}; +/** +* function setRequestHeader(header,value) +* @param {String} header +* @param {String} value +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.setRequestHeader=function(header,value){}; +/** +* function getAllResponseHeaders() +* @param {String} header +* @type String +* @memberOf XMLHttpRequest +*/ +XMLHttpRequest.prototype.getResponseHeader=function(header){return "";}; diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..3f8e74c Binary files /dev/null and b/eclipse/.metadata/.plugins/org.eclipse.wst.jsdt.core/variablesAndContainers.dat differ diff --git a/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties b/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties new file mode 100644 index 0000000..feef707 --- /dev/null +++ b/eclipse/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties @@ -0,0 +1,3 @@ +# +#Tue Feb 03 22:09:15 EST 2015 +task-tag-projects-already-scanned=Minecraft,RemoteSystemsTempFiles diff --git a/eclipse/.metadata/version.ini b/eclipse/.metadata/version.ini new file mode 100644 index 0000000..88babf1 --- /dev/null +++ b/eclipse/.metadata/version.ini @@ -0,0 +1,3 @@ +#Thu Feb 05 14:21:05 EST 2015 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.4.0.v20140925-0400 diff --git a/forge-1.7.10-10.13.2.1291-changelog.txt b/forge-1.7.10-10.13.2.1291-changelog.txt new file mode 100644 index 0000000..30fe859 --- /dev/null +++ b/forge-1.7.10-10.13.2.1291-changelog.txt @@ -0,0 +1,6581 @@ +Changelog: +Build 1291: + lukastenbrink: + Fix fluid tanks incorrectly reading NBT when empty + + If the Empty flag was set, the tank would not correctly read the data, keeping the outdated FluidStack instead. This is especially relevant with updatable TileFluidHandler TEs. + +Build 1.8-11.14.0.1290-1.8: + LexManos: + Updated FML: + MinecraftForge/FML@a55e4124531119f1c9c023cff74cfa09b49ef0e0 Save the mod list of players in their NetworkDispatcher (Make it accessable for mods) + MinecraftForge/FML@69d479d46ae658c5a5c2c00081be3df38e38c748 Fixed getEffectiveSide() for Netty Server threads + MinecraftForge/FML@0f9a33cf14165ddd424a7d82c2178cf5854bf32f Exclude only log4j2 queue from class loader + +Build 1.8-11.14.0.1289-1.8: + Parker Young: Re-enabled Icon setting for Fluids + +Build 1.8-11.14.0.1288-1.8: + jadran.kotnik: Fixed NPE when canceling ClientChatRecievedEvent. Fixes #1644 + +Build 1.8-11.14.0.1287-1.8: + LexManos: Silently eat exceptions when getting a TE's rendering bounding box, this 'fixes' Bukkit servers screwing up world data and causing clients to crash. + +Build 1.7.10-10.13.2.1286: + asiekierka: fix shouldRefresh being too broad in tile entity update + +Build 1.8-11.14.0.1285-1.8: + Chicken-Bones: Allow blocks to render in multiple layers + +Build 1.7.10-10.13.2.1284: + lumien231: Fix versionCheck config option + +Build 1.7.10-10.13.2.1283: + CovertJaguar: Bulk Chunk Data packets should also check TileEntity.shouldRefresh(). + +Build 1.8-11.14.0.1282-1.8: + LexManos: Fix potential NPE when loading a single player world where you were saved in a unloaded dimension. Closes #1575 + LexManos: Call World.init from DimensionManager.initDimension Closes #1551 + LexManos: Made Chunk.fillBlock respect TileEntity.shouldRefresh. + LexManos: Fix value passed for Item.getModel useRemaining argument. Closes #1623 + +Build 1.8-11.14.0.1281-1.8: + lumien231: Fixes #1603: Moving the start of the update thread to the pre init of the forge mod container + +Build 1.8-11.14.0.1280-1.8: + LexManos: Fix recipies for stone variants. + +Build 1.8-11.14.0.1279-1.8: + palechip: Fix Scoreboard rendering for the sidebar. + +Build 1.8-11.14.0.1278-1.8: + LexManos: Removed exclusion of white stained glass recipes in ore dictionary. + LexManos: Added chests to the ore dictionary. + LexManos: Fix crafting of non-oak fences/gates. + LexManos: Fix MC-30864 (sending web links in chat) + +Build 1.7.10-10.13.2.1277: + mattmess1221: Fix MC-30864 (sending web links in chat) + +Build 1.7.10-10.13.2.1276: + clashsoft: Fix Stained Glass pane rendering issues + +Build 1.7.10-10.13.2.1275: + Kittychanley: Removed exclusion of white stained glass recipes in ore dictionary. Closes #1502 & #1481 + +Build 1.8-11.14.0.1274-1.8: + LexManos: Fix BlockSnapshots not firing correctly due to patch mixup in 1.8 update. Closes #1591 + +Build 1.8-11.14.0.1273-1.8: + jadran.kotnik: Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping. + +Build 1.7.10-10.13.2.1272: + jadran.kotnik: Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping. + +Build 1.8-11.14.0.1271-1.8: + LexManos: Fix incorrect logic in world change clumping. + LexManos: MinecraftForge/FML@5a4d362293fe70e1421d1f22c4a195944731d6ba Finish removing marker in mapping entry names. FMLMissingMappingsEvent/FMLModIdMappingEvent should fire with correct names now. + +Build 1.7.10-10.13.2.1270: + LexManos: Remove our changes to Stitcher slot allocation. + LexManos: Fix incorrect logic in world change clumping. + +Build 1.8-11.14.0.1269-1.8: + LexManos: MinecraftForge/FML@e3785c28930a218cf9374458c67c34e7fba17922 Ensure that EntitySpawn and OpenGUI packets are handled in the world thread. Also log all errors that are thrown in FutureTasks. + LexManos: Remove our changes to Stitcher slot allocation. + +Build 1.8-11.14.0.1268-1.8: + LexManos: Fix userdev for new BlockState change. + +Build 1.8-11.14.0.1267-1.8: + rainwarrior: Added model bake event (allows mods to insert custom baked models, much like TextureStitchEvent allows to load custom textures), ISmartBlock/ItemModel (ability form models to react to block/item states), Block.getExtendedState, support for unlisted properties in block states. Includes example implementation of http://imgur.com/a/FyyJX + +Build 1.8-11.14.0.1266-1.8: + LexManos: Untie ItemModelMesher from using Item Ids internally by implementing our own simple mechanics using Trove. + +Build 1.8-11.14.0.1265-1.8: + LexManos: Fix texture stitcher not using all avalible spaces. + LexManos: Fix EnumHelper for new ArmorTexture argument. + +Build 1.7.10-10.13.2.1264: + LexManos: Fix texture stitcher not using all avalible spaces. Closes #1557 + +Build 1.7.10-10.13.2.1263: + LexManos: Fixed NPE thrown when brewing event is fired and not all slots are filled. + +Build 1.8-11.14.0.1262-1.8: + LexManos: Fixed NPE thrown when brewing event is fired and not all slots are filled. Closes #1564 + LexManos: Make daylight sensor recipe use ore dictionary wooden slabs Closes #1565 + LexManos: Fix missed patch causing Dispensed Armor to go into the wrong slot. Closes #1560 + LexManos: Fixed log spam when breaking DoublePlants. Closes #1555 + +Build 1.8-11.14.0.1261-1.8: + LexManos: Unbind Shaped/Shapeless Ore Recipies from Array list to normal List. + +Build 1.8-11.14.0.1259-1.8: + LexManos: Add quartz_ore tool init, more mojang special casing -.- + LexManos: Changed ToolMaterial's repair material to ItemStack version to allow metadata sensitive versions. + LexManos: Improved Control of Enchantment.canApplyTogether() in Mod Enchantments, allowing both enchantments to determine if they can apply together. + LexManos: Expand PlayerWakupEvent to expose the three parameters passed into EntityPlayer.wakeUp. + +Build 1.7.10-10.13.2.1258: + LexManos: Add quartz_ore tool init, more mojang special casing -.- Closes #1333 and Closes #1335 + LexManos: Fix invalid argument being passed to Block.isNormalCube from World.updateNeighbors. Closes #1339 and Closes #1346 + LexManos: Changed ToolMaterial's repair material to ItemStack version to allow metadata sensitive versions. Closes #1355 + LexManos: Improved Control of Enchantment.canApplyTogether() in Mod Enchantments, allowing both enchantments to determine if they can apply together. Closes #1434 + LexManos: Expand PlayerWakupEvent to expose the three parameters passed into EntityPlayer.wakeUp. Closes #1486 + +Build 1.8-11.14.0.1257-1.8: + LexManos: Fixed bug in ServerConfigurationManager.transferPlayerToDimension where it would send the old dimension's information. + LexManos: Add "sand" to the OreDictionary + LexManos: Cleanup deprecated code, and TODOs in OreDictionary. Down-typed things from ArrayList to List. Asking for the ores with a null stack will now throw an Exception. + LexManos: Added CreateSpawnPosition event. + LexManos: Add LivingHealEvent called from EntityLivingBase.heal() + LexManos: Added PotionBrewEvent.Pre/Post. To allow for modification and cancelation of Brewing. + +Build 1.7.10-10.13.2.1256: + LexManos: Fixed bug in ServerConfigurationManager.transferPlayerToDimension where it would send the old dimension's information. Closes #1548 + LexManos: Add "sand" to the OreDictionary Closes #1487 + LexManos: Added CreateSpawnPosition event Closes #1053 + LexManos: Add LivingHealEvent called from EntityLivingBase.heal() Closes #1282 + LexManos: Added PotionBrewEvent.Pre/Post. To allow for modification and cancelation of Brewing. Closes #1248 + +Build 1.8-11.14.0.1255-1.8: + LexManos: Added Explosion Start and Detonate events to control explosion. + +Build 1.7.10-10.13.2.1254: + LexManos: Added Explosion Start and Detonate events to control explosion. Closes #1469 + +Build 1.7.10-10.13.2.1253: + draco18s: + Update RenderBlockFluid.java + + Added tessellator calls to render the block's back faces, so that the liquid properly renders when the player is immersed in the fluid. + +Build 1.8-11.14.0.1252-1.8: + LexManos: Fix finding of spawn location for mobs. Closes #1546 + LexManos: Only call blockBreak when block itself changes, not just meta. Fixes bottles poping out of brewing stands. + +Build 1.8-11.14.0.1251-1.8: + LexManos: + Updated FML: + MinecraftForge/FML@9c8ca4a4e3c4acc4980535e5c60da169b75a7810 Unlink banner block and item id. Mojang should of matched these up but they didn't -.- + MinecraftForge/FML@84a101f344b8fc21de1201fde717fbcbcba2aa79 Update Dev mcp mappings to 11-30 snapshot. + LexManos: Remove debug patch I left in. + +Build 1.8-11.14.0.1249-1.8: + LexManos: Fix stickey pistons not retracting properly. + +Build 1.8-11.14.0.1248-1.8: + LexManos: Fixed vanilla bug where top part of double plants would flicker a tifferent texture before dissapearing. + LexManos: Fix NPE with BlockSnapshots that caused items with TileEntities to be used up in creative mode. + LexManos: Fixed vanilla issue where exceptions in World tasks would not be logged. + LexManos: Fixed blocks not breaking properly when instantly destroied. + +Build 1.8-11.14.0.1247-1.8: + LexManos: Fix BlockPane's connection detection. + +Build 1.8-11.14.0.1246-1.8: + LexManos: Fixed Entity extended properties init order. Closes #1532 + LexManos: Fixed Entities not being able to climb ladders, Closes #1535 + LexManos: Fixed snow layers not being able to stack more then twice. Closes #1534 + +Build 1.8-11.14.0.1245-1.8: + LexManos: Fix interacting with entities. + +Build 1.8-11.14.0.1244-1.8: + LexManos: Fix debug screen not showing grey background. Closes #1529 + LexManos: Fix not being able to place blocks in liquids, and related issues. + LexManos: + Updated FML: + MinecraftForge/FML@36644e97714b46dbbb24416febdde1332a3e753c Finalize modded handshakes in the World tick thread. Prevents potential CMEs when login event takes to long to fire. + +Build 1.8-11.14.0.1243-1.8: + LexManos: Fix potential NPE in Block.isToolEffective + LexManos: Update RecipeSorter for new 1.8 recipies. + LexManos: Fix destroy particles not being added. Closes #1528 + +Build 1.8-11.14.0.1242-1.8: + LexManos: Fixed crash with caomparators due to wrong position. Closes #1512 + LexManos: Fix inverted logic preventing blocks from breaking. + LexManos: Fix Entityies not taking damage correctly. Closes #1511 + LexManos: Fix wrong state being passed to Block.getDrops + +Build 1.8-11.14.0.1241-1.8: + LexManos: Fix fog colors, Closes #1524 + LexManos: Fix acedential inversion causing some tress to not have leaves. Closes #1522 + LexManos: Fix creative picking a CommandBlock minecart returning wrong item. Closes #1523 + +Build 1.7.10-10.13.2.1240: + LexManos: Fix creative picking a CommandBlock minecart returning wrong item. Closes #1523 + +Build 1.8-11.14.0.1239-1.8: + LexManos: Fix local variable conflict in Forge patch and latest MCP mappings. + +Build 1.7.10-10.13.2.1236: + xcompwiz: + Fixes client-side fake rain + + Changes the updateWeather function in WorldServer to only send the + weather info to players in the correct dimension, rather than all + players on the server. This is what causes the client-side rain, as the + client believes that it has started raining locally, rather than in + another dimension. + +Build 1.7.10-10.13.2.1235: + oliver.kahrmann: + Modify WavefrontObject to allow '.' in group object names + + Blender names objects with .001 ir .002 when separating vertices or duplicating objects and the importer would crash on them. This fixes the regex to allow dots in the name. + +Build 1.7.10-10.13.2.1234: + LexManos: Player sensitive version of Block.getPickBlock Closes #1348 + +Build 1.7.10-10.13.2.1233: + LexManos: Fix slots being black due to vanilla blending leakage Forge fixes. Closes #1325 & #1242 + +Build 1.7.10-10.13.2.1232: + luacs1998: + Create CONTRIBUTING.md + + Simple file (which github will show for those making PRs) containing guidelines for making PRs. + Feel free to comment if you want/need anything added. I can pull the same thing to FML too if you'd like, Lex. + luacs1998: + Update CONTRIBUTING.md + + Add link to wiki page on contributing + +Build 1.7.10-10.13.2.1231: + Adubbz: Fixed desert list initialization. Fixes #1447 + +Build 1.7.10-10.13.2.1230: + LexManos: Fix logic error in Blodd's Snapshot capture that caused blocks to not be updated to the client. Closes #1451 + LexManos: Bump version for new RB. + +Build 1.7.10-10.13.1.1229: + AbrarSyed: implemented crowdin support + matthewprenger: Add username cache for determining a player's last known username + azanor1: + Fix for biome weights under 10 + + This solves the problem where custom mod biomes with weights under 10 + not being generated in the world. + + Cleaned up the code and made the patch smaller + +Build 1.7.10-10.13.1.1226: + LexManos: Compleetly disable stencil bits unless told not to by using the -Dforge.forceDisplayStencil=true flag. Should solve the 'menu in bottom corner' issue with Intel Integrated graphics cards. + +Build 1.7.10-10.13.1.1225: + Parker Young: Added PlayerWakeUpEvent + +Build 1.7.10-10.13.1.1224: + Adubbz: Fixed biome weights not working with non multiples of 10 + +Build 1.7.10-10.13.1.1223: + LexManos: Fix vanilla lighting issue and blending issues in achievements gui. Closes #1445 + +Build 1.7.10-10.13.1.1222: + LexManos: MinecraftForge/FML@d00feb58c762b0bbc506d79faf1ce40bc96732e9 Remove debug code that was causing console spam in Forge. + +Build 1.7.10-10.13.1.1221: + LexManos: Disable by default the Display Stencil bits. Keep FBO bits. Acording to Mumfery and ChickenBones, it should not be nessasary and should solve the 1/4 main menu issue. Use -Dforge.forceDisplayStencil=true to enable old behavior. + +Build 1.7.10-10.13.1.1220: + jadran.kotnik: Prevent client only commands from bleeding through to the server. + +Build 1.7.10-10.13.1.1219: + jdroque: + Added PlaceEvent and MultiPlaceEvent which fires before placing a block. + + Before calling "ItemStack.tryPlaceItemInWorld", a recording flag is turned on for + setBlock to capture a blocksnapshot for each block that attempts to be placed. + + If 1 block is captured, a "BlockEvent.PlaceEvent" is fired to notify mods. + If 2 or more blocks are captured, a "BlockEvent.PlaceEvent" is fired first with the first block + captured followed by a "BlockEvent.MultiPlaceEvent" with all captured blocks. This extra event + is required for items that have the ability to place 2 or more blocks such as a BlockBed. + + If either event is cancelled, the recorded block snapshot(s), item stacksize, and item meta will + revert back to the captured snapshot(s). + If the events are not cancelled, a notification will be sent to clients and block physics will be updated. + + What this means for mods is Forge will be able to capture all player block placement automatically and fire + a PlaceEvent and/or MultiPlaceEvent. + If for whatever reason your mod does not use the standard placement methods then you will need to fire the + appropriate placement events in order to notify mods/servers. + + This commit also includes a new utility class called BlockSnapshot which is serializable. This new class is used in conjunction with + both PlaceEvent and MultiPlaceEvent in order to record a snapshot of block space before it is altered. This + allows us to restore the block(s) if an event is cancelled. The class also provides the ability to restore a snapshot + to any location using the restoreToLocation method. This should be helpful to many mods that are looking to be able + to capture block data then restore it to back to any location required. + +Build 1.7.10-10.13.1.1217: + cpw: + GIANT FML UPDATE! Bump forge revision number, and fix patches for ItemStack changes. More to come on this branch I expect. + + MinecraftForge/FML@7c5cf219042581545b6073de4e947448ffa10879 Implement STDOUT/STDERR redirection. + MinecraftForge/FML@bc78e31cb7ad4eda6e5faa173cd6b21e70a2c444 added support for \n in tooltip strings added \n test tooltip localization fixed int/double conversion error in slider entry added test slider scenario that highlighted conversion error + MinecraftForge/FML@a2908e5c596bb5502bf455d468d2b1ead0520f55 Clean up a bunch of compiler warnings. + MinecraftForge/FML@7f67523d870ae150071c67b002597542eb206725 Update realms to 1.3.2 + MinecraftForge/FML@73f23c24b85240458f352f248e885684aaff4743 Merge branch 'std-redir' of github.com:Emberwalker/FML + MinecraftForge/FML@1c6b25df740a64c94d9ba05dd7e4412515abf5bb If an IO exception comes from the datawatcher, spew it all over the console don't discard it silently. Should stop pixelmon blaming forge for their mistakes. + MinecraftForge/FML@e77da9eb2f5c58a494ed100dd4c1dd1a0c341dbf And fix the read side too, incase someone is trying to bitbang and failing. + MinecraftForge/FML@305d8950c9332c7a7f290db05e6f18ef328016e2 Make LogContext optional. This can be useful for debugging mod issues, but Apache's implementation in log4j2 is responsible for a very significant % of the overall runtime. Quite frankly this is shockingly bad performance from what is supposed to be a high performance logging framework. Anyway, until we can figure out if we can fix it, we're turning it off by default. + MinecraftForge/FML@bdfca1c8ed463a6053526c7a46a990007711e3d0 Make more noise when people screw up mod downloading and put .jar.zip in their mod folders. + MinecraftForge/FML@21084941127fc882d9968316a8f0669531e484df Add a custom version range factory method. Should hush skyboy's complaints. Closes #486 + MinecraftForge/FML@7c1e6aaa40704001231e602ceaedfa21a5df1edf Add a delegate to every item and block. this should help with renaming fun stuffs. Also, fix all the tabs from my previous commits. *sigh* + MinecraftForge/FML@61fcb4df06dc968fcc31d3e4e524e574acfdbb3b Tweak Itemstack patch to always delegate to the method call. Set the field, so it's in sync. + MinecraftForge/FML@eb8c5ab146f2eb3ad3833d40607da97831278ffb Fix nested directory for language resources. Closes MinecraftForge#1264 + MinecraftForge/FML@7c05e5f70d5387512d0bee33ef99510ee5aac739 Default collections, so that we don't crash if useDependencyInfo is true. Closes #485 + MinecraftForge/FML@9729fe23326a3d4f6b03e60b5cdaf78a484b3657 Kill net.minecraft.src warning. It hasn't served a purpose in a long time now. Closes #313 + MinecraftForge/FML@21e875ef22eef6068ccd6df1bd71cf58cba48eed AllowPlayerLogins only after the server has completed the core init tasks. Closes #372 + MinecraftForge/FML@46cfeade80ae60ad2d8cdb40c5fdfdaeeaf16d00 Add a constructor to CustomModLoadingDisplayException. Closes #387 + MinecraftForge/FML@a6eab2683a15a0cceca7a0ded6095b746cdd017b Update README.txt + MinecraftForge/FML@f75838461cf6d9c5010cbfd2d9ef5ceec03268d7 Last part is the itemstack transformer. Itemstacks should now only be loosely coupled with the items within. + MinecraftForge/FML@51f24e9e6d1bee371cf23cdfd0071de7c5175417 First draft of add alias. It is probably not properly persistent atm. + MinecraftForge/FML@2a4c6424709b20ce1e9bda0d85ce7fac47d157c2 Finally fix stupid NPE error caused by FML trying to parse the super of Object in IDEA envs. + MinecraftForge/FML@c1b1417ee168523154a0edae68c3180814eab1c7 FML now supports passing a json formatted modlist as an argument, as well as a comma separated argument list. These facilitate modpacks mostly, by meaning you don't need to duplicate mods. The modlist is arranged in the maven style, with mods referenced maven-like. + MinecraftForge/FML@3d42cda2a2cf5b24e7a25537d883260857b2107a Build.Gradle Patch + MinecraftForge/FML@20c7add8455cd16a4551ed13336a9ad4f9770cd1 Merge pull request #484 from bspkrs/master + MinecraftForge/FML@26ed4b992eb6341d52d12fb6735415ab8e3c501d Clear button list on FML fatal error screens. The hidden cancel button should not be there. Closes #497 + MinecraftForge/FML@ebe4f5c5e297d5d59ce57138810627a9c7a1b412 Merge pull request #494 from AntonBoch1244/patch-1 + MinecraftForge/FML@ad0da05f5c78d7f3c35a331e993dd6e679fc7ac9 Fix the ItemStack transformer to find the method and field so it works with srg and mcp naming. + MinecraftForge/FML@65d380181a84d35a78791e1bc3c7712cd90506f6 Extend timeout for client to 5 seconds. Should fix Forge #1322 + MinecraftForge/FML@45486a0b6dfca65c4d1dd23176d4c9d13d46b6f5 Fix almost invisible NPE in TerminalTransformer when loading a non-existant class + MinecraftForge/FML@13da3efce07653732971837709ccf4de7e4c5c8e Allow a clean way to exit the game without big ugly warnings, but with logging information available if needed. Closes #496 + MinecraftForge/FML@fda305edfea15ba2015cede72327703f273f74e3 Some more tidying up of the exit handling + MinecraftForge/FML@b087f60c3379d0767247e51cbc3f7c631fe97a08 More cleanup of exit handling, also add a couple more noise classes to the list of things ignored. + MinecraftForge/FML@d6358a466b4614cfc35b403d756fe3ef550ebf50 Cleanup override warnings + MinecraftForge/FML@af7a58b9e50dbacf63cf4b5009abc52301609e1f Update to legacylauncher 1.10 and asm 5.0.3 + MinecraftForge/FML@e6d00440a612c235013f3f92f1756811139a6de0 ItemStack swapping + MinecraftForge/FML@8597e45a0e417948db483006aa54e899f28b05ac Fix NPE from a boolean + MinecraftForge/FML@b9b9daa8a9d1cac8550561f31f118589abc0c30a Fix ups from feedback. + MinecraftForge/FML@d89165021f33fbffb4563d86b30bd261506c6ea6 Mark the promise a success in the outbound handler. + MinecraftForge/FML@2e5ccf7988385d38b964c615776f23a1718f5c27 Update for launchwrapper 1.11. Fixes java 6 compatibility. + MinecraftForge/FML@641250d8536bad3af5a036b70dae94097176b420 Fix java 8u20. Closes #501 and a bunch of other bugs too. + MinecraftForge/FML@292be72639feded03ced26d9a06a98159f7a95b7 Allow client handshake to be reset by server to support BungeeCord. + MinecraftForge/FML@092873fbe5baaee53bee67d26d2fc6d3d003f095 Merge branch 'bungeecord' of github.com:bloodmc/FML + MinecraftForge/FML@134f2f8e8865a91292386a3738bb45bad0477a4b Fix bug with entityspawn - if the entity doesn't extend livingbase, it fails to write a headyaw byte, and everything will be derped for that packet. + MinecraftForge/FML@4852de81e02e2b6c6d006abe20d8497499fdf51f Wrap the server description box a little bit shorter. Stops the overlapping. Closes #489 + cpw: + MinecraftForge/FML@4ce3e73bfe36c02b10f504f93eff1bc94d640e32 Add overloaded version of SimpleNetworkWrapper#registerMessage that takes the MessageHandler instance directly, allowing to specify the same handler for multiple messages. + MinecraftForge/FML@cbe2ccbda461ec0ecf4d776fcd19ab31930cc3f1 Add in ModType to the jar manifest. If it's present, and doesn't have value "FML" it will be skipped from the modloading cycle. This should let liteloader mods have a .jar extension. + MinecraftForge/FML@37cf0174fc62a842d132b2c2cc31e477acfba205 OK, lets make that a csv list. It'll let you be liteloader and fml in one jar file! + MinecraftForge/FML@0475b15eb1a7c35bf4959f1af40606e6ee8a9d03 Change the mods and modListFile argument handling a bit. Other tweakers will get a chance at looking at them now - they're only removed right before launch. + MinecraftForge/FML@abeac06a2e9bf8825b058fa35291165b4d1f1fb3 Two new features. ModLists can have a "parent" mod list. Circularity will result in a crash, so be careful. Mods specified in a child will override ones from a parent (using the maven group:name:classifier triple to identify - ignoring the version component) + MinecraftForge/FML@7fcfedcfef9b5fd85cd1c17aa2013fca1bacd871 Canonicalized file paths in modListFile handling with the minecraftDirectory. + MinecraftForge/FML@633fce19d4b367aed56d79e916f17296842f675c Make Keyevent also fire for key releases + MinecraftForge/FML@57ba2339b630afa22c0fdf060bf28edbf7b34d0f Merge branch 'keyup-event' of github.com:diesieben07/FML + MinecraftForge/FML@1ff048062c7f122731619258a9e5a68a6111d5dd Merge branch 'simple-netw-improve' of github.com:diesieben07/FML + cpw: MinecraftForge/FML@dc02d56195606d3ba2f1c5036fc8c0ddb67c843f Fix derp with ModType annotation. mods should load again now.. + diesieben07: Added Item#isBeaconpayment + cpw: + MinecraftForge/FML@7ab69aff2e19b349e457c1b5fcab8b3b01d22af2 Clean up import + MinecraftForge/FML@c5a90bd456230b201522c268dd9bc5e80a0b57be Is vanilla possible with this mod load, side tests. + MinecraftForge/FML@cad11f3165505e6d725411a9fc2c2ee8362f5827 Allow injecting alternative container types. This is the core support code for allowing sponge plugins! + michafla: + check for IFluidBlock (in addition to Material.liquid) when + determining render height so that non-liquids (gases) render correctly + kat.swales: Fixed Clientside GameProfile UUID being null on offline mode + cpw: + MinecraftForge/FML@63b64482e6dd4c3e2226ec002ceee549045c35ed Add jsr305 dev-time dependancy for Nullable/Nonnull annotations. Unneeded at runtime. + MinecraftForge/FML@5365f5ea3e90ec85552bdb7f1f1237c51b4ea493 Add IEventExceptionHandler for EventBus to allow special handeling exceptions that are fired while running an event. Events now track what 'phase' they are in during the execution process. Each EventPriority is a 'phase'. An exception is thrown if the event attempts to set its phase to a previous one. + +Build 1.7.10-10.13.1.1216-new: + kat.swales: Fixed Clientside GameProfile UUID being null on offline mode + +Build 1.7.10-10.13.1.1215-new: + michafla: + check for IFluidBlock (in addition to Material.liquid) when + determining render height so that non-liquids (gases) render correctly + +Build 1.7.10-10.13.1.1214-new: + cpw: + MinecraftForge/FML@7ab69aff2e19b349e457c1b5fcab8b3b01d22af2 Clean up import + MinecraftForge/FML@c5a90bd456230b201522c268dd9bc5e80a0b57be Is vanilla possible with this mod load, side tests. + MinecraftForge/FML@cad11f3165505e6d725411a9fc2c2ee8362f5827 Allow injecting alternative container types. This is the core support code for allowing sponge plugins! + +Build 1.7.10-10.13.1.1213-new: + diesieben07: Added Item#isBeaconpayment + +Build 1.7.10-10.13.1.1212-new: + cpw: MinecraftForge/FML@dc02d56195606d3ba2f1c5036fc8c0ddb67c843f Fix derp with ModType annotation. mods should load again now.. + +Build 1.7.10-10.13.1.1211-new: + cpw: + MinecraftForge/FML@4ce3e73bfe36c02b10f504f93eff1bc94d640e32 Add overloaded version of SimpleNetworkWrapper#registerMessage that takes the MessageHandler instance directly, allowing to specify the same handler for multiple messages. + MinecraftForge/FML@cbe2ccbda461ec0ecf4d776fcd19ab31930cc3f1 Add in ModType to the jar manifest. If it's present, and doesn't have value "FML" it will be skipped from the modloading cycle. This should let liteloader mods have a .jar extension. + MinecraftForge/FML@37cf0174fc62a842d132b2c2cc31e477acfba205 OK, lets make that a csv list. It'll let you be liteloader and fml in one jar file! + MinecraftForge/FML@0475b15eb1a7c35bf4959f1af40606e6ee8a9d03 Change the mods and modListFile argument handling a bit. Other tweakers will get a chance at looking at them now - they're only removed right before launch. + MinecraftForge/FML@abeac06a2e9bf8825b058fa35291165b4d1f1fb3 Two new features. ModLists can have a "parent" mod list. Circularity will result in a crash, so be careful. Mods specified in a child will override ones from a parent (using the maven group:name:classifier triple to identify - ignoring the version component) + MinecraftForge/FML@7fcfedcfef9b5fd85cd1c17aa2013fca1bacd871 Canonicalized file paths in modListFile handling with the minecraftDirectory. + MinecraftForge/FML@633fce19d4b367aed56d79e916f17296842f675c Make Keyevent also fire for key releases + MinecraftForge/FML@57ba2339b630afa22c0fdf060bf28edbf7b34d0f Merge branch 'keyup-event' of github.com:diesieben07/FML + MinecraftForge/FML@1ff048062c7f122731619258a9e5a68a6111d5dd Merge branch 'simple-netw-improve' of github.com:diesieben07/FML + +Build 1.7.10-10.13.0.1208: + zlyfire.martin: + Update README.txt + + Add in reference to running setupDecompWorkspace to get decompiled classes + +Build 1.7.10-10.13.0.1207: + bernhard.bonigl: Write the correct default value for StringList comments in the config + +Build 1.7.10-10.13.0.1206: + LexManos: Fix AIOOB in BiomeDictionary. Closes #1326 + +Build 1.7.10-10.13.0.1205: + cpw: + Attempt to properly resolve this daft metadata and TE nonsense. This might be mod impacting, if you maintain a reference to a TE via neighbour update calls - you + might see two TEs for a single setblock where previously you saw one. This is a phantom TE being created by badly written neighbour triggers - I'm looking at you + redstone. + + Anyway, with luck, this'll close a slew of bugs across Forge, IC2, MFR, TE, RC. Yeah, fun times. Thanks to LexManos, skyboy and KingLemming for helping figure this + issue out. Quite frankly, from now on, issues with phantom TEs will be mods behaving badly. Modders will need to adapt. + +Build 1.7.10-10.13.0.1204: + LexManos: Fix invalid math in GuiContainerCreative. + +Build 1.7.10-10.13.0.1203: + porcariadagata: Add ItemStack sensitive version of getItemEnchantability + +Build 1.7.10-10.13.0.1202: + LexManos: Add ability for creative tabs that have search bars to customize the text box's width, and prevent the default set of enchanted books from being displayed in those tabs. Closes #1303 Closes #1301 + +Build 1.7.10-10.13.0.1201: + abab9579: + Skylight Hooks for Minecraft Forge + + Mainly for solar/lunar eclipse. + +Build 1.7.10-10.13.0.1200: + JeanGlassmaker: Adds getLocalizedName and getUnlocalizedName to FluidStack + +Build 1.7.10-10.13.0.1199: + vazkii: Fixed items with more than 2 render passes rendering weird in first person + LexManos: Fix patch screwup in Skyboy's Fishing PR -.- + LexManos: Fix metadata for every permutation -.- Closes #1294 + t.tomkins: + Legacy Liquid Load Fix + + nbt.getString("FluidName") no longer returns null, it returns an empty string. + + This patch allows legacy liquids to be resolved once again. + +Build 1.7.10-10.13.0.1198: + DemoXin: + * Added AT for ContainerRepair.stackSizeToBeUsedInRepair (Now public) + * Added ability to AnvilUpdateEvent to alter stackSizeToBeUsedInRepair (vanilla behavior is now reproducable) + * Added AnvilRepairEvent, fired when the player removes an ItemStack from the output slot of ContainerRepair, and allows the chance to damage the anvil to be altered. + +Build 1.7.10-10.13.0.1197: + skyboy026: Add FishingHooks + skyboy026: Update FishingHooks + skyboy026: Add EntityFishHook AT + +Build 1.7.10-10.13.0.1195: + rwtema: Fixed ItemFluidContainer always draining the maximum amount, regardless of the amount remaining. + +Build 1.7.10-10.13.0.1194: + LexManos: Closes #1280 + +Build 1.7.10-10.13.0.1191: + LexManos: Fixed bug that allowed duplication of Fluids with redstone dust. Closes #1279 + +Build 1.7.10-10.13.0.1190: + idont: - Added drainFluidContainer() and getContainerCapacity() helper methods. + +Build 1.7.10-10.13.0.1189: + Adubbz: Added an event for fog rendering + +Build 1.7.10-10.13.0.1188: + cpw: + Revert old light amortization patch. It seems to be breaking chunk sending pretty badly when more + than a couple of people are online. Tests indicate it is not useful anymore. + cpw: MinecraftForge/FML@3231db9376766d619f942b6a526718daa3c68038 Sorta revert 908491d5e7ac26becdac938f38cc90d6b9d73ce1 but merge assets into the map, rather than force overwriting. Fixes skyboy's comment. + +Build 1.7.10-10.13.0.1187: + LexManos: + Updated FML: + MinecraftForge/FML@53887ac59cec8f747e21fd251f94d5a438a69114 Hacky interm solution to #1207 to buy me time to re-write FML's network protocol. + +Build 1.7.10-10.13.0.1186: + LexManos: Fixed NPE that happens sometimes when exiting the game witout fully loading a world {main a dev-time thing} + LexManos: Made skulls respect Block.isReplaceable when placing, also prevented them from deleting blocks when placed at certain angels. Closes #1233 + +Build 1.7.10-10.13.0.1185: + LexManos: + Updated FML: + MinecraftForge/FML@9d40b761974f10ec2b5868a992260792f8a98e5d Don't scan ObjectHolders if there was an error already, derpitude will ensure. + MinecraftForge/FML@76538c1781d6d6a1e4134fb317af99e6f13b46cc Add a terminal transformer and tweaker. + MinecraftForge/FML@aec9228845e50107112bd1f8693f9b4729694c8b Add ExitVisitor to the TerminalTransformer that finds and intercepts any calls to Runtime.exit or System.exit. + MinecraftForge/FML@908491d5e7ac26becdac938f38cc90d6b9d73ce1 Move LaunguageRegistry call above normal asset loading to allow resource packs to override mod's language systems. + MinecraftForge/FML@d13295e28113a1c310d5bbb90ebfe241fefabe02 Fix FMLAT manifest AccessTransformers, class loader fun! + +Build 1.7.10-10.13.0.1184: + darklime: + Changed exception message for duplicate enchantment ids to contain the + class path for both enchantments along with the enchantmnet id that has + been duplicated. + +Build 1.7.10-10.13.0.1183: + bspkrs: + Fixed missing assignment of constructor arg (thanks @Lunatrius) + + I must have edited this out when I was cleaning up my formatting commit spam. + +Build 1.7.10-10.13.0.1182: + vincent_a_lee: + Fix comment derp (+1 squashed commits) + + Squashed commits: + + [52c40bc] Fix experience orbs spawning at 32x coordinates clientside + + Add // FORGE comment + + Add // FORGE comment to clarify the purpose of the change + +Build 1.7.10-10.13.0.1181: + vincent_a_lee: + Fix chat opacity + + Add // FORGE comment + + As per convention, add // FORGE comment to clarify the purpose of the change + +Build 1.7.10-10.13.0.1180: + LexManos: + Updated FML: + MinecraftForge/FML@ab52901b8b47a525e2719cf280327e97bad7f91e Force preferIPv4Stack to true early in the load chain to combat netty loopback issues. + MinecraftForge/FML@11893fbbb76569417a415ae794494b8c1150a716 Add system property to skip doing world backups when game registry changes. This is SEVERLY ill-advised, if you do this DO NOT ask for any support. + MinecraftForge/FML@fdb6b34b8fc3f1e0c6beb7bfb940a01a309f1603 Update authlib and realms to latest json data. + MinecraftForge/FML@b3a74882b4d0d704d7061b9d896febb59ab0c269 added slider controls for numerics. default control is textbox, but slider can be used as a custom list entry class. fixed constructor javadocs in GuiConfig + MinecraftForge/FML@7c6d1f7568885ff677e34692ff87b1f0826dfd48 Merge pull request #468 from bspkrs/master + MinecraftForge/FML@692d955c1a5b6d0b8601ae88632ef42136d37393 Update tweaker login to use authlib. + MinecraftForge/FML@c2119eb1c1246ba37304d9e565b4430ed7056db1 Update realms library to 1.3.1, and implement network latch when connecting to Realms. Tested and working. + +Build 1.7.10-10.13.0.1179: + cpw: Add a system property for the stencil, in case config is not available.. + +Build 1.7.10-10.13.0.1178: + the.country.gamer: + RenderBlockOverlayEvent patch + + Fixes skewed XYZ parameters + +Build 1.7.10-10.13.0.1177: + LexManos: Fixed Enchantment.addToBookList Closes #1160 + +Build 1.7.10-10.13.0.1176: + LexManos: Add ability for modders to designate custom biome types. And remove note about automatically registering. Closes #1167 + +Build 1.7.10-10.13.0.1175: + diesieben07: Added hook for custom PotionEffect rendering in the inventory + +Build 1.7.10-10.13.0.1174: + the.country.gamer: + Added RenderBlockOverlayEvent.java + + Adds a Forge event which controls whether an overlay is rendered. + Overlays include: First-person fire, Block (when inside a block) + and water when a player is inside a water block. + + Patched for easier manipulation of event + + Fixed for Lex + + To be squashed + + Removed Contructor + + Added block XYZ parameters + + TODO, the second block overlay event’s XYZ might not be correct + Adubbz: Enhanced the Biome Dictionary with tags based on temperature, vegetation, moisture, trees and others + +Build 1.7.10-10.13.0.1172: + LexManos: Made EmeraldOre respect isReplaceableOreGen. Closes #1157 + LexManos: Added World to ChunkProviderEvent.ReplaceBiomeBlocks, and exposed metadata to End and Nether generation events. Close #1201 + +Build 1.7.10-10.13.0.1171: + tterrag1098: + Add AchievementEvent + + Allows modders to react to players receiving achievements, and cancel + them. + + Fix indentation + + More shortening + + Down to one line... + + Remove newline + +Build 1.7.10-10.13.0.1170: + LexManos: STENCIL buffer and DEPTH buffer, attempt a fix for GL errors. + +Build 1.7.10-10.13.0.1169: + Alexander Ibrahim: Added Javadoc comments for Forge Event documentation. + +Build 1.7.10-10.13.0.1168: + LexManos: MinecraftForge/FML@ac994e178a3533aa3c2ad8359aef9e5852c27a72 Scala people test your shit. + +Build 1.7.10-10.13.0.1167: + LexManos: Remove the BLEND enable in rendering damage bars. And exclicitly fix blend states in some GUI elements. + +Build 1.7.10-10.13.0.1166: + cpw: + MinecraftForge/FML@3ee86d0f3e47249030ba2309386f9120025e95c1 updated gradle wrapper to gradle 2.0 + MinecraftForge/FML@627ae73ea655277617912df48b03288ecc79ffea Merge pull request #464 from AbrarSyed/upgradle + MinecraftForge/FML@ee38c1b3f4642c567612f88070d7f9d651994aab Fix unneeded cast causing crash in new Config GUI system. + MinecraftForge/FML@eb92c35a2fa49a0fbe35a33e31cfb58e0674f78e updated run configs for GradleStart/Server classes + MinecraftForge/FML@70dcf80410a6d12c00300c00522582ee49ac4cc8 Merge pull request #465 from AbrarSyed/upgradle + MinecraftForge/FML@0ebdbe77a2b3503db43d36aec50c98ffb8366e20 Updated Scala to latest stable + MinecraftForge/FML@ddba18e6e33a9d9c5b113b1bfc0bfc82803b2607 Merge branch 'patch-1' of github.com:Soaryn/FML into scalaupdate + MinecraftForge/FML@220a37660b2656136c634b435afee6a915fc88fe Update realms to 1.2.9 + MinecraftForge/FML@abd7d0969bed5ce3d766f52b921c2b44e8ba87d2 Merge branch 'scalaupdate' + +Build 1.7.10-10.13.0.1162: + foka_12: + Added FluidStack sensitive version for Fluid's localised name + + Would be helpful for determining names for more complex FluidStacks (with tag compounds for example) + +Build 1.7.2-10.12.2.1161-mc172: + bspkrs: dupe quotes fix for category names + +Build 1.7.10-10.13.0.1160: + siribby: Add RenderItemInFrameEvent + +Build 1.7.10-10.13.0.1159: + LexManos: Fixed issue where Fire's 'fizz' would not play for the person who extinguished the fire. + +Build 1.7.10-10.13.0.1158: + ohai.iChun: Fixed inverted params in FogDensity use + +Build 1.7.10-10.13.0.1157: + LexManos: Add config option to disable attempting to creat screen with Stencil Bits. + LexManos: Add config option to specify the default spawn fuzz factor for the overworld. Closes #1190 + +Build 1.7.10-10.13.0.1156: + LexManos: Fix creative inventory tabs not blending base don items rendered. Closes #1179 + +Build 1.7.10-10.13.0.1153: + jdroque: + Fixed wrong method call in ChunkIOProvider. + + When a chunk fails to load async, we fallback to the original sync method. + In this case, it was calling the async method twice which ended up causing + a stackoverflow. + +Build 1.7.10-10.13.0.1152: + cpw: MinecraftForge/FML@db219fb287b14fea5148ecdbf07d8ff08704c66a API is now able to "provide" and "own" itself. Useful for libraries without a Mod in them. To go along with this, you can now require an API, with a version, in your mod dependency string + +Build 1.7.10-10.13.0.1151: + bspkrs: fixed compounding quotes issue with category names that require quotes when save is called more than once + +Build 1.7.10-10.13.0.1150: + LexManos: Update to 1.7.10-pre4. + LexManos: Fix flower pots not droping the items that are inside them. + cpw: MinecraftForge/FML@06ab104c9ab798af6d2726e02a238211ff8124e1 Force the descriptors to the right type for the field they're referencing. Fixes the sand issue + cpw: MinecraftForge/FML@e1529845384f4935b7c11d4d36d25db51c0b9a31 Add support for mod access transformers without a coremod requirement. Use the "FMLAT" manifest attribute, with a space separate list of files that live in the 'META-INF' directory. They should conform to standard AT formatting. + cpw: + MinecraftForge/FML@5d6dc5dce37e488188d6fc468c16e8a6183a3610 Fix up other exit points. Should stop process hangs for clean exits. + MinecraftForge/FML@8a240ec3c7e4cf4c57beabdfe9bd408e57de1bdc Merge branch 'master' into mc179 + MinecraftForge/FML@0cd5ef6bb71cda1ef6add892d1247148bf1ecc15 Fix NPE when no FMLAT is defined + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + MinecraftForge/FML@96a7e14a45404449fb72af6d2d5e1efd30003318 Merge branch 'master' into mc179 + MinecraftForge/FML@f45f18b1d71e1c1d12582faa337a19e73ed5fb18 Fix accessing guava from transformers + MinecraftForge/FML@8f7adced471951c798cfa6844b0abc176c93d19b Fix library issue. mojang auth requests newer libs, so we get them at dev time. But the mojang json doesn't refer them at runtime. So there's a lib mismatch. Fortunately all are available at mojang, so we can update the json. + cpw: Fix new method with Side.CLIENT when it shouldn't have it. Closes a bunch of reports of problems. + cpw: Clean patch cruft. + cpw: Fix mcp release number + luacs1998: + Update mc version string + + Or was I not supposed to? + cpw: Fix API incompatibilities. Should mean mods will work with new config changes. + cpw: + Update to MC 1.7.10, bump to 10.13.0 + + MinecraftForge/FML@bc420dcb0b086899e2aaa218a6f5bd7e91091a90 Fix Eclipse launching attribute + MinecraftForge/FML@1e0134a1ca97a1107ebbe604e5318e6f350fe9c4 Merge pull request #455 from rumickon/feature + MinecraftForge/FML@1c5db211afc9962fedb7fd8450abc45d07807634 Update for release 1.7.10 + MinecraftForge/FML@79a0c5e55905f0f08471d026b744a563ea421236 Merge branch 'mc179' + +Build 1.7.10_pre4-10.12.2.1149-prerelease: + cpw: Fix API incompatibilities. Should mean mods will work with new config changes. + +Build 1.7.10_pre4-10.12.2.1148-prerelease: + luacs1998: + Update mc version string + + Or was I not supposed to? + +Build 1.7.2-10.12.2.1147: + cpw: Fix API incompatibilities. Should mean mods will work with new config changes. + +Build 1.7.10_pre4-10.12.2.1146-prerelease: + bspkrs: + Added support for new FML config GUI classes + refactored lots of stuff based on comments + + added Configuration.load() exception handling and logging + cpw: MinecraftForge/FML@5d6dc5dce37e488188d6fc468c16e8a6183a3610 Fix up other exit points. Should stop process hangs for clean exits. + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + cpw: Fix mcp release number + +Build 1.7.2-10.12.2.1145: + bspkrs: + Added support for new FML config GUI classes + refactored lots of stuff based on comments + + added Configuration.load() exception handling and logging + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + +Build 1.7.10_pre4-10.12.2.1144-prerelease: + cpw: Clean patch cruft. + +Build 1.7.10_pre4-10.12.2.1143-prerelease: + cpw: Fix new method with Side.CLIENT when it shouldn't have it. Closes a bunch of reports of problems. + +Build 1.7.10_pre4-10.12.2.1142-prerelease: + cpw: + MinecraftForge/FML@701d98eafa4d55144b166d26030818baa9b2f680 Added config GUI system + MinecraftForge/FML@50164db5c13c85636c7fda0e13bae1fc0aedc745 Merge branch 'master' of github.com:bspkrs/FML into bspkrsgui + MinecraftForge/FML@7eb36a1481aea9f68fa46bc199195769b27d904b Merge branch 'bspkrsgui' + MinecraftForge/FML@96a7e14a45404449fb72af6d2d5e1efd30003318 Merge branch 'master' into mc179 + MinecraftForge/FML@f45f18b1d71e1c1d12582faa337a19e73ed5fb18 Fix accessing guava from transformers + MinecraftForge/FML@8f7adced471951c798cfa6844b0abc176c93d19b Fix library issue. mojang auth requests newer libs, so we get them at dev time. But the mojang json doesn't refer them at runtime. So there's a lib mismatch. Fortunately all are available at mojang, so we can update the json. + +Build 1.7.10_pre4-10.12.2.1141-prerelease: + cpw: + MinecraftForge/FML@5d6dc5dce37e488188d6fc468c16e8a6183a3610 Fix up other exit points. Should stop process hangs for clean exits. + MinecraftForge/FML@8a240ec3c7e4cf4c57beabdfe9bd408e57de1bdc Merge branch 'master' into mc179 + MinecraftForge/FML@0cd5ef6bb71cda1ef6add892d1247148bf1ecc15 Fix NPE when no FMLAT is defined + +Build 1.7.10_pre4-10.12.2.1139-prerelease: + cpw: MinecraftForge/FML@e1529845384f4935b7c11d4d36d25db51c0b9a31 Add support for mod access transformers without a coremod requirement. Use the "FMLAT" manifest attribute, with a space separate list of files that live in the 'META-INF' directory. They should conform to standard AT formatting. + +Build 1.7.10_pre4-10.12.2.1138-prerelease: + cpw: MinecraftForge/FML@06ab104c9ab798af6d2726e02a238211ff8124e1 Force the descriptors to the right type for the field they're referencing. Fixes the sand issue + +Build 1.7.10-pre4-10.12.2.1135-prerelease: + LexManos: Fix flower pots not droping the items that are inside them. + +Build 1.7.2-10.12.2.1133: + Christian: Null check the Item in the supplied stack as well as the stack itself. + +Build 1.7.2-10.12.2.1132: + Christian: And fix firing for single player loading. + +Build 1.7.2-10.12.2.1131: + Christian: Fix derpity derp. + +Build 1.7.2-10.12.2.1130: + Christian: + Fire an event when a player loads or saves from disk. Mods that want to load an additional + player related file from the players dir can now do so in that event. + +Build 1.7.2-10.12.2.1129: + Christian: + Some patch offsets + MinecraftForge/FML@7219061b05db73d245405ef777b412d0787398b6 Also patch in warnings for Vec3Pool - similarly removed. + MinecraftForge/FML@dff22045587b37282adeb2167486a572f51f1f16 FML now sets a security manager (FINALLY!). It's primary purpose at this point is to catch rogue calls to System.exit so that they can cause a proper crash report, rather than silently abandoning the game. + +Build 1.7.2-10.12.2.1128: + lumien231: Fixes a server crash caused by a player joining that is in a non existent dimension + +Build 1.7.2-10.12.2.1127: + thog92: Add missing 1.7 biomes to BiomeDictionary + +Build 1.7.2-10.12.2.1126: + nemesis: + Fixed ArrayIndexOutOfBoundsException in getOreName + + Added sanity check to prevent ArrayIndexOutOfBoundsException in getOreName for negative ids. + +Build 1.7.2-10.12.2.1125: + LexManos: Fixed vines generation for hanging off of trees. + +Build 1.7.2-10.12.2.1124: + jdroque: + Don't call ChunkDataEvent.Load async + + ChunkDataEvent.Load must be called after TE's are loaded since this is + what mods expect. The event is handled by ChunkIOProvider during + callStage2. + +Build 1.7.2-10.12.2.1123: + jdroque: + Load chunks asynchronously for players. + + When a player triggers a chunk load via walking around or teleporting + there is no need to stop everything and get this chunk on the main thread. + The client is used to having to wait some time for this chunk and the + server doesn't immediately do anything with it except send it to the + player. At the same time chunk loading is the last major source of file IO + that still runs on the main thread. + + These two facts make it possible to offload chunks loaded for this reason + to another thread. However, not all parts of chunk loading can happen off + the main thread. For this we use the new AsynchronousExecutor system to + split chunk loading in to three pieces. The first is loading data from + disk, decompressing it, and parsing it in to an NBT structure. The second + piece is creating entities and tile entities in the chunk and adding them + to the world, this is still done on the main thread. The third piece is + informing everyone who requested a chunk load that the load is finished. + For this we register callbacks and then run them on the main thread once + the previous two stages are finished. + + There are still cases where a chunk is needed immediately and these will + still trigger chunk loading entirely on the main thread. The most obvious + case is plugins using the API to request a chunk load. We also must load + the chunk immediately when something in the world tries to access it. In + these cases we ignore any possibly pending or in progress chunk loading + that is happening asynchronously as we will have the chunk loaded by the + time they are finished. + + The hope is that overall this system will result in less CPU time and + pauses due to blocking file IO on the main thread thus giving more + consistent performance. Testing so far has shown that this also speeds up + chunk loading client side although some of this is likely to be because + we are sending less chunks at once for the client to process. + + Thanks for ammaraskar for help with the implementation of this feature. + + This commit is based off the following : + + Bukkit/CraftBukkit@b8fc6ab2c12e9b4c8d7b5370e44f23cc838014b2 + Bukkit/CraftBukkit@85f5776df2a9c827565e799f150ae8a197086a98 + Bukkit/CraftBukkit@0714971ca2a31bc729bdd78ded8c69ffb2284813 + Bukkit/CraftBukkit@7f49722f457dcc31f8cac8e011871ff1b7fd3306 + Bukkit/CraftBukkit@53ad0cf1abe9c060ef411a86e9a16352f3e5197e + +Build 1.7.2-10.12.2.1122: + antoine.lucas.33: Add missing onLivingJump calls + +Build 1.7.2-10.12.2.1121: + LexManos: Pop version for new Recomended build. + +Build 1.7.2-10.12.1.1120: + Christian: Warn when chunks are being self-recursively loaded. This can cause serious issues. Modders should watch out. + Christian: MinecraftForge/FML@1a99ec7db612f258983c6ac685da906bf7cde0a6 Deprecate getAABBPool so people can stop using it in mods. Failure to do so will result in 1.7.10 upgrade incompatibility. Use getBoundingBox instead. + +Build 1.7.2-10.12.1.1119: + LexManos: Changed dustLapis to gemLapis to make OM SHUT THE HELL UP. + +Build 1.7.2-10.12.1.1118: + LexManos: Fixed missed metadata offset, and now cache return values of getOres for speed. + +Build 1.7.2-10.12.1.1117: + cojomax99: World fog color and density can now be controlled through an event + +Build 1.7.2-10.12.1.1116: + diesieben07: Fix not being able to change target & attackDamage for EnderTeleportEvent. + +Build 1.7.2-10.12.1.1115: + LexManos: Fixed inverted player parameters in PlayerEvent.Clone, Closes #1142 Closes #1140 + +Build 1.7.2-10.12.1.1114: + LexManos: Changed EntityWolf to EntityTameable in EntityLivingBase.attackEntityFrom, to allow for more custom pets. Closes #1141 + +Build 1.7.2-10.12.1.1113: + LexManos: Rework OreDictionary's internals to be a bit more speedy to help combat modders using it inapropriatly. Closes #1022 Closes #1131 + +Build 1.7.2-10.12.1.1112: + Christian: + MinecraftForge/FML@e3ce211cc798f4d86ca6f974d9ba8b4e389b4dc9 Nullcheck the dispatchers on players. Should stop some crashes when spamming connectivity. + MinecraftForge/FML@480bf2c1d078038bb59c4254a01a5af685c7cb22 Fix REPLY handling in SimpleNetworkWrapper. Closes #440 + +Build 1.7.2-10.12.1.1111: + LexManos: + Fix inverted parameters in OreDictionary.getOreID Closes #1123 + -.- Closes #1120 + +Build 1.7.2-10.12.1.1110: + Adubbz: Greatly simplified the addition of new biomes to the default world + +Build 1.7.2-10.12.1.1109: + LexManos: Added Noteblock change and play events. Closes #1027 #1025 + +Build 1.7.2-10.12.1.1108: + LexManos: Add target world to PlayerInteractEvent for potential 'cross dimension' interaction such as LittleBlocks. Closes #1071 + +Build 1.7.2-10.12.1.1107: + LexManos: Add a couple of localizations to Forge added strings. Closes #1068 + +Build 1.7.2-10.12.1.1106: + rwtema: Fixed setBlock not using the location-specific version of getLightOpacity() + +Build 1.7.2-10.12.1.1105: + LexManos: Filter all vanilla blocks that we missed through Forge's getDrops and BlockDrops events. As well as implemented IShearable for DoublePlants and DeadBushes. Mojang really should generic out some of this stuff instead of repeating logic all over the place! + +Build 1.7.2-10.12.1.1104: + LexManos: Fix patch fuzz + LexManos: Fixed GuiContainer calling button.mouseReleased. Closes #1116 + LexManos: Add comment to RotationHelper telling modders where to actually look, closes #1115 + +Build 1.7.2-10.12.1.1101: + diesieben07: + Add PlayerEvent.StartTracking and .StopTracking & make trackedEntityIDs visible + & Update, as discussed on IRC (squash) + +Build 1.7.2-10.12.1.1100: + vilim.lendvaj: Make finite fluid blocks drainable + +Build 1.7.2-10.12.1.1099: + LexManos: Fix enum helpers for EnumRarity {moved to Commn and changed paramter} and EnumCreatureType {new parameter} and added junit test for them. Closes #1009 + +Build 1.7.2-10.12.1.1098: + Christian: MinecraftForge/FML@1d41aa978d41267e4040ec449e10f49a20edd4fa Fix the side for the compatibility check. Should result in green ticks finally! + +Build 1.7.2-10.12.1.1097: + LexManos: Change IShearable JavaDoc by one line so Anti would shut up. Closes #1054 + +Build 1.7.2-10.12.1.1096: + Christian: MinecraftForge/FML@4512f8e5e316ddaf6a4fe35470f1f88dcdddae1a Warn when the objectholder finds nothing in the registry. Helps debug mismatched names. Also, actually make the scoping thing work with objectholder + +Build 1.7.2-10.12.1.1095: + rainwarrior: Added world display list render events + +Build 1.7.2-10.12.1.1094: + foka_12: + Fix getOreIDs not using the wildcard value correctly + + You can see it's not working by requesting the ore IDs from lapis, and you'll see the name "dye" is missing (and that's the one registered using the wildcard). + + Fixed it by inverting the order of the item stack parameters. + +Build 1.7.2-10.12.1.1093: + LexManos: Prevent duplciates in registered Ores in the OreDictionary and clean up some of the code, add new function to return all ores the specified ItemStack satisfies. Closes #1102 + +Build 1.7.2-10.12.1.1092: + vilim.lendvaj: + Fix fluid blocks + For https://github.com/BuildCraft/BuildCraft/issues/1843 . + +Build 1.7.2-10.12.1.1091: + LexManos: + Updated FML: + MinecraftForge/FML@3aba56440aa7a95f6431efcdcb5c127ebafc8891 lastIndexOf, Note Don't code while sick. + +Build 1.7.2-10.12.1.1090: + LexManos: + Updated FML: + MinecraftForge/FML@c828bb63c57cb10c23d9b1c3a6934e9f9ddba37b Make AccessTransformer change INVOKESPECIAL to INVOKEVIRTUAL when making methods visible + MinecraftForge/FML@a9aa468457a1eeed3366505b93e36da654610f05 Merge pull request #431 from diesieben07/at-invokevirtual + MinecraftForge/FML@31d726abad0dec6d1b853e9adf6a01580aee2af4 Fix the null networkHandler in the MessageContext + MinecraftForge/FML@725d988e36a7b104b9f5d8ae2daf993ac12af5bd Add in the objectholder, autopopulated by FML based on simple rules. Allows for reference driven substitution of mod blocks and items based on their server running state. + MinecraftForge/FML@f07bf5cb30a20ca9f62337512e936cfefcfbf0c4 Fixed deobfusication of nested inner classes. And removed legacy ModLoader remaps. + LexManos: + Updated FML: + MinecraftForge/FML@3a687f48b9606b4f9179d63ef0b831a25821ff8f -.- Save File First. My Bad. + +Build 1.7.2-10.12.1.1088: + LexManos: Add Glass, Colored glass, ore storage blocks, alines, and a few others to ore dicitonary. Closes #1011 + +Build 1.7.2-10.12.1.1087: + clashsoft: Update GuiScreen.java.patch + LexManos: Add new PlayerEvent.Clone called when an EntityPlayer is cloned via dimension travil or respawn. + LexManos: Made WorldGenShrub respect Block.canSustainPlant, Closes #1096 + +Build 1.7.2-10.12.1.1085: + delma: + Fluid events now know how much fluid is moved + + Added amount that is being filled/drained to the FluidEvent + + Added constructors without amount to ensure backwards compability + + Added deprecation to amountless constructors + +Build 1.7.2-10.12.1.1084: + LexManos: Fixed Stems not droping a random number of seeds based on metadata, Closes #1087 + +Build 1.7.2-10.12.1.1083: + xcompwiz: + Bug Fixes to Biome Decoration and Chunk + Fixes issue with biome decoration crashing on worlds with exposed void + Fixes same issue in JungleBiome decoration + Fixes forge bug in getting lighting from a block in chunk + +Build 1.7.2-10.12.1.1082: + LexManos: In Flower Forest biome a Poppy should spawn instead of Blue Orchid Closes #1078 + LexManos: Added Farmland to PLAINS type plants as that has changed in 1.7. Also made BlockTallGrass call it's super.canBlockStay to better support custom soils. Closes #1077 + LexManos: Added accessible instance to RenderBlocks and RenderItem for modders to use who don't wish to create there own instance. Warning: Other modders may influance the transient state of the instance, BE WEARY MODDERS. + +Build 1.7.2-10.12.1.1081: + Christian: MinecraftForge/FML@43e3ee1af1cab54db238dab4994076fdbe68bc6a Swap Listenerlist constructor around. Should fix parent resizing issue? + +Build 1.7.2-10.12.1.1080: + Christian: MinecraftForge/FML@70570a863ffa6a3ba7e2dd30b471bb47615b8bf8 Fix up possible CME + +Build 1.7.2-10.12.1.1079: + Christian: MinecraftForge/FML@503da3a2577a069b7847c158a27e8316c85ed852 Don't consider null NetworkDispatchers. This should fix a bunch of fakeplayer issues. + +Build 1.7.2-10.12.1.1078: + LexManos: Fully clear DimensionManager's DimensionID bitset when world is loaded. Closes #1074 + LexManos: Fixed No Blue Orchids spawn in swamp when using bone meal Closes #1072 + +Build 1.7.2-10.12.1.1077: + Christian: Fix forge validating strict versions on remote connections. + +Build 1.7.2-10.12.1.1076: + Christian: + MinecraftForge/FML@a8cbef2321a8e1bdfac56476bdfb5b306f71d38b Finally hopefully fully kills the race condition causing a classcast on slow machines. + MinecraftForge/FML@8dbd1ae0a177a556d03630a059242a2ee7f45e55 Fix ObjectIntIdentityMap sporadically matching non-identical objects. + MinecraftForge/FML@42713c66e565a26e963099baa838800f250089c3 Merge pull request #426 from sfPlayer1/master + +Build 1.7.2-10.12.1.1075: + Christian: + MinecraftForge/FML@d8b6adb2598ce144568a0aaf26fa8b988c028b7c Add a helper for casting some common collection types into generic form + MinecraftForge/FML@5275cea844a6afacc0deb41d153f01c1c25bb924 Try and see if there is anything to the identityHashCode collision hypothesis. If you see this in your error messages, kindly let us know! + +Build 1.7.2-10.12.1.1074: + LexManos: + Updated FML: + MinecraftForge/FML@a70308ef41f1e24074ea718f64caf75b8d6acba7 Update mcmod.info + MinecraftForge/FML@8555344eb33e4f0cc676defdb7391a24ebd5677d updated wrapper to gradle 1.12 + MinecraftForge/FML@1d5fc60f82e911c1abfbebbe781316126c02c987 Merge pull request #411 from matthewprenger/master + MinecraftForge/FML@3612ad0c25d103ba9bc81b32e8ecfef2dfc1cadc Attempt to fix another race condition related to reading NetClientHandler. + MinecraftForge/FML@c73a2076e3dd5d1f60c2fe2f589109cefa2dc6ce Fix potential rance condition in connecting to vanilla servers as well. And move latch into client side only. + MinecraftForge/FML@1436ac2f14fbdb48777c90b1b93378108c9cbf36 Fine use FMLCommonHandler. + MinecraftForge/FML@542e9acec1016c950c6f80af0c9da3190691359b documented dependencies + MinecraftForge/FML@ddc2cfbe864bd377232dbd1aa65df6e710d4639d Merge pull request #402 from AbrarSyed/patch-1 + MinecraftForge/FML@362ec8dee7ed2c291a8ed287c52eacdd80582eff Merge pull request #419 from Thog92/master + MinecraftForge/FML@b9de9ebc960bbf26e7aee570701aa4c226252fee Revert "Fix refreshResources not happening if an error occurs." + MinecraftForge/FML@738ce1d7cd5575269375066586d0a37881c536e2 Re-add removed genericiterable to clean a warning + MinecraftForge/FML@b0eb1ef7c6f4a63689898bf28f28e84d2dbae6e7 Split loadmods into loadmods and preinitmods, to allow resource loading to occur *always* between the two phases. This should fix mods not being able to access resources during preinit. + MinecraftForge/FML@de546bdf6cbeadb612cd6385bac8d54480073496 Clean up some missing generic info + MinecraftForge/FML@cd43eacbb25bc9cc0e81138844fa3aa7fd133037 Ensure that the loadcontroller is ready to preinit. + MinecraftForge/FML@f2fe80dc36972fe9db57e700380b6869abbc1832 Fixed default network mod checking to allow client side mods without the server side. Mods wishing to REQUIRE server side components must specify a custom check handler using @NetworkCheckHandler + MinecraftForge/FML@0c36868f92a3516c83ae363e13e5cb1db81236d1 Fix network disconnect with message on the client side in NetworkDispatcher. + +Build 1.7.2-10.12.1.1073: + bspkrs: Fixed unforeseen NPE + +Build 1.7.2-10.12.1.1072: + LexManos: + Revert "Implemented hashCode and equals in ItemStack, Closes #986" + + This reverts commit 0b01545a03942abca7b7ea28030be81e2ebeaa59. + +Build 1.7.2-10.12.1.1071: + LexManos: Implemented hashCode and equals in ItemStack, Closes #986 + +Build 1.7.2-10.12.1.1070: + LexManos: Fix extended entity properties being lost when leaving the end, This introduces the concept of calling IExtendedEntityProperties.init when entites/worlds change. Lets see if mods explode. + +Build 1.7.2-10.12.1.1069: + bspkrs: New GuiScreen events and a new ElementType DEBUG for RenderGameOverlayEvent + +Build 1.7.2-10.12.1.1068: + LexManos: Added new hook to WeightedRandom.getItem that allows for use of custom rnadom generators, prevents redundant code in mods. + +Build 1.7.2-10.12.1.1067: + LexManos: + Updated FML: + MinecraftForge/FML@2c56c32c5aa8842cfadaf8c237396cdb75673909 Fix saving backups with the raw name. Fix air block not being assigned as the default. + MinecraftForge/FML@d0f8073fa51db7426d5ded373f3404fa60d722f0 Merge pull request #413 from sfPlayer1/master + MinecraftForge/FML@810b1f3075e6061ab189e1f6975bd77b20040d71 Clean some generic warnings up. Make a generic list handler. Helpful for others I think too. + MinecraftForge/FML@fff86ee9d35874bdf77a1eaabe77615441644064 Fix refreshResources not happening if an error occurs. + MinecraftForge/FML@76d8d0e870a4e389167634283984dc10abb08e84 Fix mod version checking + MinecraftForge/FML@b84d0760ae47832e5b1e4d50237b582b2d50d520 Fix display of mod status at the server + MinecraftForge/FML@251af1d09dfbf636e2fb3f323a5345c81cc07aea Fixed memory leak on the client caused by Netty holding references to the World. + LexManos: Fixed hard references in WorldGenBigTree and ForgeCommand that caused worlds to leak in the client. + +Build 1.7.2-10.12.1.1066: + lhb: + Fix for Block.getExplosionResistance getting passed the wrong parameters + + It is being sent the x, x, y coordinates instead of x, y, z + +Build 1.7.2-10.12.1.1065: + CovertJaguar: + Fix issue with flexible rail return value + + Between 1.6 and 1.7 the return value to BlockRailBase.isFlexibleRail() + was inverted. While this is not a huge deal and could be worked around + by simply inverting your return value, it does mean its no longer + consistent with the function name and javadocs. + bioxx2007: Adds a new ReplaceBiomeBlocks Event constructor that supplies the metadata array if applicable and updates the ChunkProviderGenerate class to pass in the metadata array. + +Build 1.7.2-10.12.1.1061: + bspkrs: get a spelling checker :P + +Build 1.7.2-10.12.1.1060: + LexManos: Bump Forge version in prep for release. + +Build 1.7.2-10.12.0.1059: + LexManos: Try and fix invalid framebuffer depth/stencil setup, Thanks Ivoforce. Closes #1032 + +Build 1.7.2-10.12.0.1058: + apricefrench2d: + Fix infinite loop in RecipeSorter + + If recipe is multiple levels of inheritance from Object and not categorized, cls=cls.getSuperclass(); needs to be repeated more than once. It must therefore be moved to inside the while loop. + +Build 1.7.2-10.12.0.1057: + ohai.iChun: Fixes stencil buffers on platforms not supporting OpenGL 3.0 or higher. + +Build 1.7.2-10.12.0.1056: + LexManos: + Small wording change in license to allow for specifc differnet licnense contributions. + + Updated FML: + MinecraftForge/FML@e58562d3edfd1cd37fdc0a9e54181aed7433fdff Fix remaining issue with autoassigned Block and Item IDs overlapping. + MinecraftForge/FML@a82195772e539437911c25508168cb607659bc71 Registry: Block IDs after failing to find a mapping for them + MinecraftForge/FML@fd9389015fd5c6150155531bf1fffb38cfe9d551 Fix FMLMissingMappingsEvent.get + MinecraftForge/FML@5eebd4df718d65ac8426deba61e1ebb6ae2fde18 Registry: Implement support for remapping blocks/items to a new name. + MinecraftForge/FML@7325aa5033e7a5b5db79340777dd7a1c763315a0 Registry: cleanup, fix missing id error GUI formatting + MinecraftForge/FML@eb29d651ebda7086fe6d1f716295b087e2c17e6f Fix old 1.7 worlds with broken ID mappings + MinecraftForge/FML@6fd3c12a4a15a5cf38c421a94576a5cacd3fb7c1 Registry: allow handling missing blocks/items regardless of the mod id + MinecraftForge/FML@038fa17ad33aeba276db84ab170504fce884c1e7 Merge branch 'master' of https://github.com/MinecraftForge/FML + MinecraftForge/FML@49c623f59c440ba177adf2d76332ecee25e12236 initial attempt at a better way to ask the user in case of startup issues + MinecraftForge/FML@9be92dcfcb1c737025397c92b18ed027a6c7f4fa Registry: Complain about bogus registrations + MinecraftForge/FML@fd6d55afcc4f4c650c143ad43e09fbdc2cb9d850 Registry: Allow ignoring missing mods from the GUI, with confirm+backup + Registry: Add confirm+backup for automated corrupted id table fixup Require the user to confirm loading from a backup level.dat + MinecraftForge/FML@c47fc3b382434d435050b4ee02a02550b81f5717 Enable custom gui rendering only as required + MinecraftForge/FML@f77632df35dbf53fb31420fa86e6792f13257020 Remove unneeded entity spawn debug logging. + MinecraftForge/FML@c7adb42199a0684d8748451d39deb8326c0a2194 Registry: Repair mismatched ItemBlocks as well Fix a few misc issues + MinecraftForge/FML@c8a245a985779fd2545ee4b58a93270973aeb435 Registry: Fix debug info + MinecraftForge/FML@c8a0b72eba9265be608670424e1bd835a9d2f1e2 Registry: Complain about missing mods when repairing broken worlds Registry: Reduce console spam + MinecraftForge/FML@8e44006f432f1b36b826ff0469d99986a6051e4b Registry: Protect against putObject misuse, handle duplicate registrations better + MinecraftForge/FML@294c93212cd9f30c50b9d1a3b048a6141c45cdea Registry: Add support for registering ItemBlocks before their Blocks + MinecraftForge/FML@3b42b33b6ec4020b5032cae06760053ed135fae8 Merge pull request #400 from sfPlayer1/master + +Build 1.7.2-10.12.0.1055: + traincrazyb: + Small Fix: Held Items & Multiple Render Passes + + Passes beyond 1 now have the correct icon. + +Build 1.7.2-10.12.0.1054: + LexManos: Fix line offset in Minecraft patch, and mix RenderPlayer looping once to many on multi-pass items. + +Build 1.7.2-10.12.0.1053: + t.tomkins: Update PlaySoundEvent17.java + +Build 1.7.2-10.12.0.1052: + LexManos: Update access transformer, Closes #951 and #1021 + LexManos: Add NPE protection to GuiingameMenu.actionPerformed, Closes #961 + LexManos: Finally do SoundSystem workup for 1.7, Closes #982 + +Build 1.7.2-10.12.0.1051: + LexManos: Use BiomeGenBase's array size instead of hardcoding it in BiomeDictionary. Closes #871 + LexManos: Fix potential threading issue if FluidRegistry.loopupFluidForBlock is called from two threads at the same time before being setup. Closes #936 + +Build 1.7.2-10.12.0.1050: + LexManos: New hook to truely seperate the display of the 'durability' bar from the current / max durability. Allowing modders to control that display easier. + LexManos: ItemStack sensitive version of Item.getAttributeModifiers, Closes #816 + LexManos: Add ANIMALS tpe to PopulateChunkEvent.Populate Custom providers should call this function if they spawn animals curing population. Closes #790 + LexManos: Add AnvilUpdateEvent which is fired when a user places a item in both input slots of a Anvil and allows modders to control the output. Closes #838 + +Build 1.7.2-10.12.0.1049: + LexManos: Add position to BreakSpeed event. Closes #621 + LexManos: Advanced Model Loader available server-side for data driven models. To be cleanuped and re-evaluated in 1.8. Closes #773 + +Build 1.7.2-10.12.0.1048: + AbrarSyed: COnverted patches to SRG names + AbrarSyed: updated for ForgeGradle 1.2 + AbrarSyed: added .exe file.. fixed a bunch of patches + AbrarSyed: updated FML to latest master + AbrarSyed: fixed remaining noop patches and exc derp + LexManos: Update patches for new Fixed FernFlower used in FG 1.2. + +Build 1.7.2-10.12.0.1047: + reflex_ion: + This correctly uses the world height less one block for placement of a + Door. + + Required for placing doors inside a littleblocks area. + +Build 1.7.2-10.12.0.1046: + LexManos: MinecraftForge/FML@ef07de4f65ea16e1db1467845e316cb4c7d01a1f Fix hard link to DedicatedSerever when opening a LAN connection causing stalls on connecting. + +Build 1.7.2-10.12.0.1045: + LexManos: -.- Both null combinations. + +Build 1.7.2-10.12.0.1044: + LexManos: properly implement equals, sod off Player. + +Build 1.7.2-10.12.0.1043: + LexManos: Implement simple hash based equals in Fluid ContainerKey. + +Build 1.7.2-10.12.0.1042: + LexManos: Make StructureVillagePieces.Village public. + +Build 1.7.2-10.12.0.1041: + ohai.iChun: Fixes stencil bits not existing in Minecraft's framebuffer causing stencil test to not work. + +Build 1.7.2-10.12.0.1040: + LexManos: + Updated FML: + MinecraftForge/FML@e8b60441ccca8cccdc130560b4c8bf400aebc605 Reload game settings after mod loading is finished to capture mod keybindings. Closes #378 + MinecraftForge/FML@399770e572c9177babfb65a27280253023db2d9e Kill the modEventTypes list, register anything that extends FMLEvent, Fixes MissingMappingEvent handler, and any futureevents added. + MinecraftForge/FML@b7ad532ab5eb3e00d77ffde946d25675c9f69cf7 Re-enable post initalize texture pack reloading to allow Icons to be registerd through any init phase. + +Build 1.7.2-10.12.0.1039: + t.tomkins: + Small Fix: Held Items & Multiple Render Passes + + Passes beyond 1 now have the correct icon. + DemoXin: * Added Ore Dictionary entries and recipe replacements for Diamond, Emerald, Crops, Redstone, and Glowstone + DemoXin: * Fixed Items.glowstone to Items.glowstone_dust + +Build 1.7.2-10.12.0.1034: + LexManos: Fixed hashcode in FluidContainerRegistry, still needs a redesign. Closes #967 + +Build 1.7.2-10.12.0.1033: + ohai.iChun: Add cancelable RenderHandEvent. + +Build 1.7.2-10.12.0.1032: + LexManos: Fix a typo in our tile entity fix causing it to be ineffective. + +Build 1.7.2-10.12.0.1031: + LexManos: Fix items with color rendering incorrectly. + +Build 1.7.2-10.12.0.1030: + Christian: + Update Forge for patch changes + + MinecraftForge/FML@064b66af3d6c92b19821b88ec26cbb59577d68b4 Prevent players from logging in until server has finished starting. + MinecraftForge/FML@2aa73afa15908dadb0a033c49deb0ffefad2f265 Fix ExampleMod.java for build #1024+ + MinecraftForge/FML@c890206268da3c594d97198f5426b52ff6b8460c Try and handle removal of mods a bit better. Currently no way to allow a world which has missing blocks to load - but i have the code in place to allow it i think. + MinecraftForge/FML@995c204338cd601e118396d4b4ef8feb6e759037 Fix failing to load a world with missing mod blocks and items. There will be a way to force worlds to load when stuff is missing, but for right now, it will fail as this is "world safe". + MinecraftForge/FML@fa5f4c884272f415933329a9e914e0b7d052e31a Some argumentation + MinecraftForge/FML@45409bfa0c136078823a1aef1358396d92a269ee Prevent player dat files getting reset during disconnects. + MinecraftForge/FML@33100d6bab654a4bd59701b1ec2bf91caa3399da Merge pull request #371 from bl4ckscor3/patch-1 + MinecraftForge/FML@572d32358ab11e5916d91c4c7b9c04a70cfed2f6 Merge pull request #373 from bloodmc/master + MinecraftForge/FML@d0dd05a15c2eca9eabd308319c2ed85cb632922b FML expands S3F to support payloads up to 2 megs in size. Should be transparent + +Build 1.7.2-10.12.0.1029: + LexManos: Fixeed a missed -1 in SpawnerAnimals patch. Thanks Blood. + +Build 1.7.2-10.12.0.1028: + LexManos: Cull FakePlayers when worlds are unloaded. + +Build 1.7.2-10.12.0.1027: + LexManos: Use correct tag types when reading Forced Chunk data. Fixes ticket loading. Closes #964 + +Build 1.7.2-10.12.0.1026: + LexManos: Fixed FluidContainerRegisry.contansFluid closes #845 + +Build 1.7.2-10.12.0.1025: + LexManos: Fix AIOOB error with Endermen and blocks >256. Also better support for ID remapping. More to come later. + +Build 1.7.2-10.12.0.1024: + LexManos: + Updated FML: + MinecraftForge/FML@03fb1879d72fbd347badc140fed6c2c3191d2990 Fix obf error when right clicking a Empty Map. + MinecraftForge/FML@6bb9b8b9532b276450d03a3419e0da016aecead8 Clean up FMLEventChannel. Closes #367. + MinecraftForge/FML@b7b3450dcd123ab5df6b3693c9c2123bc3846b88 Update MCP mapping snapshot to latest crowdsourced names. + MinecraftForge/FML@8c9e8b52708bd0630303f8b5dc184ab60e2553a1 Fix isRemote, this is integral to so many parts of the code, everyone knows it by this name, People should not change it. + LexManos: Add the beginnings of a Constants class, to document/clean some of the magic numbers that are in the MC code base. + +Build 1.7.2-10.12.0.1023: + Christian: + MinecraftForge/FML@d87822ad8519da1c808e48bcc0a1bf8eb15c0095 Bump gradle wrapper to 1.10 + MinecraftForge/FML@359ac3ca2a941d70709168fbbbc0725c861668dd Ensure we check both item and block registries when finding valid IDs. Should fix #365 + MinecraftForge/FML@cee0f0b81179d307059843f08401f8700fb3ddb2 Tweak so that writing to the context will automatically send a message back to the originator in handshakeestablished. + Christian: Add a discriminator for fluididspacket. remove extraneous channel handler. + Christian: Fix up the event handler so it knows it's owned by forge + +Build 1.7.2-10.12.0.1022: + LexManos: Uncomment aa few FluidRegistry entries. + LexManos: Fixed issue where enchantment effects caused slight rendeirng issue. + LexManos: Fixed missed parens causing trapdoors to fall off incorrectly. + +Build 1.7.2-10.12.0.1021: + LexManos: Inital Fluid system update, untested. Still in progress. + +Build 1.7.2-10.12.0.1020: + LexManos: Fix NPE when breaking ice. + LexManos: Attempt a AIOOB error fix in tesselator when there are alot of transparent blocks in the rendering range. + +Build 1.7.2-10.12.0.1019: + Christian: + MinecraftForge/FML@544320b8d239df4a5ee2b3a7ec331ce2ec0a2c09 Beginning of a saveinspectionhandler. + MinecraftForge/FML@ab199c5811fe2d831592601d4f77691fbf82d1b8 Try harder to find a mod container. + MinecraftForge/FML@8633d780c925ebb719c37ac52e2f3db5f9957895 And make a loud message if there isn't a modcontainer found, substitute Minecraft. In general, this can only happen for coremods not properly registering their code. Closes #363 + +Build 1.7.2-10.12.0.1018: + LexManos: Fix imporerly efficient tools breaking blocks to fast. + +Build 1.7.2-10.12.0.1017: + LexManos: Fixed potential NPE in SlotCrafting, and added ItemStack sensitive version fo hasContainerItem. Closes #854 + LexManos: Adds a WeatherRender in the style of SkyRender, Closes #844 + +Build 1.7.2-10.12.0.1016: + LexManos: Move change of metadata to immediatly after change of Block, should prevent any 'invalid' tile entities from breaking created. Reference: #897 + +Build 1.7.2-10.12.0.1015: + LexManos: New PlayerUseItemEvents, Start, Stop, Tick and Finish. See PlayerUseItemEvent.java for more details. Closes #924 + +Build 1.7.2-10.12.0.1014: + LexManos: Make ItemBlock.field_150939_a public, closes #945 + LexManos: Missing EntityAITasks.tasks and MapgGenStructreIO register ATs, Closes #949 + LexManos: Implement PlayerPickupXpEvent, fired when a player aquires XP from a EntityXPOrb. Closes #942 + LexManos: Exclude cobblestone slab recipe from ore dictification, closes #940 + LexManos: Add the ability for custom records to have finer control over there sound resource location. Closes #933 + LexManos: Don't short circuit item icons for multiple render passes while being used. Closes #929 + +Build 1.7.2-10.12.0.1013: + LexManos: Fix Furnace stopping on 63rd Item, Closes #947 + +Build 1.7.2-10.12.0.1012: + Christian: + MinecraftForge/FML@b6d95d704b65dd8232ec8ddd333de378db8fe161 Name the log files properly. fml-junk is an early startup annoyance I can't kill because log4j2. + MinecraftForge/FML@8692ca17d13eda036b5ef996ec8e8706e7707d80 Log4j2 logging context for things. This should help add context when things go wrong in mods. + MinecraftForge/FML@a7ca131a337b5f0d4fc6f438626ac2d5b7771b3c And don't spam NONE everywhere + MinecraftForge/FML@741e172ffe163f0dd3018e1474af46ef0696396a Log4j2 doesn't need debug level logging for itself anymore + +Build 1.7.2-10.12.0.1011: + Christian: MinecraftForge/FML@458b0620b43116c943549a0f060c7e8830c2d77a Log the bad packet in a prettier way. Also, don't show the authlib debug data in the log file. + +Build 1.7.2-10.12.0.1010: + LexManos: Add BookCloning to the recipe sorter. + +Build 1.7.2-10.12.0.1009: + Christian: + MinecraftForge/FML@9a8d16b66e67691a4c83a9e1e236304e9f6d5139 Fix log4j2 config. Fix server gui to *show* logging. Fix log spamminess in the console. Fix bug in servergui that can cause deadlock. + MinecraftForge/FML@a355eecb2c14123964c6ae2402a0933d57ae9736 Add in error logging for outbound messages. Fix bug with indexedcodec NPE + MinecraftForge/FML@1c793abe0eef6846f681c9673019b0ebc49caaaf Fix derp with networkcheck + MinecraftForge/FML@675b5a07788ada17bc26a9c4f26598e77d2098cf And turn down some more logging, now we have useful logging back again.. + +Build 1.7.2-10.12.0.1008: + Christian: + MinecraftForge/FML@4aa2416ce5dcd8e77761703c018d1e7d08464025 Propagate Optional method removal to trait implementation classes + MinecraftForge/FML@fc025a7b73d9b3f46ecf2257227657592f5506b5 Logging Changes + MinecraftForge/FML@f0132a6f3b47e746a1a7df3ef84f4be989f140dd changed fml log level to all + MinecraftForge/FML@f23eba4352c38fd21e04e81f3db72c6cafe65a36 put max number of FML log files to 3 + MinecraftForge/FML@449ac98b77025eba38a75d0242113fffe26a8cf9 SSP Worlds updating from 1.6 will now pop a warning message before loading, and will capture a timestamped zip file in the minecraft dir before starting to load. Allows for people to test updates. + MinecraftForge/FML@3557fe31c92ea8d76c90052f9b8b6da963300c4f Throw an exception when discriminator is not found + MinecraftForge/FML@25240457283ba40c32022c97fc982c2ff4408e46 Make NetworkEventFiringHandler sharable + MinecraftForge/FML@dfc0899ec66f87502b5727939ac2f0ad0fabf89f Merge pull request #357 from jk-5/sharable + MinecraftForge/FML@79d42fca8d6b9d73204890ef0edb9d73cf075d87 Merge pull request #355 from jk-5/errorhandling + MinecraftForge/FML@7907e16e96de21e8ba536906ae71adcf02bfa535 Add a type adapter for artifact version. Should fix #354 + MinecraftForge/FML@7ac5bddbc3c227e0ed9385904a2bd9621078e2de Allow indexed messages to validate themselves. Also, catch exceptions from an embedded channel, and cause them to close the connection. It's ugly, but it means that the client doesn't crash if it connects to a screwy bungycord that's trying a 1.6 handshake for some reason. + MinecraftForge/FML@5adacc3b336bacbe30aa06175ef80c3aac08a62a Check the mod, not it's container, in the check handler. Closes #358 + MinecraftForge/FML@3d26f28bcf3e79e1f5fe20fcf056c604487dc35b Allow connection when server is apparently offline. Might allow :NOFML circumvention though. Hmmm. Closes #359 + MinecraftForge/FML@a62374d4aceac1c4ab39b3c0bae624ccbca65b6b findBlock should now return null, not the default block, if the thing being looked for is not found. Closes #352 + MinecraftForge/FML@6a695c4348d062af50b8cf5208530fc5036eba17 Try and stop the epic channel closed spam at close time. Closes #353 + MinecraftForge/FML@35a38d7840a5d0cd842005822c4ec6a9d3b65b6a Make sidedproxy support non-public fields. Closes #344 + MinecraftForge/FML@9d2e089df692655df04315a3822f43140015f3af Merge branch 'logging' of github.com:AbrarSyed/FML into abrar-borked + MinecraftForge/FML@79b04898d43d354714e09ce7e66efb5357ebcf61 And restore suppressions. ABRAR, DON'T TIDY CODE!!!! + MinecraftForge/FML@3dfb54e066ab91e44405706233f2dfffee9add72 Merge branch 'trait-optional' of github.com:RainWarrior/FML + MinecraftForge/FML@32bb7315cc6beff84f186a33e73219cc5280821a Add in example assets dir. Closes #308 + MinecraftForge/FML@16d33d298953b41dbbe3e3b504e800f4f46a3e1b Clean up and document outbound handler a bit better. Add in dispatcher target. Closes #361 + MinecraftForge/FML@5719b9ec533b3e43213dbafcb448221884efd9e8 Fix reply handling. Make the proxy message available for subclasses of indexedcodec. Fire user events into the network event firing. + +Build 1.7.2-10.12.0.1007: + LexManos: Add support in Techne models for the TextureSize tag. Closes #856 + +Build 1.7.2-10.12.0.1006: + LexManos: Updated FML: MinecraftForge/FML@444a7d7fa1cf7fad7dda67f581fa0e3be36069b7 Move placement of single player world load hook to fix NPEs. + LexManos: Fixed RenderWorldLastEvent never being called, was missed in 1.7 update. Closes #932 + +Build 1.7.2-10.12.0.1005: + LexManos: Fix flexible rails, Closes #944 + +Build 1.7.2-10.12.0.1004: + LexManos: Fix warnings in Forge codebase. + LexManos: + Updated FML: + MinecraftForge/FML@7c5d62704ac1d3e586f3bfe26265a534e5362c73 Make UniqueIdentifier final and add a hashCode. Closes #348 + MinecraftForge/FML@ff7b5845e7f6b300d413b917f57adc472a4ebcff Clean up some warnings about @Override + MinecraftForge/FML@275ccac6f14bc66b88c76b1040aa7167f995967c Fix NPE at startup + MinecraftForge/FML@2a5a8d0cd062d3feac9c4de234e3dab1ff4462e5 Fix memory leak?! + +Build 1.7.2-10.12.0.1003: + Christian: + Add exception logging to forge channel handlers as well + + MinecraftForge/FML@53557dcd0582e09f7f35eb3bc2fd130fba3be4a0 Put logging exception handlers on all channel inbounds. Fix problem with failure to login. Closes #350 + +Build 1.7.2-10.12.0.1002: + Christian: MinecraftForge/FML@9c96ca4402e4c231285f170281dd543bfffa191a Fire a custom packet channel registration/deregistration event, for any mods that care about that kind of thing + +Build 1.7.2-10.12.0.1001: + Christian: + MinecraftForge/FML@e14efe786f6255a18e148c4137f560f5e2d2a38f Some fixes and tweaks + MinecraftForge/FML@c013870b1df5e63bd84d92545ebdd434db74b5d1 Merge branch 'simplenet' + MinecraftForge/FML@30882b0c1d2743afebbebc288d73f25696e0815c Clean up some warnings. Add in simple network impl + MinecraftForge/FML@9cab2ab36e7981c847e3e9ae8c3fbbb36531ba6d Add in some tests and examples for the "simple" network stuff + MinecraftForge/FML@a429e106dd00b34302ec5893e0a8fc97c8fc8019 Fix bug with SSP, and hook so we can do confirmation of world loading, as well as other things + +Build 1.7.2-10.12.0.1000: + Christian: + MinecraftForge/FML@b362e8a2733eb3082975edfdf83c996f048b65d3 At the request of AbrarSyed. + MinecraftForge/FML@e344303ec7a5ed27c4378ff072a036df7a350902 Merge pull request #346 from Jezzadabomb338/master + MinecraftForge/FML@a4686b1261a9bad523b4efa8a36a4433a58897cc Added basic Mojang account authentication support for development time login. + MinecraftForge/FML@dd17979a2f6f02ac4a9dda09b52c96365cc5fec9 Fix bukkit connectivity issue. + +Build 1.7.2-10.12.0.999: + Christian: + Updated FML: + MinecraftForge/FML@1db3daa0e82e67fc27ca3d535a09c806c1a54d67 added override toString method for getting full name. + MinecraftForge/FML@acf74a34032224a73c4c03280cafa0042c35cf5a changed the readme to reflect new setup task. + MinecraftForge/FML@96c19b35807fa078cb18b4ae50567d0360bcdb03 undid readme change + MinecraftForge/FML@a89939e57e9ff061df3d53cf1cb075b31de5de1b Merge pull request #336 from jadar/master + MinecraftForge/FML@717a8d694532bd9438eed8d9cf4b57318b2b4cfd Fix csv string vs list of strings. Thanks immibis. Closes #334 + MinecraftForge/FML@584c0f368bca1d5b0223b5b3611b366b9a00f7d7 Fix potential ordering issue, clean up some imports + MinecraftForge/FML@28293b29ea65c30fe80c49e85e2ae15a4db68933 Add in a simple(ish) event driven network handling system. Register using newEventDrivenChannel and you'll get a simple network handler that will fire events at the subscriber(s) of your choice, whenever a packet is received. You'll also get some convenience methods for sending to things. + MinecraftForge/FML@80b00dc7966d96111e2ce8643db8e0f544c2bc89 Fix openGui. Closes #342 + MinecraftForge/FML@fc69bcf2807dc2b85eb52681ba9531cb3e2f1945 Fix up privacy derp in TickEvent. Closes #343 + MinecraftForge/FML@10d056a494aac22137b644cff341a5958e8168fc Fix possible NPE derp + MinecraftForge/FML@5da6dcc7e3607e5f107f6a7d39a4b4e1eb7fb306 Divert connection through FML, so we can deny connections to servers that don't want us + +Build 1.7.2-10.12.0.998: + ohai.iChun: Squash commits so Lex would stop whining. Fix erroneous position when getting player position with changed eye height. + +Build 1.7.2-10.12.0.997: + Christian: + Updated FML: + MinecraftForge/FML@d5bfd69e35b21f701390a8c4c4c58d7ec1fff1fc Fix problem with connecting to vanilla. SHOW what's modded and what's vanilla in the list. Hooks that make the blocking work to come + MinecraftForge/FML@dd098854b0b65b8509b8788422e02d989a991b87 Fix the keybinding array to the right one + MinecraftForge/FML@43068eb9862f280611f26f4107ff5ac2b42b08e4 Fix TargetPoint to be static + +Build 1.7.2-10.12.0.996: + LexManos: Attempt to prevent a NPE when MC renders a lot of things at once. + +Build 1.7.2-10.12.0.995: + minalien: Fixed MinecraftForgeClient for custom Item Renderer implementations. Removed check for forward-slashes (/) in texture asset locations (but left check for backslash in place). + +Build 1.7.2-10.12.0.994: + LexManos: MinecraftForge/FML@0d810c01fab99ac491c2277097a4198518fe6c75 Mark jopt needed on the server, herp derp, blame Abrar! + +Build 1.7.2-10.12.0.993: + LexManos: Deprecate BlockFire.func_149842_a, and throw exception if someone tries to set the burn properties for air. Should prevent 'The Air is on fire!' reports. + LexManos: Fix DoublePlant placement, closes #921 + +Build 1.7.2-10.12.0.991: + смирнов антон михайлович: Create ru_RU.lang + +Build 1.7.2-10.12.0.990: + Christian: + Updated FML: + MinecraftForge/FML@5317672631f30e1c9655f0bb28dd8b158deea2fb Add a utility method for finding the channel handler name based on type. Should fix naming weirdnesses. + MinecraftForge/FML@9de9a1553086ebeeb5d5fc0f6d96da8680e52df0 Fix stupid hardcoding derp + +Build 1.7.2-10.12.0.989: + Vexatos: Create de_DE.lang + Vexatos: Update de_DE.lang + LexManos: Fixed pipeline naming issue in the ForgeNetworkHandler. + +Build 1.7.2-10.12.0.987: + LexManos: Fixing an infinite recursion case, Closes #916 + LexManos: + Models now load from resource packs + Models must now be loaded from resource packs using the standard resource pack reference. For example, to load a model named "assets/mymod/models/mymodel.obj", you would call AdvancedModelLoader.loadModel("mymod:models/mymodel.obj"); + Closes #670 + LexManos: Fix panes/iron bars not connecting correctly. Closes #904 + LexManos: Fixed the run config for dev time server, Cloases #913 + +Build 1.7.2-10.12.0.986: + Adubbz: Made canBeReplacedByLeaves default to whether a block isn't opaque rather than if it is, also uninverted the checks for canBeReplacedByLeaves in WorldGenBigMushroom, WorldGenSwamp, WorldGenTaiga1 and WorldGenTaiga2 + +Build 1.7.2-10.12.0.985: + Christian: Fix inversion + +Build 1.7.2-10.12.0.984: + Christian: + Updated FML: + MinecraftForge/FML@21b13d63512ce399c82cbb6b9042eefa6dcdaacd Lots of network cleanup. Gui packets now work too! + MinecraftForge/FML@b3f98d1ee0416aa452f8611d458968afdf50775a Fix derpiness with Mods button when Realms is available + MinecraftForge/FML@cdd9d92a4f8cd199e2d8a34bb398ef32e5f1e275 Starting work on the actual GUI. Still work to do. Needs an API. + MinecraftForge/FML@ab5eb3ccfff7f9ccfd8720b23fcef3131e54d57d Fix button size for GuiModList + MinecraftForge/FML@3113138bd1377d71afe3b8290e18511bfb6e5e97 Tweak button positions. + MinecraftForge/FML@c5e29b574a315d48668ebc9189bcc497a0eae13e Avoiding redundant calls to LogManager + MinecraftForge/FML@fbc1f8f6f9effa4a538880f9fec0ce5010226d09 Config GUIs in the modlist now work. + MinecraftForge/FML@fa4f3015a0d7147cbde3edec7664e78e5bcacbb9 Added transparent background for GuiIngameModOptions as per cpw's request. May not compile due to manual de-mcp-fication. + MinecraftForge/FML@7bf119e1e54cadff690ec31a4bab93c0d1d0aad1 Fix up readmes and credits. We no longer support modloader. + MinecraftForge/FML@779cd05aa1ced720a63cc508b82e68cc6fc8daa9 Tweaks + MinecraftForge/FML@b51fb913551a5116cc3b9bb7583b1666f280c650 Merge branch 'patch-1' of github.com:airbreather/FML + Christian: + Updated FML: + MinecraftForge/FML@6f1da6550e10164bd6c678829f111bb5de9383b6 Fix up mcpname derp in GuiScrollingList. + +Build 1.7.2-10.12.0.982: + Adubbz: Fixed sky colour transitions on a render distance of 16, fixed the WorldGen of various things + +Build 1.7.2-10.12.0.981: + jk-5: Update ForgeMessage.java + jk-5: Added a constructor and made the fields package-private + jk-5: Added default constructor for reflection + +Build 1.7.2-10.12.0.980: + LexManos: Update patches for AT changes. + LexManos: Fix inverted login in BlockPistonBase causing blocks to break incorrectly. Closes #910 #909 + +Build 1.7.2-10.12.0.979: + Christian: + Updated FML: + MinecraftForge/FML@22ba6fda5ee2dbf29dc03ba93ff9c7707edeaeee Expose the nethandler in a few places, and pull out FMLEmbeddedChannel, exposing a utility method on it. More to come. + LexManos: Update for the FMLEmbeddedChannel change. + +Build 1.7.2-10.12.0.977: + Christian: + Fix build.gradle for tweakClass property + + Updated FML: + MinecraftForge/FML@f36152398d1d287e7a55a31c77a2614cfb63e1b6 Add in the tweakclass, fix the json for lzma @ the server. + +Build 1.7.2-10.12.0.976: + Christian: + Updated FML: + MinecraftForge/FML@5d069629cf47cd04f2002b3b9a2c32b0ea73c26e Allow itemstacks for furnace recipe inputs. Allow passing extra arguments through registerblock into the itemblock constructor. + +Build 1.7.2-10.12.0.975: + Christian: + Updated FML: + MinecraftForge/FML@061288909de0f0452adf51a5a9935fd09992c801 Fire simple network connect/disconnect gameevents. + +Build 1.7.2-10.12.0.974: + Adubbz: Made BlockCrops.getDrops call its super method + +Build 1.7.2-10.12.0.973: + Christian: Fix the network handler for forge + +Build 1.7.2-10.12.0.972: + Christian: + Updated FML: + MinecraftForge/FML@34819c9303870f560232464a2d16eb46d152515c Make gradlew executable on linux + MinecraftForge/FML@53a1f9841421b41d543d7d1d51319b44c86a527e Attempt to load old pre-1.7 worlds. ENSURE YOU HAVE A BACKUP! + MinecraftForge/FML@6a5f9e135f88b662e4e01e8882f861448910ca90 Fix example mod code for 1.7 + +Build 1.7.2-10.12.0.971: + Christian: Allow tools to override their material harvest levels. + +Build 1.7.2-10.12.0.970: + Christian: Tidier implementation of previous commit. Should fix for subclasses of individual tools too + +Build 1.7.2-10.12.0.969: + Christian: Add in harvesting abilities of the items, should fix effectiveness + +Build 1.7.2-10.12.0.968: + Christian: + Updated FML: + MinecraftForge/FML@f8d6213829d570501166d64d7c8bb4977567131f Update render registry + MinecraftForge/FML@ec316f113fefef12f6defed9eb68de368d7f4420 AT for renderblocks + +Build 1.7.2-10.12.0.967: + LexManos: + MinecraftForge/FML@3714426e19f8f0edaaeda8c787993f8f3615a44d fix derp in example builscript + MinecraftForge/FML@01fb451b6918599de5e732d7ff30c761438ab930 Merge pull request #311 from AbrarSyed/patch-3 + MinecraftForge/FML@30d532f4fc6fc65ea7e79707a75ff4d6ea0ea031 Pass 1: Most patches are restored. + MinecraftForge/FML@53127eec308d3929d68d3d9fafabcfef37e95c37 Merge branch 'master' of github.com:MinecraftForge/FML + MinecraftForge/FML@7ab3c3a37ceb8ab945208206aec86739a2138329 Update gitignore + MinecraftForge/FML@38cec7a11fae7cf12bda3a8d16a50bb6136d8886 The basic network handshaking for FML is done. All scenarios seem to work. + MinecraftForge/FML@9f928963f20bc9bbfbe1391fb16c6f5ca5fd4344 A network design I like. It uses the netty embedded channel to allow mods to build channel pipelines on top of custom payload packets. + MinecraftForge/FML@58f7487cfaf4a25a8349021b9cca5ef4ba0b541c Check in patches. Add in some network timeout tweaking values so you can debug the network. + MinecraftForge/FML@e544adba5c7e9286f917342af2669e5888fa0a17 More cleanup. Bidirectional server <-> client network works for mods as well as FML|HS now. + MinecraftForge/FML@f5c38e2359c2e6eca13cd6606465ee36086a7113 OK, network channels appear to be working well for both dedi and integrated servers. The beginnings of the new mod structure too. + MinecraftForge/FML@9c96a0a10a5cbe34786be8fd41f9818b5ac929bc More network stuff, partially done id syncing. + MinecraftForge/FML@2aaaeba15eabdec189daa8662e9ffdf0b5a09dbe ID loading from the server save now works. + LexManos: Kill liquids finally. + LexManos: Bump data for 1.7 start. + LexManos: Some work on 1.7, waiting for Abrar to fix a few things. + LexManos: + Updated FML: + MinecraftForge/FML@a30f17362764f3e4e594386e193f9e4368e6836e Add sonatype snapshots repo for SpecialSource snapshots. + MinecraftForge/FML@b2550b8a693315ccc205f5315eac67c5283d7af9 Add mappings for Items/Blocks fields. + MinecraftForge/FML@57f7f1d7abd304d3e9f42567f1d66c10122e4ec6 Update for fixed Enum cleaning and names. + MinecraftForge/FML@99c681ad8736e4976053718c3d453b2fb30eefe0 Did it manually, forgot it needed the end comma + LexManos: + Updated FML: + MinecraftForge/FML@1d71c017f45aa7ed9d7d7c5ed5250a8d22477980 ID syncing. + MinecraftForge/FML@fd36f50d8210342f65cb0272bac56a3bcc42dd18 Cleanups + MinecraftForge/FML@89e4e483c204c11b6fdfed34893fc223a7d6a899 Add in a remapping event for mods to consume. + MinecraftForge/FML@cd417c6786256fa23f181ff0b76696bc6dfb0291 Fixed remote and local connections work with mods now. + MinecraftForge/FML@ef492407ef812bb6bbc7f0bd8efbd16d07efcafb Entity spawning works. + MinecraftForge/FML@d0d31d9575403eb2ec058898b86ffd99a9220f75 SpawnAdjustment packet. Clean up stuffs. No more compile errors. + MinecraftForge/FML@3e278acb71e4e3d0406e80f0fad5071c9215ed33 Fix stupid possible compiler error. + MinecraftForge/FML@009d4dee2328cc8d97b74177a2c5a3c359e6564a Fix the exc file. Fix the deobfremapper for handling inner classes. + MinecraftForge/FML@49cb893d12bd4f82b5d1b50d1e6517a256525d32 Fix exc this time *sigh* + MinecraftForge/FML@31efcfc3b2085f5d4e070ddab34a0be1481b4c6f Clean up patches for latest exc. + MinecraftForge/FML@7a4ceebf5efe5b3650080cf912e371d92fc70a55 Kill old patches and add rejects to ignore file. + MinecraftForge/FML@7ea571f593464ad4226ba845da27ff66161621b1 Fix AT, Fix exc. Almost works now! + MinecraftForge/FML@b852e302851cfaf77e1db6f86408e8d049703656 First functional release under reobfuscation. + MinecraftForge/FML@df870c1a3341d8e2e88d7fc3e2f3d9ed2507989f Update shiped ForgeGradle for 1.7 + MinecraftForge/FML@55aa337f952bc72c5a001a6ed661978b11822c63 Rename synthetic bridge methods, these methods are not decompiled, but need to reobf correctly cross the recompile boundary. + MinecraftForge/FML@0098c57f94808751062ee45f2ee267324bb42089 Merge pull request #316 from AbrarSyed/patch-4 + LexManos: Comment out fluids until King gets his hands on it + LexManos: Killed a few hundred compile errors. + Christian: + Moved the core event handler parts to FML. Implemented the Forge network handler based on the new + netty strategy. + + Updated FML: + MinecraftForge/FML@3b2994a3def35a2d3058960b71dc59dc48b802f9 Some patching touchups + MinecraftForge/FML@557357fe179529e0b44aab2f3fcef0c5adf981d5 Update for log4j2 + MinecraftForge/FML@a2b324beb2ef6ec73000678c9305fd70d4ec1643 Copy eventhandler from Forge into FML. It is going to replace a lot of the runtime event systems. + MinecraftForge/FML@4071ff38afe15fddf5db0be882f5627f503a37c6 Patch some GUIs. We're gonna add some basic mod gui config support. + MinecraftForge/FML@0b419ac79c307579f162d47e0388a9d75bcd0a6e Fire a user event down the channels when a handshake has occured. + Christian: + Updated FML: + MinecraftForge/FML@32561265fc935cd6639d5b2e086e879f375676fa Ticks, Player events, keybindings, all migrated to the new event driven system. + LexManos: Inital patch update for 1.7.2, Doesn't compile, not done yet. + LexManos: + Updated FML: + MinecraftForge/FML@a17489172cd54ca955548b15fa0669c9f95d7f45 Code to disable mods at runtime, or other times. + MinecraftForge/FML@85516d9588ebfadbba25f21b2f973e4e81abbaa6 ICraftingHandler, IPickupHandler are now both events. + MinecraftForge/FML@e4b63a1801b453797f5e820eb3f5bd42e6d43948 IWorldGenerator now has an ordering at registration time. This means the order of worldgen should be much more stable. + MinecraftForge/FML@ef3856f9a34e82a05cb2b7715e3611f8fb1a9a6b Update patches for Gradle's rename rewrite: MinecraftForge/ForgeGradle@19e7acf2a27a6c6ae60f6e8ab38337defddc16d3 + MinecraftForge/FML@31ea100b29dfdb4fc907e212c3d49a5240ca72a9 Working on id missing handling + MinecraftForge/FML@3e76dfba34aaba4397fc3fb2bd28e0d1f0abe3e4 More tweaking on id stuffs at worldload + MinecraftForge/FML@f860c8ad3bc7537f885b27c7f045b5b1140c05f4 bump to legacy launcher 1.9 with logging unification stuffs. + jdroque: + Refactored BiomeManager stronghold add/remove methods to support new + + MapGenStronghold dynamic biome changes. + Changed InitNoiseGensEvent to pass a NoiseGenerator array instead of + NoiseGeneratorOctaves due to new NoiseGeneratorPerlin in + ChunkProviderGenerate. + Fixed worldgen crash caused by wrong metadata in Chunk patch. + LexManos: Get object based on identity not name. + LexManos: Forge uses the FORGE channel for packets. + LexManos: Fix MethodNotFound crash when shutting down internal server. + LexManos: + Fix: + Block placement/interaction + Tesselator crash due to wrong mapping + Missing isreplaceable check in world.canPlaceAt + Small foratting/logging cleanup + Temporarly commented out efficancy changes till I implement it. + LexManos: + Updated FML: + MinecraftForge/FML@58132ccda3a575f10fc209c421fd5d80e01164cc Add new required --accessToken to launch specs. + LexManos: Bump version to 10.12.0 to mark 1.7. + LexManos: Fix debug HUD rendering semi-transparently. + LexManos: Temporary fix for items rendering with effects on one layer. Restores default vanilla rendering, which is considered a bug in modded community. + LexManos: Move Grass {Flower} registry to BiomeGenBase as 1.7 made flowers Biome specifc, this means modders who wish to add global base flowers need to add them to all the biomes indavidually. + LexManos: Fixed accedential inverted logic that caused Potions to render incorrectly. Thanks iChun. + LexManos: Fix items rendering on the GUI with invalid state due to glint rendering changing it. Thanks iChun. + Christian: + Updated FML: + MinecraftForge/FML@156a9ae03a3c80bd1499a8e692c44a322ad9df62 Fix build script + MinecraftForge/FML@7d3b1250e8368886bed0e0da350a94abaa4b6247 Fix handshaking properly. Also, fix ID syncup. It now will completely freeze the idmap after preinit. This frozen map is used to inject "new" stuff into existing serverside worlds. Interesting sideeffect: remote servers lacking things will change the client, to also LACK ids for those things. watch for -1 ids in your remap events. Note: idmaps should be considered temporary per server instance. SERVERSTOPPED will restore "startup" state, as will client logout. + LexManos: + MinecraftForge/FML@c180d9b15735ce89a38c497acd65fa3fab595f77 Add 1.7.2 base json, Gradle will automatically download updated versions of this. Keeping it in the repo allows us to se + e what base json we have built our jsons off of. And if it changes update accordingly. + LexManos: Added constructor to WorldType, and delegated the BiomeLayer management to it. Also updated the access transformer for Item/Block classes. + LexManos: Forgot to regen patches... + LexManos: Resize pending tile updates when it goes over the curent length. Fixed AIOOB error. + LexManos: Add a version check mechanic to startup, it is done in a seperate thread and has a config option to compleetly disable it. This allows us to notify users of new recomended builds. Hopefully stemming the flow of outdated help request. Also adds a warning to the main screen if you are running a 'Beta' Forge. Which means a Forge for a new version of Minecraft that we have not promoted a recomended build for yet. + LexManos: Fix dig speed on redstone ore and obsidian. + ohai.iChun: Add render offset to event. + Christian: + Updated FML: + MinecraftForge/FML@268bbabee6ae3fa1d596bd18e172298e26dc9ce4 Fix handling world reloads when new stuffs are added + +Build 1.6.4-9.11.1.964: + LexManos: + Bump build for gradle fixes: + Now Builds for java 1.6 + Include version,json in universal + Fixed classpath issues in eclipse task. + +Build 1.6.4-9.11.1.963: + luacs1998: + Update readme for ForgeGradle + + Let me know if there's anything else to add or change. + luacs1998: Updated + luacs1998: Another update for eclipse users + luacs1998: Update README.txt + +Build 1.6.4-9.11.1.961: + LexManos: Updated FML: MinecraftForge/FML@c2b919d339e5f63271cfb67a77235c21c5c3b80e Don't validate signatures in dev env. + +Build 960: + AbrarSyed: Step 1: The Purge + AbrarSyed: update FML for gradle changes + AbrarSyed: Step 2: The Reformation + AbrarSyed: Step 3: The Rebirth + AbrarSyed: fixed versioning and stuff + AbrarSyed: added buildSrc to the gitIgnore + LexManos: Fix for new FML, and publish to maven local + LexManos: Update run configs. + LexManos: + Updated FML: + MinecraftForge/FML@e9a7660cb8961660186c7c23e61ab35f9c2dfb81 updated samples + MinecraftForge/FML@30894f7afadf5d3f3c3d5a54c3f904413d5f2309 Merge pull request #307 from AbrarSyed/master + MinecraftForge/FML@c4b8a393f90b00ad7ee4992ea4341ffb6d676abb Make the working directory the root of the eclipse workspace. + LexManos: Regenerate all patches, No functional change as added this is a formatting change only. + AbrarSyed: update build.gradle + porcariadagata: Make the gradle wrapper executable. + LexManos: Proper configuratuion name for jenkins. + LexManos: Fix build file pom closures. + +Build 1.6.4-9.11.1.953: + LexManos: Fix NPE on specific tile entities when the block break event is canceled. Closes #863 + LexManos: Fix NPE in FakePlayers when they are created in a purely client side environment. To remove in 1.7 as FakePlayers should be used for server side interaction with the world on a player's behalf, not for client rendering. + +Build 1.6.4-9.11.1.952: + Christian: + Updated FML: + MinecraftForge/FML@23baf3a8ce58cb8306189401a60647957ccbb4c2 Actually fix the nethandler code + + Update patches + +Build 1.6.4-9.11.1.951: + Christian: + Updated FML: + MinecraftForge/FML@b7f34629c3c47b92ee89d72b0dc935b4997cb009 Don't try and open GUIs on the server. + Christian: + Updated FML: + MinecraftForge/FML@da72640c7ef1f44c49f7f592fbdd193622a30b40 Way to go, missing import. *sigh* + +Build 1.6.4-9.11.1.949: + Christian: + Updated FML: + MinecraftForge/FML@6af42bc656dfb98972d034363352affc9e777805 Add in null protection for client/server sides of handleChat + Christian: Don't send openGui commands from the fakeplayer. Fixes thaumcraft and probably others. + +Build 1.6.4-9.11.1.948: + CovertJaguar: Fix Water/Lava Fluid Localization + +Build 1.6.4-9.11.1.947: + LexManos: Noop out FakePlayer.addStat. + +Build 1.6.4-9.11.1.946: + Christian: + Updated FML: + MinecraftForge/FML@3d25b4e793c59a9131a441d6c7a2d80cac9cd701 Add in the ability to strip interface references for specific interfaces - this is probably mostly useful for scala scenarios where sythetic methods are generated and is not a substitute for using Optional.Method where appropriate. Closes #300 + +Build 1.6.4-9.11.1.945: + onibait: Add block break events based on @bloodmc's initial 1.5.2 Pull Request + onibait: Add block break events based on @bloodmc's initial 1.5.2 Pull Request + onibait: Fixed formatting + onibait: + Cleaned up patches to BlockOre and BlockRedstoneOre + Fixed trailing whitespace (it bugs me too) + +Build 1.6.4-9.11.1.944: + Christian: + Updated FML: + MinecraftForge/FML@f4532410ec1dbf43ce15dfa78d07e5f7be408b08 Change a couple of warnings, as a prelude to 1.7- preinit is now required for all GameRegistry activity, and every item and block REQUIRES registration. + +Build 1.6.4-9.11.1.943: + Christian: + Updated FML: + MinecraftForge/FML@8f87021b0f1ae5b277ad4d1891761b7a7ae1ab71 Fix derp with custom properties. They work now! + +Build 1.6.4-9.11.1.942: + Christian: + Updated FML: + MinecraftForge/FML@bc57ff9e83803d804e9d5374d76273fcd68611f4 Fix recursive API dependency resolution. Allows nested APIs, such as BuildCraft's + +Build 1.6.4-9.11.1.941: + Christian: + Updated FML: + MinecraftForge/FML@de8ab934d8ae960ebc0dede16218ca1e9e488ebc Fix up duplicate entries + +Build 1.6.4-9.11.1.940: + Christian: + Updated FML: + MinecraftForge/FML@81fe1c9682234297443402a54e4b852ef49d0ba8 Add in an API marker for API type packages. This does several things: 1. Packages marked as API will generate a new "modid" (the provides) that can be depended on. 2. Packages marked as API will be searched systemwide, and anything declaring that package (even without the API marker) will get an implicit dependency on the API package. 3. The API package itself will get a soft dependency on the "owner" package. + +Build 1.6.4-9.11.1.939: + LexManos: Add new recipe sorter that is called after all mods are initalized. This is disabled by default in 1.6 to not break current worlds as it may change machine's recipy outputs. Will enable by default in 1.7. Players may enable it in the forge config. + +Build 1.6.4-9.11.1.938: + xcompwiz: + Adds a Check to prevent Biome Replacement + + Splits the BiomeGenBase constructor to create one which takes a flag + that indicates whether to insert the biome object into the biomeList + array. The standard constructor calls the new one with the default of + true. This allows biome wrapper-objects to exist. + +Build 1.6.4-9.11.1.937: + Christian: + Updated FML: + MinecraftForge/FML@dac7f590eabb326c4467dbc829b4aae1e4be2779 Modify ordering of networkmod registration and mod instantiation. This fixes VersionCheckHandler logging an incorrect failure message due to NPE. + MinecraftForge/FML@f0dc530b2833a1c89673208fe296dba5520671c1 Fix up documentation of VersionCheckHandler - it only ever accepted a String and only works on the NetworkMod annotated class + MinecraftForge/FML@243a21a353e6b7717f64008776928c7132110ddf Wrapping coremods as tweakers. Part 1. + MinecraftForge/FML@58a299aabcfadb4139f126a2d46b5247bede4185 Attempt to inject coremods as tweakers, so both can share a dependency ordering + LexManos: Format strings properly in MC's internal logger. Fixes resource pack case warnings. + +Build 1.6.4-9.11.1.935: + LexManos: Updated FML: MinecraftForge/FML@bf54d4d66799f2e58944095826d0722ed0120b1f Make each mod's EventBus log a child of it's main logger. + LexManos: Fix null pointer exception in BiomeDictionary causing the ChunkManager's config to not load/save. + +Build 1.6.4-9.11.1.934: + LexManos: Add wildcard versions of OreDict replacements, Closes #827 + +Build 1.6.4-9.11.1.933: + Christian: + Updated FML: + MinecraftForge/FML@da4337efbfa07b35f5883107768f9ba2f1b24b9b Fix up handling the new method signature data for NetworkCheckHandlers + +Build 1.6.4-9.11.1.931: + Christian: + Updated FML: + MinecraftForge/FML@f92962bbbbb90c19788a5dc2eafdc2eeefdd77ce Use null to empty, so missing values work. *sigh* + +Build 1.6.4-9.11.1.930: + Christian: Add in an event for zombie summoning. Allows for mods to control summoning behaviour, as well as custom summoned mob. + Christian: And remember to make the event class static *sigh* + +Build 1.6.4-9.11.1.928: + Christian: And allow for tweaking baby chance as well. + Christian: And set the RIGHT variable *sigh* + +Build 1.6.4-9.11.1.926: + Christian: Allow configuration of the zombie additional summoning mechanic. The vanilla mechanic is a little borked at times. + +Build 1.6.4-9.11.1.925: + Christian: + Updated FML: + MinecraftForge/FML@58577775d277a4408bda510534eb36841b08ced4 Very minor style fixes + MinecraftForge/FML@96be82343c25b83dd842ada8d6e8b66eb4e4ee00 Merge pull request #280 from mc10/patch-1 + MinecraftForge/FML@2714da10228020a6f2321f6c9a703f0d24fe1370 Primitive capability for tweakers to order. Add a "TweakOrder" integer property to your manifest, or accept the default of zero. + +Build 1.6.4-9.11.1.924: + LexManos: Prevent session from being printed to the console, also make sure the username is not empty. Causes a lot of bugs further down the line. + +Build 1.6.4-9.11.1.923: + Christian: + Updated FML: + MinecraftForge/FML@fc3e7647d2aff01146b1f5bd2ab6b57ef8e833e5 Support, and fix up, interface lists for Optional + +Build 1.6.4-9.11.1.922: + LexManos: Added some missing air checks to world gen features. + +Build 1.6.4-9.11.1.921: + LexManos: Fix repeated argument in CleintCommands. + +Build 1.6.4-9.11.1.920: + LexManos: MinecraftForge/FML@a381874bb9c3bdeeb508bb81719b4d210eb29696 Delay sound system backend initalization to speed up startup and prevent race condition on some computers. + +Build 1.6.4-9.11.1.919: + reflex_ion: + Added PlayerOpenContainerEvent and added ForgeHooks.canInteractWith + + - Used to override the canInteractWith during player tick + - setResult to ALLOW/DENY as required + - Defaults to Vanilla behaviour in any other instance. + + Required for LittleBlocks Mod and to Assist Gullivers Mod + +Build 1.6.4-9.11.1.918: + Christian: + Updated FML: + MinecraftForge/FML@bc64ceabef76b1f4667b22ca8241b72351b44338 Optional shouldn't be constructable itself. It's purely a wrapper thing. + MinecraftForge/FML@55525f6d2eb24f42c26a291b8ce98feb4d4498c9 ModLoader is officially deprecated. It will all cease to be with 1.7. + +Build 1.6.4-9.11.1.917: + Christian: + Updated FML: + MinecraftForge/FML@63ba3aa0099f43183315fb4e16f9e8e8007362f8 Add in support for Optional interfaces and methods. Be gone coremods! + +Build 1.6.4-9.11.1.916: + LexManos: Fix missing patch which caused per-world storage to not be saved. + +Build 1.6.4-9.11.1.915: + rhilenova: Added pre/post to player list rendering in GuiIngameForge. + rhilenova: Moved PLAYER_LIST event inside display check. + +Build 1.6.4-9.11.1.914: + LexManos: + Make isItemStackDamageable() pass the stack to getMaxDamage() to use the Forge version of getMaxDamage(). + Fixes display issues with mods using getMaxDamage(ItemStack) instead of the vanilla one. Closes #805 + LexManos: Bump version number for todays changes. + +Build 1.6.4-9.11.0.913: + ben.blank: allow blocks to choose how they handle indirect power + ben.blank: move `shouldCheckWeakPower` to Forge section + +Build 1.6.4-9.11.0.912: + jrtc27: Pass arguments to install.sh and install.cmd to install.py + +Build 1.6.4-9.11.0.911: + LexManos: Add cancelable EntityStructByLightningEvent, Closes #789 + +Build 1.6.4-9.11.0.910: + LexManos: Stack sensitive version of Item.getItemStackLimit. Closes #771 + +Build 1.6.4-9.11.0.909: + anthonylomeli11: Villager Trading GUI will not open if Player is sneaking. + +Build 1.6.4-9.11.0.908: + LexManos: Added all the vanilla records to the ore dictionary. Closes #731 + +Build 1.6.4-9.11.0.907: + LexManos: Direct canApplyAtEnchantingTable through canApply Closes #740 + +Build 1.6.4-9.11.0.906: + LexManos: Add pre and post event to rendering Chat, allowing for placement of the chat box. Closes #733 + +Build 1.6.4-9.11.0.905: + LexManos: Set densityDir in BlockFluidBase's constructor, closes #737 + +Build 1.6.4-9.11.0.904: + LexManos: Fix placement of snow cover over metadata 6. Closes #724 + +Build 1.6.4-9.11.0.903: + LexManos: + Add the ability to register chat commands that only execute on the client. Works with autocomplete. + Client commands are gray when shown in the autocomplete list (when you press tab) + Closes #640 + +Build 1.6.4-9.11.0.902: + LexManos: Update workspace to point at launchwrapper 1.8 + LexManos: Vanilla hopper should obey the IInventory contract, TileEntityHopper now takes into account IInventory.getInventoryStackLimit() when inserting items Closes #597. + +Build 1.6.4-9.11.0.901: + hobos_taco: + Added ItemTooltipEvent + + This event is fired at the end of ItemStack.getTooltip(EntityPlayer, boolean), which in turn is called from it's respective GUIContainer. It allows an itemstack's tooltip to be changed depending on the player, itemstack or whether the advanced information on item tooltips is being shown, toggled by F3+H. + +Build 1.6.4-9.11.0.900: + Christian: + Updated FML: + MinecraftForge/FML@5265e34a350adbb762264379f0134bfa40d33eaa Fix null killing the server + +Build 1.6.4-9.11.0.899: + LexManos: MinecraftForge/FML@35ab9f52b02d84592e4c7607feb6009710b2f7d9 Fix md5s for new checksums.sha1 in scala libraries. + +Build 1.6.4-9.11.0.898: + Christian: + Updated FML: + MinecraftForge/FML@e356f4d713b1269825839954fe86f5312ede0fc6 Cross-modsystem compatibility fix with thanks to Mumfrey @ liteloader + MinecraftForge/FML@9b55f1f48f89a5348ac1d58622b71946f310316a Attempt at a shared modlist implementation - should allow visibility between liteloader and fml for "mod list display" + +Build 1.6.4-9.11.0.897: + Christian: + Updated FML: + MinecraftForge/FML@bfc25bc5da1ff0f6fd0faf817b32a8f6d35dedc2 Add to both the classloader and the parent + +Build 1.6.4-9.11.0.896: + Christian: + Updated FML: + MinecraftForge/FML@9f0f9e7288afc6cce9a425ad770a208af9e28648 Fix deobf tweaker + +Build 1.6.4-9.11.0.895: + Christian: + Updated FML: + MinecraftForge/FML@ce6404fd5bb5e8e425af3bcafeaa285575bf39a3 TYPOS!!! + +Build 1.6.4-9.11.0.894: + Christian: + Updated FML: + MinecraftForge/FML@8f18a3de9a02b003762dace891829ef64dfedf49 Separate deobf tweaker so it runs last. Should fix problems with cascaded tweakers expecting an obf environment. + +Build 1.6.4-9.11.0.893: + Christian: + Updated FML: + MinecraftForge/FML@8e26c99de3b44d272d2fdc398e0687db17bce3b7 Add debugging for deobfuscation + MinecraftForge/FML@1d902df5814b815959165e4aa69272003f002d25 Use the negative cache in latest legacylauncher. + MinecraftForge/FML@9815d8c3793182a08fcdbd29376a3f70bff464d0 Update for launchwrapper 1.8 + +Build 1.6.4-9.11.0.892: + LexManos: Add wrapper exception to the new Structure ID system to point to the correct Structure. + +Build 1.6.4-9.11.0.891: + LexManos: Update dev workspace for 1.6.4 .. + LexManos: Remove some side onlys on BiomeEvents that don't need them. + LexManos: Fixed typo in bounding box based ladder checks that caused potential infinite loops with entities in certian positions. Thanks Overmind for reporting it. + LexManos: + Updated FML: + MinecraftForge/FML@fc8c3bef0380d59c0842a252e4f0bd29127ee78b Update to new installer that uses xz compression and better support for non-standard jvms + +Build 1.6.4-9.11.0.886: + Christian: + Updated FML: + MinecraftForge/FML@a4de22c1addf0a6b95d38e467a96f2af417c86d5 And use the parent that's actually going to be valid. *sigh* + +Build 1.6.4-9.11.0.885: + CovertJaguar: + Fluid Rarity should have a default + + Oops. + Christian: + Updated FML: + MinecraftForge/FML@70cffe6982b27df0ea7d8d4d8851a0c0043bb2cb Herpaderp. Make addURL accessible. *sigh* + +Build 1.6.4-9.11.0.884: + Christian: + Updated FML: + MinecraftForge/FML@4a94c2c71bb4cc9644caeb06011a189989b22f87 Fix NPE when loading second single-player world + MinecraftForge/FML@0e80fcb8f716cfef5b016a73ca32ff0e2f3c3c05 Merge pull request #284 from smcv/uninit + MinecraftForge/FML@39620f1e41464f53482277dc3bcb0b9eed8ca25c Fix injection of tweaker into system + +Build 1.6.4-9.11.0.883: + Christian: + Updated FML: + MinecraftForge/FML@79c39f8b7c711377f7919abd1ee6a56a339d1062 Fix classpath for launchwrapper 1.7 + +Build 1.6.4-9.11.0.882: + traincrazyb: Correcting SoundManager Transformer + +Build 1.6.4-9.11.0.881: + Christian: Clean patch fuzz + +Build 1.6.4-9.11.0.880: + Christian: + Updated FML: + MinecraftForge/FML@f6190e8752013c0d6857090ffd42559cf83809ae Update workspaces for 1.6.4 + +Build 1.6.4-9.11.0.879: + Christian: + Updated FML: + MinecraftForge/FML@25981706ef12654b6c2baccc80fa2298bb5afb4a Update for MC 1.6.4 + MinecraftForge/FML@0950b9fc8441a2d3b022ed876f17ee5ac0c47b9c Fix up a deep crash in the early server init hanging the client + +Build 1.6.3-9.11.0.878: + LexManos: Remove duplicate access transformer + LexManos: Move have handler creation up, to prevent NPE. + +Build 1.6.3-9.11.0.877: + LexManos: + Updated FML: + MinecraftForge/FML@e7dd728f955aa4713fef45fea770b1f91246d712 Format the log messages through MessageFormat. Thanks CovertJaguar for the pointer. + MinecraftForge/FML@82d896a35e08be5712bdc15bdb93e5d4fc0ddd46 Make final transformers actually work on methods as well. + +Build 1.6.3-9.11.0.876: + LexManos: Move the Structure data save files to per-world data folders. Vanilla saves them to the global folder which will potentially cause conflicts if two worlds generate 'Villages'. Which in the modded world is highly likely. Refer back to the long standing vanilla issue where nether 'villages' would override the overworlds villages, it's the same situation. + +Build 1.6.3-9.11.0.875: + LexManos: Make MapGenStructureIO name registration functions public, Any mod that has anything extending StructureStart or StructureComponent must register there classes and create a default (no parameter) constructor. + +Build 1.6.3-9.11.0.874: + LexManos: Unfinalized Item.getIconIndex(ItemStack) + +Build 1.6.3-9.11.0.873: + LexManos: + Updated FML: + MinecraftForge/FML@da70cdd35a378d02db47d2aa31fb9aac87beaedc Update tweaker for new Launcher API + MinecraftForge/FML@352117fd78eec745da6c80b8d354947c4dbbbb48 Update for new installer and thank you. + MinecraftForge/FML@40a34af43105ebcb5a63ce2351ca119da5a8158e Merge branch 'master' into newtweak + MinecraftForge/FML@e77d2547ad447025729ae7f3cccaaf343c4c86f9 Update for pre-ninja 1.6.3 update + MinecraftForge/FML@34493b0d99e2cf2bdca080ff226f2dfeedb1cf51 Update for real 1.6.3 update + MinecraftForge/FML@95afc95b248ecc69bc6ffcc5a95912820d8f4066 Update mcp mod info + MinecraftForge/FML@ff75416a325717770a5cf457c859bfb0abcbe281 Update mc_versions data and commands patch and eclipse workspace + MinecraftForge/FML@8f2e67558127f16d92399ea97cbcb0df46d52e19 Update the src distro's eclipse workspace. + LexManos: Bump version for new MC version. + LexManos: Actually push the submodule update -.- + +Build 1.6.2-9.10.1.871: + Christian: + Updated FML: + MinecraftForge/FML@81328b6684c5127427153807b5e498c2efefb96b Add in support for using a mirror list and provide checksums for packed download of libs + +Build 1.6.2-9.10.1.870: + Christian: + Revert "Added a RenderType that allows Map-style rendering w/o inheriting from" + + This reverts commit eb4688bf5ea132cd8ddc802a7dad6d423ad50543. + + Conflicts: + patches/minecraft/net/minecraft/client/renderer/ItemRenderer.java.patch + +Build 1.6.2-9.10.1.869: + vilim.lendvaj: Prevent NPE in fluid lookup for block + Christian: Fix broken PR from vilml. TEST! + +Build 1.6.2-9.10.1.867: + CovertJaguar: + Allow Fluids to have Rarities + + Used for tool tips. + +Build 1.6.2-9.10.1.866: + Christian: Fix the divider + +Build 1.6.2-9.10.1.865: + Adubbz: + Sky colours now smoothly transition + + Made transitions even smoother + + Sky colours now smoothly transition + Christian: Move stuff around a bit- also tie range and enabled to options. + +Build 1.6.2-9.10.1.864: + ml: + Added a RenderType that allows Map-style rendering w/o inheriting from + ItemMap. + Christian: Tweak patch comment + +Build 1.6.2-9.10.1.863: + mitchpetrie29: Check if block is air instead of just ID zero when growing from stem block. + +Build 1.6.2-9.10.1.862: + Christian: Allows proper raytracing from actual player eye position rather than hardcoded eye heights. + +Build 1.6.2-9.10.1.861: + claire.alexandria: Added fov hook + claire.alexandria: fixed merge + claire.alexandria: Small formatting changes (opening braces on new line) + +Build 1.6.2-9.10.1.860: + Christian: + Updated FML: + MinecraftForge/FML@b5af446d7111730c7973c9f0d6b76e62b78b9131 Fix sidedness derp in LanguageRegistry. + +Build 1.6.2-9.10.1.859: + Christian: The partial tick should be available for all render player events. Weird it wasn't. + +Build 1.6.2-9.10.1.858: + Christian: Reverting HarvestEvent, for new implementation + Christian: Redo harvest event. This time with simpler logic, that should be less liable to weird "missing" stuff. + +Build 1.6.2-9.10.1.857: + LexManos: Fix bug where guis were not closed properly, resulting in signs not having there text set. + +Build 1.6.2-9.10.1.856: + Christian: Change trigger calculation so entities get some time to age before refiring the event. + +Build 1.6.2-9.10.1.855: + LexManos: Create helper apply_patches script and add paramter to change patch output folder. + +Build 1.6.2-9.10.1.854: + Christian: + Change from Cancelable to using a Result. This means you can force despawn mobs you + don't want around anymore. Also, deferred check to once every 20 ticks. May tune it + down further or make it a config if this event is a lag issue. + +Build 1.6.2-9.10.1.853: + Christian: + Add a cancellable despawn event- allows mods to decide to prevent the despawning + of certain otherwise normally despawnable mobs. + Christian: + Added fov hook + + Small formatting changes (opening braces on new line) + Christian: Create es_ES.lang + +Build 1.6.2-9.10.1.852: + Christian: Add some javadoc to the HarvestBlock event. + +Build 1.6.2-9.10.1.851: + Christian: Use the dropchance from the event. + Christian: Clean up some formatting. + +Build 1.6.2-9.10.1.850: + claire.alexandria: Added tessellation methods to obj model, for ISBRH-friendliness + claire.alexandria: Fixed both RenderAllExcept behaviours + claire.alexandria: Added more render methods to IModelCustom interface. + jk-5: + Added GuiOpenEvent + + You can use this for a clean way to override guis, without needing an + TickHandler to check if the gui you want to override is open and show + your own gui + + Proper close check + mhahn: + capacity was not respected + + Updated to properly calculate the amount of free space in the tank + before checking that against the amount of the resource. + robin: create french localization + claire.alexandria: Added display name hook + claire.alexandria: Memoization of display name result + claire.alexandria: Added mouse event + claire.alexandria: inserted hook into Minecraft.java + claire.alexandria: fixed logic error + ohai.iChun: + Fix player push out of blocks clientside being hardcoded and not based on entity size. + Added player eyeHeight field to allow changeable eye heights of players rather than being hardcoded per player class as well as add a getDefaultEyeHeight function. + Christian: Reduce patch size significantly + Christian: Fix patch for new MCP naming. + Christian: Add a bit of javadoc + Christian: MachineMuse, remember, there's TWO model formats supported! + Christian: Defer firing CreateDecorator until it's likely mods have had a chance to register their listener. Should close #759 + Christian: + Add a harvestblock event, to allow mods to intercept and change the drops for blocks. Don't abuse this, or we'll have to take safety measures. + Fires for both silktouch and non-silktouch harvesting, and provides the player. Note, you may need to + change your break overrides to pass on the player for best results. + Christian: Add in a block reverse lookup for fluids. Closes #749 + +Build 1.6.2-9.10.1.849: + Christian: + Update forge for MCP naming updates + + Updated FML: + MinecraftForge/FML@d0c6e92900590f578b80d9a6c00fa28fd333d3bf Update MCP data + Christian: Update version to 9.10.1 for mcp naming changes. + +Build 1.6.2-9.10.0.848: + Christian: Fix possible NPE in searching code. + +Build 1.6.2-9.10.0.847: + Christian: + Updated FML: + MinecraftForge/FML@2a9c485edc4cf3382154d5b3b9b600386f2ab8ae Remove @SideOnly from 70318 (getDistance) it makes no sense that it's not on the server. + +Build 1.6.2-9.10.0.846: + Christian: + Updated FML: + MinecraftForge/FML@a13598b17ea9637c054d867a76298d6c080c5e32 Use java 1.6 compatible method of closing the zip file. Stops stupid compile error. + +Build 1.6.2-9.10.0.845: + Christian: Small fix to container registry. emptyContainer is not null, it's "NULL_EMPTYCONTAINER" now and won't match any valid container. + +Build 1.6.2-9.10.0.844: + Christian: Tweak the release to add in assets to the distributable. *sigh* + +Build 1.6.2-9.10.0.843: + Christian: + Updated FML: + MinecraftForge/FML@1c9a853868f7df0daa5f67b99401dfab44ae18e6 Allow coremods to properly inject asset readers. + MinecraftForge/FML@40b54013b4c9b01686411cd47a7866eeb650ea2b Allow server side lang file injection, hopefully + Christian: Add some starting work for a forge tps command. Also update coremod for new FML behaviour + +Build 1.6.2-9.10.0.842: + Christian: + Updated FML: + MinecraftForge/FML@b993cf4a9825865b3a8a0c7b083c23d56dbd1d6f More exception handling for less derpiness. + +Build 1.6.2-9.10.0.841: + Christian: + In the time honoured tradition of trying to fix vanilla, we today attempt to patch the pathfinding AI so that it doesn't lag when + there's a lot of entities. Basically, if the zombie can't reach the villager, backoff subsequent pathfinding attempts. Hopefully + should really help with lag caused by zombie swarms. + +Build 1.6.2-9.10.0.840: + Christian: Allow multipass RenderItem rendering for terrain icons too. Should fix sengir's saplings. + +Build 1.6.2-9.10.0.839: + Christian: + Updated FML: + MinecraftForge/FML@913f6f6d36bd179db7c147db0485e99dee693933 Try and use the relaunch log, which should be classloaded.. + MinecraftForge/FML@ac065ff5f76b6c512b346366107efde66e9e1c88 Reset the IWorldGenerator seed for each mod, before calling. That should mean worldgen is consistent and not dependent on mod ordering, or mod sideeffects. + +Build 1.6.2-9.10.0.838: + LexManos: Cache world on all render passes in case some mod disables the first pass. + LexManos: Skipp toss event for null entity items. Closes #732 + +Build 1.6.2-9.10.0.837: + LexManos: Fix bug with custom Fluids. You can now drown in them! + +Build 1.6.2-9.10.0.836: + Christian: + Updated FML: + MinecraftForge/FML@9468e41bbf3ea425c50daa710cf3ada11c82b238 Fix up scala refs, for better results + +Build 1.6.2-9.10.0.835: + Nick: + Adds Temperature to Lava + + Missing lava temperature. Feel free to change it to any value. + 1300K is the typical max for Magma so wasn't sure what was desired. Regardless, better than the same temp as water at 295K :smile: + +Build 1.6.2-9.10.0.834: + Christian: + Updated FML: + MinecraftForge/FML@4a9d0f9bd522e543b76daaf9c49b6214443c595f Add in some log information + Christian: + Updated FML: + MinecraftForge/FML@f157e7a6ecdeac2758fc0eaf547d3e8a763fb15b And more coremod logging + Christian: + Updated FML: + MinecraftForge/FML@ffdd056a18eddb8f28b74435d40e69c956b9dd48 Check keys, not values *sigh* + +Build 1.6.2-9.10.0.833: + Christian: + Updated FML: + MinecraftForge/FML@03989166665956df03aa85472eb13dca2d74a38d And actually instantiate the collection *sigh* + +Build 1.6.2-9.10.0.832: + Christian: + Updated FML: + MinecraftForge/FML@dec9a3924d361bc016cb7f6b3e95764158cf5ae1 Add in "FMLCorePluginContainsMod" in the manifest. If this value is present, FML will attempt to parse your mod jar file as a normal mod file as well, instantiating mod containers there. + +Build 1.6.2-9.10.0.831: + Christian: + Updated FML: + MinecraftForge/FML@24701206808a43b9c7b10d7130c47b5d1e841bb6 Clean up a couple of resources. Also, don't parse jars just because they're in the mods dir + +Build 1.6.2-9.10.0.830: + Christian: + Updated FML: + MinecraftForge/FML@9a5e24e338c6172531efb086a4b584c26d4f1435 Fix stupid derp is stupid. Closes #275 and means sp614x can do his thing + MinecraftForge/FML@ba90b616070ce15793eb05e5afaed62a6f07c6e7 Make sure we only add args to the argument list if a tweaker hasn't already. Should fix LiteLoader compatibility issue. + +Build 1.6.2-9.10.0.829: + LexManos: Fix NPE in enchangint books. + +Build 1.6.2-9.10.0.828: + LexManos: Fix inverted case, search works now. + +Build 1.6.2-9.10.0.826: + ross.swartz: Add stone and cobblestone to Ore Dictionary + ross.swartz: Update OreDictionary.java + LexManos: Addition: Added isAllowedOnBooks hook to Enchantments Closes #589 + +Build 1.6.2-9.10.0.825: + LexManos: Deprecate Block.addCreativeItems, Kill in 1.6.3+ Closes #655 + +Build 1.6.2-9.10.0.824: + mehvids: Add onNeighborTileChange callback to block by generalizing func_96440_m to all blocks rather than just comparators. + +Build 1.6.2-9.10.0.822: + malc.geddes: Added a new function to allow control over whether an entity is dismounted when the entity it is riding goes under water + LexManos: Allow creative tabs to have a search box if they want to Closes #592 + +Build 1.6.2-9.10.0.821: + tommy.stanley96: Fixed Fluid Non-Solid Block Duplication + tommy.stanley96: Fixed Double Item Drop + tommy.stanley96: Fixed Classic Checking + +Build 1.6.2-9.10.0.820: + LexManos: Add optional feature to check entire bounding box for ladders. Closes #709 + +Build 1.6.2-9.10.0.819: + LexManos: Only refresh vanilla tile entities when IDs change. + +Build 1.6.2-9.10.0.818: + LexManos: + Updated FML: + MinecraftForge/FML@f275a24b43559cfdced243ff77e9848c9d458362 Add in some reverse lookup methods for game registry data + MinecraftForge/FML@cb05c8c4aa60a131de92f0a21c06697c8f8896a8 Add missing SideOnly in BaseMod + MinecraftForge/FML@1857064afa9ace796440c19f3275637a6e659375 Merge pull request #266 from grompe/patch-1 + MinecraftForge/FML@182aa9c0cbe61ac69b0d428ead1dc817dd2a2e71 Fixed install.sh not passing arguments to install.py + MinecraftForge/FML@f46a538b41157081c840f647f123513ac4c5a071 Merge pull request #268 from Bo98/sh-args-fix + MinecraftForge/FML@29ef3d5ab412dcabbd67695558880c45011ace82 Update installer. + +Build 1.6.2-9.10.0.817: + tommy.stanley96: + Fluid Render Fix + + Formatting + ohai.iChun: Add Pre and Post events for RenderLivingEvent + ohai.iChun: Add Pre and Post events firing for RendererLivingEntity + ohai.iChun: if statement added + ohai.iChun: Update RendererLivingEntity.java.patch + tommy.stanley96: + Fixed fluids eating each other + + Fluids check for other fluids density before flowing, if their density + is higher they can flow into the other fluid, if not they can't. + CovertJaguar: Add SneakClick bypass to client + cpw: Fix names for water/lava fluids. Closes #689 + cpw: + Add support for loading legacy liquid stacks as new fluid stacks. + Requires having been written with the "liquidname" code from forge 1.5.x + cpw: + Add a translation map for looking up legacy liquid names to convert + to new fluid names. + tommy.stanley96: Fluid Rendering Fixes + cpw: Fix formatting error in PR + cpw: + Tweak setBlock in update tick - it should only send serverside updates for + source blocks. Experimental attempt to fix worldgen issues for fluid blocks + cpw: + Updated FML: + MinecraftForge/FML@57befa89bbbf2bc2fcc4a97b78e07b3f9e23ef9d Fix keybindings being derped + MinecraftForge/FML@1d84e8063e9d0dc73928dba006e6001201285cad Temporarily add a version of 'reobfuscate.py' that will resolve complex reobfuscation graph issues with specialsource. Copy it over 'reobfuscate.py' in the mcp runtime dir. Hopefully will have an MCP/specialsource fix in the coming days. + ohai.iChun: Fix RenderLivingEvent.Pre/Post not being fired by most Renders. + tonkamatt98: + added temperature to fluids + + it could be useful for blocks that are affected by temperature + mitchel.pyl: Fix render colour on bottom of fluids + mitchel.pyl: Fix small derp + +Build 1.6.2-9.10.0.816: + purpleposeidon: + Add an InputStream constructor to WavefrontObject + + It is said that Resource Packs will return InputStreams. And I like putting my models into texture packs which, obviously, give InputStreams rather than URLs. + 7of9: Add cloud height to WorldType + +Build 1.6.2-9.10.0.815-miscchanges: + mitchel.pyl: Fix render colour on bottom of fluids + mitchel.pyl: Fix small derp + +Build 1.6.2-9.10.0.812-miscchanges: + tonkamatt98: + added temperature to fluids + + it could be useful for blocks that are affected by temperature + +Build 1.6.2-9.10.0.811-miscchanges: + ohai.iChun: Fix RenderLivingEvent.Pre/Post not being fired by most Renders. + +Build 1.6.2-9.10.0.810-miscchanges: + cpw: + Updated FML: + MinecraftForge/FML@57befa89bbbf2bc2fcc4a97b78e07b3f9e23ef9d Fix keybindings being derped + MinecraftForge/FML@1d84e8063e9d0dc73928dba006e6001201285cad Temporarily add a version of 'reobfuscate.py' that will resolve complex reobfuscation graph issues with specialsource. Copy it over 'reobfuscate.py' in the mcp runtime dir. Hopefully will have an MCP/specialsource fix in the coming days. + +Build 1.6.2-9.10.0.809-miscchanges: + cpw: Fix formatting error in PR + cpw: + Tweak setBlock in update tick - it should only send serverside updates for + source blocks. Experimental attempt to fix worldgen issues for fluid blocks + +Build 1.6.2-9.10.0.808-miscchanges: + tommy.stanley96: Fluid Rendering Fixes + +Build 1.6.2-9.10.0.807-miscchanges: + cpw: + Add a translation map for looking up legacy liquid names to convert + to new fluid names. + +Build 1.6.2-9.10.0.806-miscchanges: + cpw: + Add support for loading legacy liquid stacks as new fluid stacks. + Requires having been written with the "liquidname" code from forge 1.5.x + +Build 1.6.2-9.10.0.804: + copyboy: Fix getArmorTexture by passing it the subtype + +Build 1.6.2-9.10.0.802: + LexManos: + Re-added deprecated liquids system. To be removed next major MC versions after issues with Fluids are fixed. (reverse-merged from commit 9b5208fa308f22c24e295ce3be38dcafea2857ea) + This WILL be removed and should not be developed against aside for a temporary 1.6 release. + +Build 1.6.2-9.10.0.801: + LexManos: Remove SideOnly(Client) in IBlockAccess.isAirBlock + +Build 1.6.2-9.10.0.800: + LexManos: MinecraftForge/FML@10b16d32da4b7c32b15e69cf1c636505ebbe2540 Use json 2.9.1 nightly for OSX in release json like vanilla does. + +Build 1.6.2-9.10.0.799: + LexManos: General code cleanup of Fluid system. Made Fluid icons and associated functions non-sided. + +Build 1.6.2-9.10.0.798: + LexManos: MinecraftForge/FML@3f21a2c1b413e591f61f2906c3adbadd9c5b09e3 Stupid spaces and windows escaping -.- + +Build 1.6.2-9.10.0.797: + LexManos: MinecraftForge/FML@b2958c9066db8c95bb4260893fbfe00103fc4ba1 Add quotes for paths with spaces -.- + LexManos: Package 'version.json' with universal jar for maunchers to use. It's the json used by the vanilla Minecraft launcher for Forge. + +Build 1.6.2-9.10.0.796: + LexManos: MinecraftForge/FML@9520978b81d4cba5d8b0af0d5f155bd115023795 Use a temporary file for recompile's command line to combat command length to long issues. + +Build 1.6.2-9.10.0.795: + LexManos: Updated FML: MinecraftForge/FML@4981aa3421262c3c1c4705468fe202df8198b9f0 Fix potential NPE in villager skin registry. Closes #678 + +Build 1.6.2-9.10.0.794: + Nick: + Fixes Vanilla Fluid Still Icon Setters + + Fixes null icons from being set for both the still water/lava icons, and sets the correct Icon. + +Build 1.6.2-9.10.0.793: + LexManos: Updated FML: MinecraftForge/FML@c48b48ee15f38d3e794b6eb3499c536226ca5a79 Fix server launching. + +Build 1.6.2-9.10.0.792: + Christian: Fix for new location of mcp logo. + +Build 1.6.2-9.10.0.791: + Christian: + Updated FML: + MinecraftForge/FML@0378355c3720d587652b7792665a8b70bf104eb3 The server.classpath generates the runtime manifest, so it needs the non-debug asm jars. + MinecraftForge/FML@a3f48734ffbbb2eccffdafcd3cbe73824bd1afd6 Fix up jar sanity check code. FML validation of the jar works now and doesn't derp classloading. + MinecraftForge/FML@9947ba85036542a3231e25328d3300f2a5337370 Fix logo handling. no more NPE if the logo can't be found. Also, fix location of mcp logo now. + +Build 1.6.2-9.10.0.790: + Adubbz: + Made eating particles compatible with metadata + + Removed extra spaces + + Made eating particles compatible with metadata + Christian: + Updated FML: + MinecraftForge/FML@e44e8b3112bd56c716a00c19d0be2f15d9128b70 Force a global asset scan prior to mod construction : you should be able to reference assets anywhere in your mod now. + MinecraftForge/FML@20e93a412ee13498babef02d404f57bf5e0fd919 Fix up logos in the mod screen. Clean up some unnecessary casts and suppressions, use the -debug asm library at dev time, since it contains full symbols and code in compiled form. + LexManos: MinecraftForge/FML@b9f4b02cb0b041594656f05de70225df702a8ddd Kill mcp's truncate method, for more useful logs. + LexManos: + Updated FML: + MinecraftForge/FML@7348929819b0ae8ad35419ef5dbf66e66b442858 Kill release time scala libraries, to be re-evaluated after all movement is done and shit is fixed. May require manual instalation for mods that use scala. + MinecraftForge/FML@6de36d78f57f6f08ec586b67b684d0e5406cd436 Coremods now have a primitive dependency capability. Also, we search mods dir for special "TweakClass" manifests. These are using the vanilla tweak mechanism to inject into Minecraft. Helpful for other "platform" systems, when you don't want to have to deal with json changes! + MinecraftForge/FML@d4b30422b64a62a2f8a8c2cccd94cb0fd06154e0 Update build and eclipse workspaces for debug asm. + LexManos: MinecraftForge/FML@c625ef30093abb0755985c74d1f31e2c4cf6cfdd Update Forge signature for new private key + LexManos: Update changelog generator to point to new jenkins. + LexManos: Monkey patch to try and make print flush properly. + +Build 1.6.2-9.10.0.789: + LexManos: Re-add reverted patch AGAIN cpw check your commits -.- + +Build 1.6.2-9.10.0.787: + Christian: + Updated FML: + MinecraftForge/FML@bab4d87ce76baa40200939cc46780b1d3b2ff466 Update FML for new stealth update for 1.6.2 + +Build 1.6.2-9.10.0.786: + Christian: Remove forge ISidedInventory, deprecated since 1.5. + +Build 1.6.2-9.10.0.785: + Christian: + Allow optional rider interaction for entities, thanks for the suggestion Vswe. + + Updated FML: + MinecraftForge/FML@7af5c21d74679d1a53550f9719bba22b2f28dd13 @InstanceFactory was set to look for Fields instead of methods + MinecraftForge/FML@bc9d1fe657c7a0953adc7d4c5ed81c575bdfb0f1 Merge pull request #254 from CaptainShadows/patch-1 + +Build 1.6.2-9.10.0.784: + LexManos: MinecraftForge/FML@c913258ca38e662264bdf4aafbfbef86881c9290 Disable signature check of client for now, it's broken. + Christian: + Updated FML: + MinecraftForge/FML@97269a5e3dc0a0e2e1a79183f9f5f2ee120e90bd Decode the file URL. Hopefully will make things work more.. + MinecraftForge/FML@d4d522c5978ecd7a9195977b3327b441901bb5b4 And don't forget to remove the test code + +Build 1.6.2-9.10.0.781: + LexManos: + Updated FML: + MinecraftForge/FML@dfa3a2665d6782b87713cea26dda558ac990a72a Add MC Version to installed version name. + MinecraftForge/FML@e91431fb707ce3e7e4296ccb8f3b2e5208b4dfac Don't validate signatures on servers, they are not signed. + MinecraftForge/FML@c7ab872c85dd057a4e44e12e34089dfd1a1184b6 Temporarily disable GuiModList's Mod logos. + +Build 1.6.2-9.10.0.780: + LexManos: + Updated FML: + MinecraftForge/FML@c997f2adbc4c11cd8c2abe5f82ccd00b0e954b68 FML now verifies that the minecraft jar is correct and intact. This is intended to discourage those who think that modifying the minecraft jar is still acceptable. + MinecraftForge/FML@0db4624b27a5ecf59ed506ccfc26459ca26ee408 Don't initialize the server. + MinecraftForge/FML@4fa375683fdb7edff67c951fb371ab4a23435308 Fix NPE in new debug line when patch targets don't exist. + +Build 1.6.2-9.10.0.779: + LexManos: Fix accedential reverted patch. + LexManos: Proper return for getRegisteredFluidContainerData thanks Soaryn. Ref issue #634 + +Build 1.6.2-9.10.0.778: + Christian: Make resourcelocation the class available on the server. + +Build 1.6.2-9.10.0.777: + Christian: + Drop two domain related fixes that have been applied in vanilla. + + Updated FML: + MinecraftForge/FML@c47d08c89dfcacb96e36c427593174e08dcb4224 Tweak debug data on patched classes + MinecraftForge/FML@dbf5fe38cee04288e92d57f8782114b452245bce We now generate an adler32 checksum for each patched file and verify at load time that they match. Mismatch won't crash, but will emit a big warning.. + MinecraftForge/FML@e88a0cd13f63904f7317e1a73880611f58820389 Update for stealth update. Thanks mojang! + MinecraftForge/FML@2336002f20e9412a7663781b23c51de0eff6a692 The game is going to exit in face of patch mismatch, unless you force it to run with fml.ignorePatchDiscrepancies in the system properties. + +Build 1.6.2-9.10.0.776: + LexManos: + Updated FML: + MinecraftForge/FML@1d0384f8f664d7002019b865675a5fddf2963b3d Update for 1.6.2 and MCP 8.04 + MinecraftForge/FML@111b0216fdc55f56a8361a584141bca7c9c3f070 Add the jsons for 1.6.2 + MinecraftForge/FML@6f96d89e2bf9313b26eeb4c334a208bf3e1c9ad4 Update eclipse workspaces for 1.6.2 + LexManos: Remove deprecated Liquids API, Use new Fluids system as replacement. + LexManos: Bump version to 9.10 for new MC version and removal of Fluids. + +Build 1.6.1-8.9.0.775: + Christian: + Updated FML: + MinecraftForge/FML@c97ac284a5e7dbdbccbad2f7ccc95252c4aef239 Update ModLoaderFuelHelper.java + MinecraftForge/FML@3a200e901e34ade679e4485307f57bee725bbe94 Fix coremod injection into main system. Should stop double-dipping coremods. + MinecraftForge/FML@2676c8999cbede05b5475ba68bfc25467a67d4fc Update mcp data. fixes #248 + MinecraftForge/FML@5990e29af7b70e343dfd9cf38bb3e033e71a4489 Merge pull request #247 from jk-5/patch-1 + MinecraftForge/FML@adc89722770b7319884619cadc6f10cc9050df24 Add cascadedTweaks. This will allow simple coexistence for any other mod framework using the tweaker system as well. Hi Voxel and LiteLoader! + +Build 1.6.1-8.9.0.774: + xcompwiz: + Makes player-specific spawnpoints dimension aware + + Makes ServerConfigurationManager correctly get player-specific spawn + point for the target dimension + Changes EntityPlayer to store and save a (bed) spawn point for every + dimension, as well as transfer them to respawn "clones" + +Build 1.6.1-8.9.0.773: + LexManos: Re-gather list of Icons when atlas textures are stitched, allows for addition/removal of blocks/items after the atlas's inital constrction. + +Build 1.6.1-8.9.0.772: + LexManos: Fix enchantment effect on single pass items. Closes #644 + +Build 1.6.1-8.9.0.771: + kinglemming: + Forge Fluid System! + + Signed-off-by: King Lemming + LexManos: Mark old liquid system as deperated to be removed next Minecraft release. + +Build 1.6.1-8.9.0.770-newliquid: + LexManos: Mark old liquid system as deperated to be removed next Minecraft release. + +Build 1.6.1-8.9.0.769-newliquid: + richard: Techne model loader (incomplete for debugging) + richard: Complete it, got the bug figured out + Christian: + Updated FML: + MinecraftForge/FML@24c405665105a789a0708a7e30c8bcb96899da6b Add in an optional modid identifier for @SidedProxy. It's main use is when both scala and java @Mods reside in the same package, and you want the @SidedProxy behaviour for a specific @Mod language type. In general it should not be needed otherwise. + MinecraftForge/FML@cd0466395a8f1af3ec44f124bf4088df2d318603 Fix sysout with trailing messages after a newline + LexManos: Disable ImageIO's File based cache, should speed up texturepack loading/stitching. + jadran.kotnik: Added rotation support for all vanilla blocks that can be rotated. + LexManos: + Add NPE protection to ItemStack delegates. Closes #601 + Also cleaned up the names of said delegates, we do not have to follow MCP's crowdsourced names as they are very bad. + Redirected damage through setItemDamage to allow items to have finder control of breaking. + LexManos: Fix Air block check in BlockPortal. + LexManos: Fix hoes being able to till dirt under other blocks, and made it look for air type blocks. + LexManos: Add NPE protection to refernce to MinecraftServer.worldServer + LexManos: Fix AIOOB exception in crash reporting if exception does not have a stack. Possible, but odd. + LexManos: Fixed changelog generation. + LexManos: Forgot most important side, release script. + Christian: Make glass panes and iron fences connect to block sides based on solidity. This does change IBlockAccess, so anything with a custom IBlockAccess may need to implement the new method. + Christian: + Fix server patch FML update + + Updated FML: + MinecraftForge/FML@22738de028a9ba51d43d73857dfb8969985566f0 Attempt to properly fix deadlock if the internal server derps. It should never hang now. Damn you fast computer.. + MinecraftForge/FML@05a854cd2af53ca822ee8b249b0b3bbe44f94675 Small tweaks to the mcp data. Nothing major.. + mitchel.pyl: Fix tripwire patches for solid sides + LexManos: Added EntityLiving to Block.isLadder arguments, deperacating older version. New parameter has the possibility of being null, so modders must take care. Closes #608 + LexManos: Add air checks to BlockSand falling and Piston pushing. Please report any other issues with custom 'Air' blocks in issue #602 + LexManos: Bump Forge revision and mark recomended. + LexManos: Fic Chest content gneeration delegate call. Cloases #609 + LexManos: Add air check to Flint and Steel Ref: #602 + LexManos: Update workspace for new library structure. + LexManos: Update FML to 16launch branch + LexManos: Initial patch update to 1.6, Does not compile, need to update references to the old TexturePack system. + LexManos: Small fixup, need to Update GuiIngameForge for new HUD changes. + LexManos: + Updated FML: + MinecraftForge/FML@6a318ddb784ca8b2bef0f6718089f7beb4d404e0 Fix typo in new packages. + MinecraftForge/FML@3711da9c456d20865a965734cc5aeaf7f5cb5e5d Another typo + MinecraftForge/FML@e35e4b16ff3d6dea547c41f02f2ca31ebe1f74aa More fixups + MinecraftForge/FML@18371bd8c9bd107f774289da35519f593ccc8ee7 Some fixes for updated mcp code + MinecraftForge/FML@ef646d3146e1f285d2cb8e79a74373beffa84774 Merge branch '16launch' + MinecraftForge/FML@7406b38d8ad1bc5c2c641c74f1614b946f246588 1.6.1 + MinecraftForge/FML@12c928c538c1c04d3a21255c747d15468328ace9 Tweak commands patch + MinecraftForge/FML@3f15cd54c2d776ea161aaedbecad9e188d66578f Functional client @ 1.6.1 + MinecraftForge/FML@71a92de5d95fccc4fe17cc39d0836891c6622f4d Client launch for eclipse + LexManos: + Updated FML: + MinecraftForge/FML@8960f6869fbe30d358a40997c47999025c3eae68 Add windows lzma executable http://tukaani.org/xz/ He states that most things are under public domai + n, But I couldn't find an exact reference to this executable. I'm going to assume it under public domain and distribuiting it here is fine. If not someone pleas + e direct me to the apropriate license and I will act accordingly. + MinecraftForge/FML@70cfe24e67adf6872ef1501599e2115e420c2539 Fix wrong project name in distro eclipse launch. + MinecraftForge/FML@7a004087f79b94bc92f29d50eb71288b6c1c968c Add deobf data to src dist. Dont create deobf jar as we ship the lzma Added *.lzma to .gitignore + LexManos: + Updated FML: + MinecraftForge/FML@110cf372eb5aa85df20b248976f1acdefa85e102 Add deobf data to merge-common, workspace is now actually runnable! + LexManos: Support dirty submodules in changelog script. + LexManos: 1.6.1 Update + LexManos: Add new launch configs to dev workspace. + LexManos: Update GuiIngameForge to reflect Mojang changes in 1.6.1 + LexManos: + Updated FML: + MinecraftForge/FML@c418da353f6a8420b095fa737e8b0eae270d31ae Cleanup coremod code, server side working now. + LexManos: Update release script to generate binary patches and include deobf data. + LexManos: Deprecation sweep and update version to 8.9 to reflect 1.6.1 update. + LexManos: MinecraftForge/FML@7fecf2ad6bdd918149a3c43453f6a78bd11e5404 Update mcp URL. + LexManos: Try absolute path, to not confuse jenkins. + LexManos: + Updated FML: + MinecraftForge/FML@1229c4c4ea888f4f69272eed94ef5a53ce79ccda Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. + MinecraftForge/FML@902772ed0cb6c22c4cd7ad9b0ec7a02961b5e016 Revert common folder fix, Common folder does nothing, feel free to delete it after first load. + LexManos: Update src distro installer script. Source distro works now! + LexManos: Update ToolMaterial enum helper. + LexManos: Release will now build a installer jar and use the standard 'target' output folder. + LexManos: + Updated FML: + MinecraftForge/FML@29d6c875d0675ffa14428c511bd6ebe9232a486c Add FML Installer logo crated by @ZaverSLO https://twitter.com/ZaverSLO/status/349947190300508162 + MinecraftForge/FML@3d17434510e890574b68c8a181b80c830b5d043a Build installer package for the new client launcher. + MinecraftForge/FML@bf38d947569911dab03319a8b0f1964f36b195b2 Update json samples + MinecraftForge/FML@7037184a4e724300001dfc1f8df2e76a0ec30368 Fix up release JSON + MinecraftForge/FML@dc7d02ebf6c9fc5965344a9aeca79f230a40afb4 Fix json syntax error. + LexManos: + Fix installer unintended replace. + + Updated FML: + MinecraftForge/FML@9b6525e80504ff72a1798cf5797bf148295db776 Point scala downloads to our servers, Launcher doesn't like standard maven repos. + LexManos: + Updated FML: + MinecraftForge/FML@91ecf711092e1610dd10e77cdd517c3324e62d8d Fix -rel json + MinecraftForge/FML@efc369ee83a7b62f605c13e16efad66b63b4bd8c Fix EventHandler annotation. + MinecraftForge/FML@fbd57b32641b540d609314d91fd64350d50b9013 Mods are now loaded as resource packs. Vanilla will scan for valid prefixes based on subdirs of 'ass + ets' which can then be referenced as ResourceLocations with the ":path" notation. + LexManos: + Updated FML: + MinecraftForge/FML@5a97d183dfb13b0f831172a1afef7407347ea7bc Remember to update your patches!!!! + MinecraftForge/FML@f1b533ad87ea08d6e62259c59779bcec1636e2fe Keep these on our servers until the launcher is actually fixed -.- + LexManos: Fix bound texture in Controls screen, Closes #631 and #629 + LexManos: Make Block.setIconName public + LexManos: Update filler block to prevent useless console warning. + LexManos: Fix resource domain when loading icon. Textures should be located in /assets/{domain}/textures/{block|item}/{name}.png Same strcutre as before except 'assets' instead of 'mods'. + LexManos: Update ChestGenHooks for new Dungeon chest strcture. + Christian: + Start: f1b533ad87ea08d6e62259c59779bcec1636e2fe + End: f21cd286ca8e974b75536224a38cc0dacaca8454 + Updated FML: + MinecraftForge/FML@f21cd286ca8e974b75536224a38cc0dacaca8454 Resource packs, part two. FML mods are now resource packs. Vanilla will scan anything under 'assets' and turn it into a resource prefix. Use resourcelocations to look stuff up. + LexManos: Move resource location resolution down to TextureAtlasSprite and allow for sprites that are not stitched. + LexManos: Attempt to gather lastBuild information to fix ChangeLog's off-by-one issue. + LexManos: + Updated FML: + MinecraftForge/FML@6f0eedc9a64e4e246c40335e91b4868ad7f5a9e2 Fixed ClassCastException when loading ModLoader mods + MinecraftForge/FML@8844554da6d5d15756d7b0a9da2f5924006b3190 Merge pull request #243 from jrtc27/modclassloader + MinecraftForge/FML@7aa7221756d62ea1fbc750d7cf7acfdb28d75f2e Fix transformer search + MinecraftForge/FML@5f7df5e742cbc21565cee0d25709b5cb5462127c Revert "Keep these on our servers until the launcher is actually fixed -.-" + MinecraftForge/FML@ad79b9ed86eaf8c2702d79505d78a931c1774560 Fix up some deprecation warnings, and clean up coremod code that's going away. + MinecraftForge/FML@ba3707af22376f8f18103f63db56e4614a9c37db More javadoc cleanup + LexManos: Update dev worksapce: Proper natives location and new server launch profile. + LexManos: TEMPORARY fix for MCP mapping issue. + LexManos: Include MANIFEST file from FML's universal.jar, makes the jar runnable now! + LexManos: + Updated FML: + MinecraftForge/FML@155e8468180c93f1886a64028628764b1b22dd58 Add in support for mods/ as a mod location. Also drop coremods as a location. They go in mods too now. + MinecraftForge/FML@3f4bf61ae6757605b27078c7321de9f640876836 Update key + MinecraftForge/FML@4545beb49d5348d8632e42965627b9837115525b Add deobf-data to setup env. + MinecraftForge/FML@e24f94951741709329208f738000b72933302a24 Fix eclipse workspaces and launch configurations. + MinecraftForge/FML@532bee7ce1c4392ee11f0389d98f0c2be6240aa0 Update to new MCP bugfix version, Fixes: Missing Armor/Item rendering, and Boss health mapping issues. + LexManos: + Updated FML: + MinecraftForge/FML@7ce84491d1d4eada442944e02fc0e50c51f8045c Fix missing argument and startclient/startserver support. + LexManos: Fix domain issue with SoundPool entries. + LexManos: Add hook for EntityWither trying to destroy a block. + LexManos: Fix lether item rendering colors. + LexManos: Render pass sensitive version of Item.hasEffect, Closes #517 + LexManos: Fix compile errors temporarily, dont use till updated to new system. + LexManos: Add missing air checks to WorldGenTrees and ChunkCache Closes #593 + LexManos: Updated FML: MinecraftForge/FML@54e06e841d1c8df24fc30e1ec3a51def67f58858 Move Resource refreshing until affter postInit. + +Build 1.6.1-8.9.0.768: + LexManos: Add missing air checks to WorldGenTrees and ChunkCache Closes #593 + LexManos: Updated FML: MinecraftForge/FML@54e06e841d1c8df24fc30e1ec3a51def67f58858 Move Resource refreshing until affter postInit. + +Build 1.6.1-8.9.0.767: + richard: Techne model loader (incomplete for debugging) + richard: Complete it, got the bug figured out + LexManos: Fix compile errors temporarily, dont use till updated to new system. + +Build 1.6.1-8.9.0.766: + LexManos: Add hook for EntityWither trying to destroy a block. + LexManos: Fix lether item rendering colors. + LexManos: Render pass sensitive version of Item.hasEffect, Closes #517 + +Build 1.6.1-8.9.0.765: + jadran.kotnik: Added rotation support for all vanilla blocks that can be rotated. + +Build 1.6.1-8.9.0.764: + LexManos: + Updated FML: + MinecraftForge/FML@7ce84491d1d4eada442944e02fc0e50c51f8045c Fix missing argument and startclient/startserver support. + LexManos: Fix domain issue with SoundPool entries. + +Build 1.6.1-8.9.0.763: + LexManos: + Updated FML: + MinecraftForge/FML@155e8468180c93f1886a64028628764b1b22dd58 Add in support for mods/ as a mod location. Also drop coremods as a location. They go in mods too now. + MinecraftForge/FML@3f4bf61ae6757605b27078c7321de9f640876836 Update key + MinecraftForge/FML@4545beb49d5348d8632e42965627b9837115525b Add deobf-data to setup env. + MinecraftForge/FML@e24f94951741709329208f738000b72933302a24 Fix eclipse workspaces and launch configurations. + MinecraftForge/FML@532bee7ce1c4392ee11f0389d98f0c2be6240aa0 Update to new MCP bugfix version, Fixes: Missing Armor/Item rendering, and Boss health mapping issues. + +Build 1.6.1-8.9.0.762: + LexManos: Update dev worksapce: Proper natives location and new server launch profile. + LexManos: TEMPORARY fix for MCP mapping issue. + LexManos: Include MANIFEST file from FML's universal.jar, makes the jar runnable now! + +Build 1.6.1-8.9.0.761: + LexManos: + Updated FML: + MinecraftForge/FML@6f0eedc9a64e4e246c40335e91b4868ad7f5a9e2 Fixed ClassCastException when loading ModLoader mods + MinecraftForge/FML@8844554da6d5d15756d7b0a9da2f5924006b3190 Merge pull request #243 from jrtc27/modclassloader + MinecraftForge/FML@7aa7221756d62ea1fbc750d7cf7acfdb28d75f2e Fix transformer search + MinecraftForge/FML@5f7df5e742cbc21565cee0d25709b5cb5462127c Revert "Keep these on our servers until the launcher is actually fixed -.-" + MinecraftForge/FML@ad79b9ed86eaf8c2702d79505d78a931c1774560 Fix up some deprecation warnings, and clean up coremod code that's going away. + MinecraftForge/FML@ba3707af22376f8f18103f63db56e4614a9c37db More javadoc cleanup + +Build 1.6.1-8.9.0.760: + LexManos: Attempt to gather lastBuild information to fix ChangeLog's off-by-one issue. + +Build 1.6.1-8.9.0.759: + LexManos: Move resource location resolution down to TextureAtlasSprite and allow for sprites that are not stitched. + +Build 1.6.1-8.9.0.758: + Christian: + Start: f1b533ad87ea08d6e62259c59779bcec1636e2fe + End: f21cd286ca8e974b75536224a38cc0dacaca8454 + Updated FML: + MinecraftForge/FML@f21cd286ca8e974b75536224a38cc0dacaca8454 Resource packs, part two. FML mods are now resource packs. Vanilla will scan anything under 'assets' and turn it into a resource prefix. Use resourcelocations to look stuff up. + +Build 1.6.1-8.9.0.757: + LexManos: Update ChestGenHooks for new Dungeon chest strcture. + +Build 1.6.1-8.9.0.756: + LexManos: Make Block.setIconName public + LexManos: Update filler block to prevent useless console warning. + LexManos: Fix resource domain when loading icon. Textures should be located in /assets/{domain}/textures/{block|item}/{name}.png Same strcutre as before except 'assets' instead of 'mods'. + +Build 1.6.1-8.9.0.755: + LexManos: Update ToolMaterial enum helper. + LexManos: Release will now build a installer jar and use the standard 'target' output folder. + LexManos: + Updated FML: + MinecraftForge/FML@29d6c875d0675ffa14428c511bd6ebe9232a486c Add FML Installer logo crated by @ZaverSLO https://twitter.com/ZaverSLO/status/349947190300508162 + MinecraftForge/FML@3d17434510e890574b68c8a181b80c830b5d043a Build installer package for the new client launcher. + MinecraftForge/FML@bf38d947569911dab03319a8b0f1964f36b195b2 Update json samples + MinecraftForge/FML@7037184a4e724300001dfc1f8df2e76a0ec30368 Fix up release JSON + MinecraftForge/FML@dc7d02ebf6c9fc5965344a9aeca79f230a40afb4 Fix json syntax error. + LexManos: + Fix installer unintended replace. + + Updated FML: + MinecraftForge/FML@9b6525e80504ff72a1798cf5797bf148295db776 Point scala downloads to our servers, Launcher doesn't like standard maven repos. + LexManos: + Updated FML: + MinecraftForge/FML@91ecf711092e1610dd10e77cdd517c3324e62d8d Fix -rel json + MinecraftForge/FML@efc369ee83a7b62f605c13e16efad66b63b4bd8c Fix EventHandler annotation. + MinecraftForge/FML@fbd57b32641b540d609314d91fd64350d50b9013 Mods are now loaded as resource packs. Vanilla will scan for valid prefixes based on subdirs of 'ass + ets' which can then be referenced as ResourceLocations with the ":path" notation. + LexManos: + Updated FML: + MinecraftForge/FML@5a97d183dfb13b0f831172a1afef7407347ea7bc Remember to update your patches!!!! + MinecraftForge/FML@f1b533ad87ea08d6e62259c59779bcec1636e2fe Keep these on our servers until the launcher is actually fixed -.- + LexManos: Fix bound texture in Controls screen, Closes #631 and #629 + +Build 1.6.1-8.9.0.751: + LexManos: + Updated FML: + MinecraftForge/FML@1229c4c4ea888f4f69272eed94ef5a53ce79ccda Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. + MinecraftForge/FML@902772ed0cb6c22c4cd7ad9b0ec7a02961b5e016 Revert common folder fix, Common folder does nothing, feel free to delete it after first load. + LexManos: Update src distro installer script. Source distro works now! + +Build 1.6.1-8.9.0.750-1.6: + LexManos: + Updated FML: + MinecraftForge/FML@1229c4c4ea888f4f69272eed94ef5a53ce79ccda Fix src distrabution, and got rid of pesky common folder in eclipse workspace. src is now installable. + MinecraftForge/FML@902772ed0cb6c22c4cd7ad9b0ec7a02961b5e016 Revert common folder fix, Common folder does nothing, feel free to delete it after first load. + LexManos: Update src distro installer script. Source distro works now! + +Build 1.6.1-8.9.0.749: + LexManos: Update workspace for new library structure. + LexManos: Update FML to 16launch branch + LexManos: Initial patch update to 1.6, Does not compile, need to update references to the old TexturePack system. + LexManos: Small fixup, need to Update GuiIngameForge for new HUD changes. + LexManos: + Updated FML: + MinecraftForge/FML@6a318ddb784ca8b2bef0f6718089f7beb4d404e0 Fix typo in new packages. + MinecraftForge/FML@3711da9c456d20865a965734cc5aeaf7f5cb5e5d Another typo + MinecraftForge/FML@e35e4b16ff3d6dea547c41f02f2ca31ebe1f74aa More fixups + MinecraftForge/FML@18371bd8c9bd107f774289da35519f593ccc8ee7 Some fixes for updated mcp code + MinecraftForge/FML@ef646d3146e1f285d2cb8e79a74373beffa84774 Merge branch '16launch' + MinecraftForge/FML@7406b38d8ad1bc5c2c641c74f1614b946f246588 1.6.1 + MinecraftForge/FML@12c928c538c1c04d3a21255c747d15468328ace9 Tweak commands patch + MinecraftForge/FML@3f15cd54c2d776ea161aaedbecad9e188d66578f Functional client @ 1.6.1 + MinecraftForge/FML@71a92de5d95fccc4fe17cc39d0836891c6622f4d Client launch for eclipse + LexManos: + Updated FML: + MinecraftForge/FML@8960f6869fbe30d358a40997c47999025c3eae68 Add windows lzma executable http://tukaani.org/xz/ He states that most things are under public domai + n, But I couldn't find an exact reference to this executable. I'm going to assume it under public domain and distribuiting it here is fine. If not someone pleas + e direct me to the apropriate license and I will act accordingly. + MinecraftForge/FML@70cfe24e67adf6872ef1501599e2115e420c2539 Fix wrong project name in distro eclipse launch. + MinecraftForge/FML@7a004087f79b94bc92f29d50eb71288b6c1c968c Add deobf data to src dist. Dont create deobf jar as we ship the lzma Added *.lzma to .gitignore + LexManos: + Updated FML: + MinecraftForge/FML@110cf372eb5aa85df20b248976f1acdefa85e102 Add deobf data to merge-common, workspace is now actually runnable! + LexManos: Support dirty submodules in changelog script. + LexManos: 1.6.1 Update + LexManos: Add new launch configs to dev workspace. + LexManos: Update GuiIngameForge to reflect Mojang changes in 1.6.1 + LexManos: + Updated FML: + MinecraftForge/FML@c418da353f6a8420b095fa737e8b0eae270d31ae Cleanup coremod code, server side working now. + LexManos: Update release script to generate binary patches and include deobf data. + LexManos: Deprecation sweep and update version to 8.9 to reflect 1.6.1 update. + LexManos: MinecraftForge/FML@7fecf2ad6bdd918149a3c43453f6a78bd11e5404 Update mcp URL. + LexManos: Try absolute path, to not confuse jenkins. + +Build 1.6.1-8.9.0.748-1.6: + LexManos: Try absolute path, to not confuse jenkins. + +Build 1.5.2-7.8.1.738: + LexManos: Fic Chest content gneeration delegate call. Cloases #609 + LexManos: Add air check to Flint and Steel Ref: #602 + +Build 1.5.2-7.8.1.737: + LexManos: Bump Forge revision and mark recomended. + +Build 1.5.2-7.8.0.736: + LexManos: Added EntityLiving to Block.isLadder arguments, deperacating older version. New parameter has the possibility of being null, so modders must take care. Closes #608 + LexManos: Add air checks to BlockSand falling and Piston pushing. Please report any other issues with custom 'Air' blocks in issue #602 + +Build 1.5.2-7.8.0.735: + mitchel.pyl: Fix tripwire patches for solid sides + +Build 1.5.2-7.8.0.734: + Christian: + Fix server patch FML update + + Updated FML: + MinecraftForge/FML@22738de028a9ba51d43d73857dfb8969985566f0 Attempt to properly fix deadlock if the internal server derps. It should never hang now. Damn you fast computer.. + MinecraftForge/FML@05a854cd2af53ca822ee8b249b0b3bbe44f94675 Small tweaks to the mcp data. Nothing major.. + +Build 1.5.2-7.8.0.733: + Christian: Make glass panes and iron fences connect to block sides based on solidity. This does change IBlockAccess, so anything with a custom IBlockAccess may need to implement the new method. + +Build 1.5.2-7.8.0.732: + LexManos: Forgot most important side, release script. + +Build 1.5.2-7.8.0.731: + LexManos: Fixed changelog generation. + +Build 1.5.2-7.8.0.730: + LexManos: Fix AIOOB exception in crash reporting if exception does not have a stack. Possible, but odd. + +Build 1.5.2-7.8.0.729: + LexManos: Fix hoes being able to till dirt under other blocks, and made it look for air type blocks. + LexManos: Add NPE protection to refernce to MinecraftServer.worldServer + +Build 1.5.2-7.8.0.728: + LexManos: Fix Air block check in BlockPortal. + +Build 1.5.2-7.8.0.727: + LexManos: + Add NPE protection to ItemStack delegates. Closes #601 + Also cleaned up the names of said delegates, we do not have to follow MCP's crowdsourced names as they are very bad. + Redirected damage through setItemDamage to allow items to have finder control of breaking. + +Build 1.5.2-7.8.0.726: + LexManos: Disable ImageIO's File based cache, should speed up texturepack loading/stitching. + +Build 1.5.2-7.8.0.725: + Christian: + Updated FML: + MinecraftForge/FML@24c405665105a789a0708a7e30c8bcb96899da6b Add in an optional modid identifier for @SidedProxy. It's main use is when both scala and java @Mods reside in the same package, and you want the @SidedProxy behaviour for a specific @Mod language type. In general it should not be needed otherwise. + MinecraftForge/FML@cd0466395a8f1af3ec44f124bf4088df2d318603 Fix sysout with trailing messages after a newline + +Build 1.5.2-7.8.0.724-newliquid: + jeffreykog: RenderGameOverlayEvent.Post(ALL) is now called in GuiIngameForge + LexManos: Fix arbitrary GUIContainer text coloring by forcing lighting to be disabled. Closes #594 + Christian: Patch village distance checking to use floats instead of ints, to avoid int wrapping + Christian: Fix isAir check to see if a portal can light. Should fix w/Railcraft and others + LexManos: Make changelog generation non-fatal untill we get jenkins issue figured out. + LexManos: Add cache for ASM Event Handler bridge classes, should not need to redefine a class to invoke the same method on different instances. + LexManos: Ignore registration of a object that is already registered. Preventing duplicate callback invocations. Thanks King_Lemming for pointing this out. + Christian: + Updated FML: + MinecraftForge/FML@6f3da9736531153629fb4213e3b2cae776bfb50a Don't throw an exception if the scala adapter find a java proxy. I may add some distinguishers to @SidedProxy so you know which mod it's for. + MinecraftForge/FML@59fe905695421a5be9370b0009ef794abaaf75bb Don't continue trying to send events to mods that depend on errored mods. + +Build 1.5.2-7.8.0.723: + Christian: + Updated FML: + MinecraftForge/FML@6f3da9736531153629fb4213e3b2cae776bfb50a Don't throw an exception if the scala adapter find a java proxy. I may add some distinguishers to @SidedProxy so you know which mod it's for. + MinecraftForge/FML@59fe905695421a5be9370b0009ef794abaaf75bb Don't continue trying to send events to mods that depend on errored mods. + +Build 1.5.2-7.8.0.722: + jeffreykog: RenderGameOverlayEvent.Post(ALL) is now called in GuiIngameForge + +Build 1.5.2-7.8.0.721: + LexManos: Ignore registration of a object that is already registered. Preventing duplicate callback invocations. Thanks King_Lemming for pointing this out. + +Build 1.5.2-7.8.0.720: + LexManos: Add cache for ASM Event Handler bridge classes, should not need to redefine a class to invoke the same method on different instances. + +Build 1.5.2-7.8.0.719: + Christian: Fix isAir check to see if a portal can light. Should fix w/Railcraft and others + LexManos: Make changelog generation non-fatal untill we get jenkins issue figured out. + +Build 1.5.2-7.8.0.716: + Christian: Patch village distance checking to use floats instead of ints, to avoid int wrapping + +Build 1.5.2-7.8.0.715: + LexManos: Fix arbitrary GUIContainer text coloring by forcing lighting to be disabled. Closes #594 + +Build 1.5.2-7.8.0.713: + Christian: + Updated FML: + MinecraftForge/FML@843a13c1ab1e3901160082fa63c557243fb64675 Try and clean up cycle detection output a bit + MinecraftForge/FML@82e9de8641c6a559eec711ea6d1e940d99cbc98f More tweaks to the mod sorting code + MinecraftForge/FML@ac97370f94d10beee5f021795cddda827c4411d4 Add in a pretty sorting error screen + MinecraftForge/FML@f1d68ed4c82cd28e50ec6a0befc55ff0165bfe08 Throw the sorting exception + MinecraftForge/FML@edc1fb24e2cad9badd2dd18ccccd590d77156e18 Send the "suspect list", and print the suspect versions + +Build 1.5.2-7.8.0.711: + jdroque: + Add support for servers to register dimensions on client. + + In order to support multi-worlds such as MultiVerse, the server needs the + ability to register dimensions on client or many forge mods such as IC2 + will not function correctly. This has been an issue for MCPC which + provides both Forge and Bukkit support to players. By adding the + DimensionRegisterPacket class, MCPC now has the ability to send the + required packet to client to register a dimension with DimensionManager. + LexManos: Cleanup Dimension Registration packet, generate takes no arguments, and added fix to world to prevent providers from overwriting the dimension ID. + LexManos: Fix potential GL issue when atlas animations bind textures without informating RenderEngine. + +Build 1.5.2-7.8.0.710: + LexManos: + Introduced the framework for Forge's packet handler system. Heavily based off FMLPacket. + Packet splitting and reconstruction is handled. + +Build 1.5.2-7.8.0.708: + Christian: + Updated FML: + MinecraftForge/FML@3bf50c4bbe82f0cc317dafcf2a569cb5210bc738 Fix server side derp with Forge network packet handler + +Build 1.5.2-7.8.0.707: + LexManos: Fix type in biome list. + LexManos: Fixed creative tab rendering with invalid color closes #588 + +Build 1.5.2-7.8.0.706: + Christian: + Add forge network handling support + + Updated FML: + MinecraftForge/FML@4922e90d81d8b8b9374c4d04858a06c5bf03965c Separate network mod config from setup. Allows for Forge Packet Handler nicety + +Build 1.5.2-7.8.0.705: + mehvids: Add hitInfo field to MovingObjectPosition for when an int doesn't suffice + +Build 1.5.2-7.8.0.704: + LexManos: Fix another NPE when Items are in Block range with custom renderers, Modders keep your items out of the block range! Closes #581 + LexManos: Fixed render count for stacks of blocks 40+ and distrabution of items based on scale. Closes #579 + +Build 1.5.2-7.8.0.703: + Christian: Remember x & z passed to getTopSolidOrLiquidBlock and use it for foliage tests. Fixes #575 + +Build 1.5.2-7.8.0.702: + Christian: Fix blending on the hotbar. Closes #574 + +Build 1.5.2-7.8.0.701: + Christian: + Updated FML: + MinecraftForge/FML@23b070c7d02a8da44bf04c2f9ba2b485a44ad967 Alternative @SidedProxy setter for Scala. + MinecraftForge/FML@2cca7aa759b4b6c3a128ce43bbd924e4762c43c2 Some more Scala @SidedProxy adjustments. Now properly supporting pure singletons, i.e. object C { @SidedProxy(...) var proxy: P = null } Removed fallback, as all such singletons are properly handled by the new code now, and class implementations fall back to the code also used for plain Java mods. + MinecraftForge/FML@8517a824e5251c409e05999d42fc6d70497609f5 Merge declaration and initialization of a variable. + MinecraftForge/FML@a3a920437f3ede6841ae2c449a38975b02b28088 Merge pull request #230 from fnuecke/master + Christian: Add in a very simple stencil bit registry to try and arbitrate between mods wanting to use stencil bits in rendering + +Build 1.5.2-7.8.0.700: + hbiede: + Added oreQuartz + + Gives a default quartz Ore Dictionary (I know of at least 3 used by different mods that use Nether Quartz as an equivalent). + gholdampf: updated FurnaceRecipes.java.patch + mike.stengel: Created an ItemStack sensitive version of canHarvestBlock. + +Build 1.5.2-7.8.0.699: + CovertJaguar: + Possible NPE if the liquid isn't in the LD + + https://github.com/BuildCraft/BuildCraft/issues/787 + +Build 1.5.2-7.8.0.698: + LexManos: Fix NPE when rendering EntityItems that are not blocks but int he block range. + +Build 1.5.2-7.8.0.697: + LexManos: Prevent water from dropping snowballs. + +Build 1.5.2-7.8.0.696: + LexManos: Fire EntityJoinWorled event for forced entities {Players and there mounts} as well, just ignore the cancelled value. + +Build 1.5.2-7.8.0.695: + LexManos: + MinecraftForge/FML@787c0c4a6af3af60928b3a90f383a305a17a4347 Don't spit error on LWJGL not supporting 4.3 just warning. + Make custom item renderers attempt to use EQUIPPED type when running first person. For backwards compatiblity, will be removed in 1.6. + And a small change to make the 1.6 check not print it's stack trace. + +Build 1.5.2-7.8.0.693: + purpleposeidon: Fix render bounding box of trapped double chests + jholcroft: + Make getStencilBits static + + Made getStencilBits static so it can be called. + +Build 1.5.2-7.8.0.692: + LexManos: Move Partical rendering down in the order, after everything else. Should fix particals rendering behind water, digging process, and selection. + +Build 1.5.2-7.8.0.691: + LexManos: Fixed NPE in rendering dragged items. + +Build 1.5.2-7.8.0.690: + LexManos: + Attempt to allocate a 8-bit stencil buffer when creating Minecraft's display context. If that throws an error it will revert back to it's default values. + Also contains a method for modders to rereive how many bits the context was created with. Closes #552 + +Build 1.5.2-7.8.0.689: + LexManos: EntityPlayer sensitive version of Item.isValidArmor, deprecated older version. Closes #551 + LexManos: Changed to just plane entity for flexability. + LexManos: New RenderPlayer and RenderLiving events. Closes #493 + +Build 1.5.2-7.8.0.688: + pahimar: Update forge_at.cfg + +Build 1.5.2-7.8.0.687: + mitchpetrie29: Separate EQUIPPED and EQUIPPED_FIRST_PERSON Item Render Types + +Build 1.5.2-7.8.0.686: + LexManos: Capture and fire the PlaySoundAtEntity event for The client entity. Minecraft does some odd bypasses for no good reason. Thanks iPixile for reporting this. + +Build 1.5.2-7.8.0.685: + LexManos: + Updated FML: + MinecraftForge/FML@99bb50d8f8d27217ba58a41c802a504213e99461 Improved Entity Spawn Error + MinecraftForge/FML@c0cca7f41d5b080e39dd8d3d6cfc329295c822e6 Merge pull request #227 from CovertJaguar/patch-1 + MinecraftForge/FML@49111e9c5cffab49ec35f965801c3f0496f6def6 Add version detection to astyle and print error if it doesnt detect version 2.0+ + Also fixed astyle's config for max-instatement-indent that sometimes caused crashes with certian versions of astyle. + +Build 1.5.2-7.8.0.684: + LexManos: + Update to 1.5.2 PR. + MinecraftForge/FML@f0bba74a4748935ef3a715ae2f45feb75cc20376 Update for minecraft 1.5.2 + MinecraftForge/FML@62fdbad74c2507d147ecab56f56029135d88c6f5 Update MCP's md5 for the fixed srg files. + LexManos: + Updated FML: + MinecraftForge/FML@00f00b17bf0da262e6fe3e327ca2deedf7146305 Fix scalac detection to actually use the located command instead of defaulting to 'scalac' + LexManos: Fixed hardcoding of MC version in debug text. + LexManos: Bump version number for 1.5.2 + +Build 1.5.2-7.8.0.683-1.5.2: + LexManos: Bump version number for 1.5.2 + +Build 1.5.1-7.7.2.682: + cadyyan: Fixed build error handling using invalid Python syntax. + +Build 1.5.2-7.7.1.681-1.5.2: + LexManos: Fixed hardcoding of MC version in debug text. + +Build 1.5.2-7.7.1.680-1.5.2: + LexManos: + Updated FML: + MinecraftForge/FML@00f00b17bf0da262e6fe3e327ca2deedf7146305 Fix scalac detection to actually use the located command instead of defaulting to 'scalac' + +Build 1.5.1-7.7.2.679: + LexManos: Changelog generator will now bundle failed builds with the next successful build. Should make it look better and prevent the version numbers from being confusing. + +Build 1.5.1-7.7.2.678: + LexManos: Bump version to 7.7.2 so I can make a release. + +Build 1.5.1-7.7.1.676: + tobias: Fixed ListenerListInst not being rebuild after unregistering a listener, causing calls to unregistered event listeners. + tobias: Replaced derpy tabs with spaces + +Build 1.5.1-7.7.1.675: + kinglemming: + -Add vanilla Ores to the Ore Dictionary. No recipe replacement required. + -Add NBT-sensitive getMaxDamage() for ItemStack. + + Signed-off-by: King Lemming + +Build 1.5.1-7.7.1.674: + LexManos: Attempted a fix for the changelog generation, should print all builds back to 1 now. + +Build 1.5.1-7.7.1.673: + Christian: + Updated FML: + MinecraftForge/FML@cf9b5b445ba284d389c7e32a03d9c8ef43469042 Don't leave scala running in interactive mode. + +Build 1.5.1-7.7.1.672: + Christian: + Updated FML: + MinecraftForge/FML@cfda7fc738ce6079f625a3822ebff5e7e0db5669 Fix URL for MCP + MinecraftForge/FML@781c68121626321e0efddaf4c4db9f1b8b5911db Some fixups for scala compilation in MCP. Scala should now be compilable and reobfuscatable with srgnames in MCP. + Christian: Try and be less noisy about world leaks + Christian: ItemStack delegation to Item for damage values. + LexManos: Fix rotation issue with non-block items. + Christian: + Updated FML: + MinecraftForge/FML@ddadf93ca1d648d88fdb61c9625cd675c3650ccd Fix when an old scalac is present on the system to not fail the build + Christian: + Updated FML: + MinecraftForge/FML@aa200923f0fe0c548faa4f103d803ade2e49d19d Fix patch derp. + +Build 1.5.1-7.7.1.667: + Christian: + Updated FML: + MinecraftForge/FML@dcf069ca52738a7bb7bde01f1c7ebd2e06cd0ac6 Attempt to reduce lines on the screen for id mismatch. Hopefully prevents game crashes. + MinecraftForge/FML@58ba24add2a96bf4c079d5919f2d90dcc2f380e4 Fix possible NPEs in GameData + +Build 1.5.1-7.7.1.666: + Christian: + Updated FML: + MinecraftForge/FML@a3b5eaacfdd9218ef68d3dc064bba729b797cb3d Fix a small modloader compatibility derp: closes #222 + MinecraftForge/FML@677a6e578e84109702365da4a784f9a57d8c9957 Fix scala supporting SidedProxy. It should work now. + MinecraftForge/FML@334a76de75f2b417f04c23526c7e66ceb48e0de2 Update FMLDeobfuscatingRemapper.java + MinecraftForge/FML@42f1d8795599e0d1a516a1fdd7488a09b77e4565 Merge pull request #224 from Glought/master + MinecraftForge/FML@2dcabe01232b48009acbca6724565598761f561b Add a to string to fmlmodcontainer: should mean less derpy cyclic dependency data + MinecraftForge/FML@11ac46daebe901a6012a09ba5f6fe44af5b1be06 Fixing the GameRegistry. Now it is possible to register a Block with a BlockItem using following code: MyBlock myBlock = new MyBlock(); GameRegistry.registerBlock(myBlock, MyBlockItem.class, "myBlock"); where MyBlockItem class has one constructor with signature: public MyBlockItem(int id, Block block) + MinecraftForge/FML@c3fda11d100f9db7c32ef212ac37eade3e35d701 Merge pull request #225 from MarcinSc/master + Christian: Add forge/FML data to the f3 screen. + +Build 1.5.1-7.7.1.665: + LexManos: + Forge now takes control of GuiIngame's renderGameOverlay, and spits out a ton of events to give modders control of how the screen is rendered. + Inital draft for community feedback. + +Build 1.5.1-7.7.1.664: + LexManos: Allow spawning of Bonemeal particles even if block is not set. + +Build 1.5.1-7.7.1.663: + LexManos: Fix the BLOCK_3D render helper for items that aren't an instance of ItemBlock Closes #533 + LexManos: Fix replaceable checks to work on blocks with a non-replacable material, Closes #532 + LexManos: Restore world unload event for client worlds Closes #531 + +Build 1.5.1-7.7.1.662: + LexManos: Fix logic issue in CrashReportCategory patch, blame Jadedcat for sloppy quick patch. + +Build 1.5.1-7.7.1.661: + lhb: + Fix for ClassCastException when attempting to fetch Biome types from BiomeDictionary + + Attempting to fetch the BiomeDictionary types linked to a biome throws a ClassCastException. This fixes that + lhb: getBiomesForType will cause the same problem + +Build 1.5.1-7.7.1.660: + Christian: + Updated FML: + MinecraftForge/FML@b3d4ea05ec633fb1898e97febf786f1a3e420986 Fix possible NPE in findItemStack, closes #218 + Christian: + Simple block recolouring API: closes #525 + Fix up documentation on "rotation" API: it is up to the mod to decide interpretation of "rotation" for the mod/block. + +Build 1.5.1-7.7.1.659: + LexManos: Fix return value of EnchantPower hook, closes #518 + LexManos: Adds a field to the player for maximum health. Player.dat additions are present, getMaxHealth() needs a magic number for spawning. Closes #527 + +Build 1.5.1-7.7.1.657: + LexManos: New hook to allow Items to render Helmet overlays like pumpkins do. + +Build 1.5.1-7.7.1.656: + Christian: + Updated FML: + MinecraftForge/FML@394f424185a044afcd6b31f400e731478171dd18 Fix to output versions in crash logs + MinecraftForge/FML@8f35adca7a41c280a4b63d4787f042f615966cac Use more expressive language when a version specifier is a simple unbounded above condition + +Build 1.5.1-7.7.1.655: + Christian: + Updated FML: + MinecraftForge/FML@5673c1dd2966536000c2b3f17f85131204c4a291 Add srgname to registerTileEntityWithAlternatives + MinecraftForge/FML@7aea09f4ca2f087d59ff6cb0de1c8e3e8b9ea4df Add type info to properly deobfuscate overloaded fields. Fixes #210. + MinecraftForge/FML@edffd04ed2e89ece75189f76b92ae47643ec92f8 Add in some caching of the read field descriptions for efficiency + MinecraftForge/FML@0daf1a6df4203d97be65a76a46550f6ad22ccc79 Merge branch 'agaricusb-fix-deobf-field' + MinecraftForge/FML@ada52078c75fdfa506a4287c112d01d9af961d5a Merge pull request #216 from agaricusb/add-srgname + +Build 1.5.1-7.7.1.654: + jmacwilliams: fixed a bug that prevented proper lava generation near bedrock + +Build 1.5.1-7.7.1.653: + LexManos: Fix AIOOB in crash report stack trimming. + +Build 1.5.1-7.7.1.652: + pahimar: Fix a derp in that we provision the various arrays for a face, even if we are not going to parse data into it. Solves NPEs for when obj models that don't have texture coordinates attempt to render. + pahimar: Missed a bit + +Build 1.5.1-7.7.1.651: + LexManos: Cave and Ravine gen will now take into account the Biomes top and foller block, allowing them to break the surface in modded biomes. Beaches, MushroomIslands and Deserts are exempt from this check to preserve vanilla world gen functionality. Closes #491 + +Build 1.5.1-7.7.1.650: + Christian: Fix offset in AdvancedModelLoader. *doh* + +Build 1.5.1-7.7.1.649: + LexManos: Added NBT data to liquid stacks. Closes #501 + LexManos: Added a small method in the Block.java to specify the amount of enchanting power it can supply to an enchanting table. Closes #508 + +Build 1.5.1-7.7.1.648: + LexManos: Item callback for EntityItem update tick. Closes #426 + LexManos: Add Item 'swing' callback for use when playing the arm swing animation. Closes #505 + +Build 1.5.1-7.7.1.647: + Christian: Delete sneaky extra file + +Build 1.5.1-7.7.1.645: + LexManos: Re-add and mark deprecated the old signature for ForgeHooksClient.getArmorTexture. + +Build 1.5.1-7.7.1.644: + Christian: + Deprecate preloadTexture, make it a no-op. Should stop derpiness with new + texturing system performance tweaks. + +Build 1.5.1-7.7.1.643: + LexManos: + Updated FML: MinecraftForge/FML@4836b3272a9b292c62816c1d1f9e845486753839 Re-worked the Texture patches, optifine helper function, and re-added support fo + r dynamically rotating the texture for mod authors who do things horribly wrong. + +Build 1.5.1-7.7.1.642: + Christian: + Fix performance of texture uploads + + Updated FML: + MinecraftForge/FML@00c788308881a07a683e17e2e9382313f3719b45 Very significant improvement in performance by using glSubImage to upload data. Inspired by frequent complaints about performance of hires texture packs. They probably still need a beefy system but should work. Hopefully I can figure out why the subImage GL side copy isn't working properly for an even more significant speed boost. But this gets things started. + MinecraftForge/FML@57ad221cc6d9605b9d521f86620c2a31f922ac24 And add the patches *sigh* + Christian: + Updated FML: + MinecraftForge/FML@a31607ae7d0214101679a1ecf1ae8032a5257eda Fix compilation derp, and clean up rotation helper. + +Build 1.5.1-7.7.1.640: + LexManos: Small optimization for usages of Minecraft.getGLMaximumTextureSize(), only need to calculate it once. + LexManos: Small bugfix in Stitcher that was preventing ti from fully filling the possible texture space. Should lower the amount of empty space in textures. + LexManos: + Optimize Texture loops a bit for non-rotated textures. Should help the FPS loss on higher resolution texture packs. If it becomes a major issue we may have to look into a more optimized animation system. + + https://mojang.atlassian.net/browse/MC-13206 + +Build 1.5.1-7.7.1.639: + LexManos: Fix scoreboard saving bug caused by our fix of vanilla map saves. + +Build 1.5.1-7.7.1.638: + LexManos: Updated FML: MinecraftForge/FML@1de89525cc2265bdce8704d9bd0d31c57bca4d97 Fixed issue with instalation when java/javac commands had quotes. + LexManos: Deprecate long dead interface that moved to FML. remvoe next MC version. + +Build 1.5.1-7.7.1.637: + LexManos: Updated FML: MinecraftForge/FML@704a70902fca3de620375116a33dccd3d6d576d0 Sanitize input to isRemappedClass to use '/' as a package seperator like the srg files. + +Build 1.5.1-7.7.1.636: + froggytheturtle: + This allows the result of the explosion to take into account metadata, + tile entities, or even to cancel it altogether. + + Allowed block exploding to take into account tile entity and metadata + LexManos: New hook to allow Items to provide there own armor models. Closes #487 + +Build 1.5.1-7.7.1.635: + LexManos: Fix item deletion in creative menu for items that are the same id/meta but differnet NBT's. Closes #479 + LexManos: Untag NBTTagList.removeTag as client side only, allowing simple removal ont he server side. Closes #477 + +Build 1.5.1-7.7.1.634: + LexManos: Allow items to provide there own FontRenderer for there tooltips. Added for #463 + +Build 1.5.1-7.7.1.633: + ProjectZulu: Added maxCanSpawnInChunk event to allow overriding of creature chunk spawn cap + ProjectZulu: Clarify Factory call and Event Functionality + LexManos: Add function to remove categories from a configuration, indavidual properties can be removed using ConfigCategory.remove() Closes #462 + +Build 1.5.1-7.7.1.632: + LexManos: + Pulled Biome Tag System by Emasher, Closes #433 + An issue with biome adding mods which is becoming increasingly annoying for players, is that many mod authors that add biome specific world generation or mobs in their mods, for the most part, hard code them to work with vanilla biomes only. This becomes a huge problem when it's difficult to even find a vanilla biome, let alone a specific one, when biome mods are installed. + + A simple solution to this problem is a tag system for biomes that allows mod authors to set up their world generators, or mobs to generate or spawn in biomes that have been registered with a specific tag such as "FOREST", or "FROZEN". I wrote such a system a few months ago, which I've been using with my own mods, and have made available to anyone who wants to use it. Since then, I've had requests from mod authors and players alike to try and get it, or at least similar functionality, into Forge, where other mod authors will be more comfortable using it. + + Aside from the tags, it also includes a rule based system to classify biomes that have not already been registered with it when information is requested on them (You can opt out of this by registering a biome as type "NULL"). And additionally, the ability to register IWorldGenerators for specific biomes, or biome types (tags) to speed up chunk generation a little bit. + +Build 1.5.1-7.7.1.631: + LexManos: Deprecate IArmorTextureProvider, moved to Item. And exposed more information to the function. Closes #365 + +Build 1.5.1-7.7.1.630: + LexManos: Updated FML: MinecraftForge/FML@570faeb790745c35403c67fabab57651b71da576 Added the ability to save transformed classes to disc for debugging. + LexManos: Add checking for 'ENUM$VALUES' in EnumHelper. Eclipse uses it's own internal compiler which does not follow the java standard of making the values field names $VALUES and private. Instead its public and ENUM$VALUES. Closes #502 + +Build 1.5.1-7.7.1.629: + LexManos: Revert MinecraftForge/MinecraftForge@f594109b30c87f5a0996eee9e8c4513380733cee If concurancy issues arise we will reassess. The provided solution caused entities to be removed incorrectly and cause 'invisible' entities client side. + +Build 1.5.1-7.7.1.628: + LexManos: Fix EntityPlayer passed to Bonemeal event. + +Build 1.5.1-7.7.1.627: + LexManos: Fix off-by-one in rotated textures. + LexManos: Removed index bounds checking in some chunk functions, if you error blame Grum. + +Build 1.5.1-7.7.1.625: + LexManos: Fix vanilla texture bug causing rotated textures to be placed wrong. + +Build 1.5.1-7.7.1.624: + Christian: + Updated FML: + MinecraftForge/FML@8b8837c9ff635d4988e0a1504fca38667825daf0 Fix NPE when branding isn't present + +Build 1.5.1-7.7.1.623: + kraphteu: Remove unneeded SideOnly. ref: Buildcraft/Buildcraft#710 + +Build 1.5.1-7.7.1.622: + Christian: + Removed obsolete patches + Updated FML: + MinecraftForge/FML@26ccb9106e443e664b0fdc1b95c3600b90ab2bc5 Change snooper/crash report brand handling. fmlbranding now loads another string! + MinecraftForge/FML@eff464cf0e656d92dfedf16e79e5cd6c36b9fc76 And the core patches for that + +Build 1.5.1-7.7.1.621: + Christian: Sanity check the item ID for loaded liquid stacks better. + +Build 1.5.1-7.7.1.620: + Christian: Make liquidstacks immutable in their type data. Sorry about this, but it makes things a lot easier. + Christian: Add in persistence code for LiquidTank. Using it should protect against liquids that get removed f.e. Closes #395 + +Build 1.5.1-7.7.1.618: + Christian: Fix up liquidstack so it knows about the texture sheet for it's icon + +Build 1.5.1-7.7.1.617: + Christian: Fix AT file + +Build 1.5.1-7.7.1.616: + Christian: Fix possible NPE in ChunkManager. Closes #478 in reality + +Build 1.5.1-7.7.1.615: + Christian: made BlockFluid.theIcon protected + Christian: fix bug #489 from #429 + Christian: Fix up some liquid logic + +Build 1.5.1-7.7.1.614: + Christian: + Updated FML: + MinecraftForge/FML@2bc6a0666f8a54f6b1fbc3398c6e3a385ecd35b5 Attempt to make any "default package" class public. This might fix problems with certain modloader mods that ship changes to vanilla classes. + Christian: Use the liquid name in liquid stack persistence. Closes #429 + Christian: Fix hashCode + Christian: + Updated FML: + MinecraftForge/FML@0d844874124649099dbcbb9ae2b36719e1dda25f Fix up derp in access transformer + +Build 1.5.1-7.7.1.611: + LexManos: Bump version number for 1.5.1 Note: We really need to do this more... + +Build 1.5.1-7.7.0.610: + LexManos: Fix NPEs when modders stupidly register null texture names. + +Build 1.5.1-7.7.0.609: + LexManos: Fixed issue with Event.hasAnnotation ignoring it's parameter. And cached its values for potential performance gain. Closes #482 + +Build 1.5.1-7.7.0.608: + jesse: + Entity Extended Properties Changes + + Adds IExtendedEntityProperties interface, which specifies three methods + that are needed: Init, Save, and Load. + + Adds the EntityConstructing event, which is called during the + constructor of Entity. It is needed there so that the reference is in + place during the ReadNBT call. + + Adds hooks into Entity that allow registration of + IExtendedEntityProperties classes, as well as saving and loading to NBT. + jesse: + Brewing Stand Changes + + Added an event on potion ingredient applied. Event contains the item + stacks of each of the potions being brewed as well as any remaining + ingredients. + + Changed TileEntityBrewingStand and SlotBrewingStandPotion to look for + instanceof ItemPotion rather than potion.itemID + jesse: + Player Flyable Fall Event + + Adds an event to EntityPlayer that is posted on player fall when the + player has flight capabilities. + Christian: Fix itemframe render bug + Christian: Add in block rotation support. It supports most vanilla blocks (hopefully), logs should be added soon. + jesse: + Access Transformer Changes + + AT changes and corresponding class changes. + Additions (all made public): + EntityLiving.targetTasks + PotionHelper.potionRequirements + PotionHelper.potionAmplifiers + PotionEffect.duration + Potion.setIconIndex + Item.setPotionEffect + Block.blockHardness + Block.blockResistance + jesse: + Enderman Teleport Event + + New event when an enderman teleports that allows the teleport location + to either be modified or completely cancelled. + jesse: + Enderman attackEntityFrom changed + + Changed so that if the teleport fails upon being attacked, Endermen will + take damage as normal. + jesse: + Ender Teleport Changes + + Renamed Ender Teleport Event and added it in to ender pearls. + jesse: + quick bugfix in entityenderman + + reversed boolean check on event result + Christian: + Updated FML: + MinecraftForge/FML@2d368c4c2eb6b4e0bb60757b6e1679c23aaad9db Itemstacks in the GameRegistry (manual registration by mods) + Christian: + Updated FML: + MinecraftForge/FML@5e1949eb0e3a43d3ec6c710289532d93f6819934 Clone the itemstack, and allow for passing in a stacksize + Christian: + Updated FML: + MinecraftForge/FML@ede93d438f2b5fab92cd6a459247ca158354e430 Validate supplied stack size + MinecraftForge/FML@d73ac867df775174dafdd2da193fabd7c3e7407e Add a mechanism to dump the registry- useful for mod developers. + Christian: + Updated FML: + MinecraftForge/FML@82bc9f1b35f5d51a722d294dd252e6bab4d54fa4 Add some information, and a log message letting you know it worked + Christian: Update patches! + Christian: Re-enable changelog? Hopefully... + Christian: Changelog fixup + Christian: Damn you python and your tab obsession! + +Build 1.5.1-7.7.0.605: + Christian: Fix AT config for texturemap + +Build 1.5.1-7.7.0.604: + Christian: + Allow itemstack sensitive damage computation for attacks. Should allow + storing data in the nbt :) + +Build 1.5.1-7.7.0.603: + Christian: + Updated FML: + MinecraftForge/FML@d9db27275ea06d37ae75e201140019ca152314b0 Fix mismatch screen a bit. Should render more correctly now and at least not be blank in a lot of circumstances.. + Christian: Allow items to decide if they can or cannot have book enchantments applied + +Build 1.5.1-7.7.0.602: + Christian: + Updated FML: + MinecraftForge/FML@d1ff1967b50f2ff2edf0b60acdb6508c0a3eeb06 Fixed FMLRelaunchLog's Newline Handling + MinecraftForge/FML@591a25722b36d2d1b200a31278cb8da117363f6b Merge pull request #208 from jrtc27/patch-1 + +Build 1.5.1-7.7.0.601: + Christian: + Updated FML: + MinecraftForge/FML@f709ce757984b13acb7208d6d8fbdeaa83d2928d Fix missing block world rendering + MinecraftForge/FML@748eece456e079a21112a77047d004d4f410b170 Merge pull request #206 from mDiyo/patch-1 + MinecraftForge/FML@012a755bb9ce9737c843b0dfd86473d143b637be Fix up patch properly. Also, fix md5s for the jars. + +Build 1.5.1-7.7.0.600: + LexManos: + Update to 1.5.1 Pre-Release: + MinecraftForge/FML@9565529baf77de27ed8b75be2065da3ba08d16c8 Updated to latest MCP and Minecraft 1.5.1 Pre-release. + MinecraftForge/FML@a573faf92def5dd01af380b3ca86de877c1178a2 Someone derped up this function bad, revert name. + LexManos: MinecraftForge/FML@aaf02ea2ac938d8cbaafdd2f59985c0604d648d7 Updated for new PR client jar. + +Build 1.5-7.7.0.598: + LexManos: + Updated FML: + MinecraftForge/FML@3c346247e1c5de12d4548f6a99349157057e2de6 Fix NPE with CoreMods who do not have the new MCVersion annotation. + LexManos: + Updated FML: + MinecraftForge/FML@625da6492dddcaca8133718aeee97f9981ced623 Fix install.py --mcp-dir option. Fixes #204. + MinecraftForge/FML@687d3c059d054c338c25a489be206a9f3dc63d81 Merge pull request #204 from agaricusb/fix-mcpdir + +Build 1.5.1-7.7.0.597-1.5.1: + LexManos: MinecraftForge/FML@aaf02ea2ac938d8cbaafdd2f59985c0604d648d7 Updated for new PR client jar. + +Build 1.5-7.7.0.595: + LexManos: Change placement of ChunkDataEvent.Save call to apply before sending to worker thread. + +Build 1.5-7.7.0.594: + Christian: + Updated FML: + MinecraftForge/FML@5cc90f060caace93c0bf041d3cc37208f425f623 Fix the logger to treat newlines better, hopefully. Closes #199 + MinecraftForge/FML@5e3af8ac0e18cfa3a92f9ba726ec1a6b55e87d97 Use the relaunch log, for class circularity safety. + MinecraftForge/FML@ce949e6099fe2a63ee6774acd6e55aa55d3b3673 Support simple mc version test in coremods, only effective through jar loading. Also, log some more data about the environment. + +Build 1.5-7.7.0.593: + LexManos: + New TextureStitchEvents called before and after a TextureMap gathers and stitches textures together. + Also added a config option to diable the writing of resulting stitched textures to disc. Default disables the writing. + +Build 1.5-7.7.0.592: + LexManos: + Updated FML: + MinecraftForge/FML@24022ab6ba79e4babb57fc0db893c23d4aec85bc Added comments to note FML-only methods + MinecraftForge/FML@8905237306230a33e2a3bab7a2b6f7a8b42d94e4 Merge pull request #200 from bspkrs/patch-2 + MinecraftForge/FML@577b19c1cf12a354112e829fb5704c32fd6cd0a5 Fix potential NPE in class loading and add extra debug information. + +Build 1.5-7.7.0.591: + LexManos: Fix placing of certian items on Redstone Blocks. + +Build 1.5-7.7.0.590: + LexManos: Fix equipment slots for items when right clicked, and dispensed using a dispensor. + +Build 1.5-7.7.0.589: + LexManos: Prevent pistons from generating snowballs. + LexManos: Fix logic inversion that allowed SnowMen to create snow on hoppers. + +Build 1.5-7.7.0.588: + lepko.san: Fix ShapedOreRecipe checking mirrored recipes + +Build 1.5-7.7.0.587: + Christian: Fix multipass item rendering so that it uses the right spritesheet for the item. + +Build 1.5-7.7.0.586: + froggytheturtle: + Made WorldServer.allPlayersSleeping public + + Made EntityPlayer.sleepTimer public + + Sleep changes + +Build 1.5-7.7.0.585: + LexManos: Fix Activator rails activating TNT carts, closes #458 + +Build 1.5-7.7.0.584: + github: Update ForgeDummyContainer.java + +Build 1.5-7.7.0.583: + Christian: + Updated FML: + MinecraftForge/FML@c5d5f4e5164111c5ae63e8de7ce97cc583d73e6e Fix AllPublic access transformer not affecting methods. Should fix modloader compatibility + +Build 1.5-7.7.0.582: + LexManos: + Updated FML: + MinecraftForge/FML@4762d4d8ef00bd789ffb6bccbd12f7478b07da62 Allocate more ram {typically 256 is defailt} to fermflower, should fix decomplication issues on OSX + MinecraftForge/FML@6370c242f0e1cb8ec80c7dccc1133cb0d0607bae OS X's python 2.6.1 has a bug in zipfile.extractall that makes it unzip directories as regular files. So switch to extract + +Build 1.5-7.7.0.581: + LexManos: Remove the block if TE errors. + +Build 1.5-7.7.0.580: + LexManos: Add config toggle to atempt to remove TileEntities and Entities that error during there update without fully crashing the server, use at your own risk. Closes #424 + +Build 1.5-7.7.0.579: + Christian: + Updated FML: + MinecraftForge/FML@8f2dbf7046f52d836993edb946d7d310b399bf9d Fix up stupid derp in IMC code: actually reset the IMC list after each delivery. Fixes a bunch of mods. Sorry everyone. + +Build 1.5-7.7.0.578: + ohai.iChun: + [Bugfix] One should not assume an item would use the item spritesheet. + + Item class has a func to return an int to use terrain.png or items.png. This makes forge take account of it. + +Build 1.5-7.7.0.577: + LexManos: Fix bug with rendering one too many passes for ItemEntities Closes #450 + LexManos: Fix RedstoneBlock power issues, Closes #452 + LexManos: Fix for nether quartz not generating in the nether, Closes #454 + +Build 1.5-7.7.0.576: + LexManos: Deprecation Sweep in DungeonHooks and fixed wildcard in ChestGenHooks remove function. + +Build 1.5-7.7.0.575: + LexManos: Fix RenderItem to work with items that use the terrain texture map that aren't in the block ID range. Close #443 + LexManos: Move the RenderWorldLastEvent back to before renderHand like it was in 1.4 Closes #444 + LexManos: Add call to EntityLiving when counting entities for Spawning Cap. Closes #447 + LexManos: Fix missed wildcard change in OreDictionary closes #448 + +Build 1.5-7.7.0.574: + LexManos: Fix crash when EnumHelper can't find $VALUES field, log info, and return gracefully. + +Build 1.5-7.7.0.573: + Christian: + Updated FML: + MinecraftForge/FML@23ea835fa7bc0cdb466d058814b5a0e0c67e8c9a Pass obfuscation status to coremods + +Build 1.5-7.7.0.572: + Christian: Some tweaks to the liquid dictionary, to allow for canonical liquid stacks for things like rendering + Christian: + Updated FML: + MinecraftForge/FML@d88db6c0cfd5484428b574889eae02d34535beae Fix up deep tree deobfuscation + +Build 1.5-7.7.0.571: + LexManos: Removed get/setTextureFile from Block, nolonger used. + LexManos: + Updated FML: + MinecraftForge/FML@7b722bfcd6d4c6867d15492c293a455dfd50d272 Update MCP for latest PR silent update. + MinecraftForge/FML@c6dab815f4e036e25b8f56bef7b8ee63f838adb4 Missed joined.exc, must fix scripts. + +Build 1.5-7.7.0.569: + LexManos: + Updated FML: + MinecraftForge/FML@a90504315e928915345c7b04972d912cdaa0bfdb Readjust size of mods button when Minecraft Realms button is enabled. + +Build 1.5-7.7.0.568: + Christian: Fix the oredictionary for the new recipe wildcard value of Short.MAX_VALUE. + +Build 1.5-7.7.0.567: + Christian: + Updated FML: + MinecraftForge/FML@3765ceb02d783ae5156976f3165bafdb6a3ddbb3 Update MCP, fixes the "broken texture packs" problem. + +Build 1.5-7.7.0.566: + Christian: + Updated FML: + MinecraftForge/FML@179c504746910d4196eef3ee2d56f63cf585c983 Simplify logic in tick start/end + MinecraftForge/FML@29edd242cd7a1fadedf4fb874ea8bbd4e643bffa Fix coremods without a manifest crashing the game. Closes #181 + MinecraftForge/FML@ac16845fc4661fa046a252eda7f9a9a847940189 Fix demo mode crash. Closes #187 + MinecraftForge/FML@984291cee91f585a6f4300eedfed882c814843f8 Fix supertype parsing to handle null superclass (Hi Object!). Closes #160 + MinecraftForge/FML@f6479299936f0f94cfc43210dd9dd44b8b5350ef Merge branch 'master' of github.com:Uristqwerty/FML + MinecraftForge/FML@b301e8e4c1877be246fd4f0b45085b70773d8f2b Change type of connection queue to a concurrent linked queue. Much more efficient, hopefully. Closes #189 + Christian: + Updated FML: + MinecraftForge/FML@dab22f5b74f3f2a410e20583f811605dc8e3c05f Fix "0 mods" display when installed in forge. + +Build 1.5-7.7.0.565: + Christian: + Updated FML: + MinecraftForge/FML@485db6be2e6b54a9a523a2b06e0d886792b0826a Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf. + Christian: + Updated FML: + MinecraftForge/FML@591e65fa1aa52d2a72dc527ad1c2ac53c8eb94c4 Revert "Use the reobfuscation maps in the reflection helper for field lookups: should help some reflection cases with the deobf." + MinecraftForge/FML@2a779ec3289f695b477ec6b0822a27801e2deba1 Try a different way of remapping the fields. Should work because it's userspace, not relauncher space + MinecraftForge/FML@ca2d8bd83475f37946b86cf6fabd8ff810f9c2bf Fix reflection helper: it needs to unmap the classname to find the field maps. + +Build 1.5-7.7.0.563: + Christian: + Updated FML: + MinecraftForge/FML@25f3fcad4654d19637878bdfb2b70a9586fb3fc9 Fix up some relauncher stuff: the vanilla applet works now, as do other applets. Deobf data is resolveable for them too. + +Build 1.5-7.7.0.562: + LexManos: + Updated FML: + MinecraftForge/FML@6bf7c9878cc959d5f5fa8ec0bf9d0d75037df882 Fixed srg name of minecraftDir for runtime deobf. + +Build 1.5-7.7.0.561: + Christian: Refresh patch + Christian: + Updated FML: + MinecraftForge/FML@95d0ff18cdca3b5a91b648c847c00f559f8ce6f2 Fix runtime deobfuscation for remapped inner classes + +Build 1.5-7.7.0.560: + LexManos: + Updated FML: + MinecraftForge/FML@86a9c7d35953296f7c8bd3a2b1b43115ef0f9308 Fixup reobfusication of server code if present. + MinecraftForge/FML@8e7956397dd80902f7ca69c466e833047dfa5010 Just enable server side compile, and warn not to complain tous. + MinecraftForge/FML@889efc1c0a9216b55f6de275e4f4a279d977e60c Fixes GameRegistry.registerBlock + MinecraftForge/FML@fe1623a36a1bb8b0a046d833e896fd46d88898ef Merge pull request #195 from RainWarrior/snapshot15 + MinecraftForge/FML@62f5adf8e21d59408af409a88b2c81757fd3c587 Revert "Fix modlist to use the new texture binding functions, i think" + MinecraftForge/FML@58ee06ea8edf508daa4ab3920790c0153cf6660d Some fixes for the snapshot + MinecraftForge/FML@368a2245ef0071b0b7a35d3bd78ab1ae379f8faf Merge branch 'snapshot15' + MinecraftForge/FML@1eba1dfdc00edf12ca3d8586dc342563218fc717 Fix accidental commands.patch overwrite + MinecraftForge/FML@ebdb166ec87e63503f0071e557cdb44629a0e0c2 Merge branch 'snapshot15' + MinecraftForge/FML@450dd8313c2e9e46d173bbd242f84d48266af7c8 Fix up some small things, merging into mainline + MinecraftForge/FML@1642bad402efe819f4e763bf4b460d8c04194849 Fix Multi-part entity children ID issue, mobs with custom spawning must deal with child ids themselves. + +Build 1.5-7.7.0.559: + LexManos: Update patche for jad-style names. + LexManos: Updated FML and at config for 1.5 snapshot + LexManos: First patches updae to 1.5, Many rendeirng related changes, most notibly removed Item/Block's getTextureFile() functions. + LexManos: Removed some dead code, We don't bind custom tessellators + CovertJaguar: MCL Update + LexManos: Bump major and minor version numbers to mark 1.5, it's gunna break everything. Should be a compileable 1.5 build. + Christian: + Fix a couple of forge patches + + Update FML: d075daf + d075daf Merge branch 'master' into snapshot15 Fix up compilation and patching errors + 1bd6847 Fix up packages.csv ordering for easier diffing + dd832f2 Update for MCP7.30c - fixes redstone rendering issues + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. Also, added in a "pre-server + e1c6630 Javadoc cleanup + 5ce4e31 Fix breaking change + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + aa822e3 Fix logical error in comment text + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + 0165742 Fix mcp conf md5 signatures for the snapshot + 26a5b31 FMLLogFormatter: dynamic log level name + LexManos: + Merge commit '695b080197bd577cc34fe6dbc72b74f4a74b2d5c' into snapshot15 + Testing cherry picking. + LexManos: + Sync up with FML, Will not run nativly as you need deobfusication_data.zip in your libs folder. + We have not setup the download for that yet, to make it yourself just zip joined.srg name it deobfusication_data.zip and put it in lib + LexManos: Not supposed to have debug stuff... + LexManos: Updated Forge to s13w09c + Christian: Fix up patches for FML, also, add in FML as a submodule rather than a zip + Christian: + Add in simple texture management for mods using the stitcher. Scope with "{domain}:{texture}" to + get textures that are not at /textures//{texture}.png but /mods/{domain}/textures//{texture}.png + instead + LexManos: Testing selective commit of submodule. + LexManos: + Added submodule changelog ganerator: + + Updated FML: + MinecraftForge/FML@e74087ee430633475c3ca058e54e3ef242a9d6aa Ignore again, testing submodule. + LexManos: Removed GNUWin32 files and uneeded files seince FML is now a submodule. + LexManos: Remove window helper batch files. + LexManos: Update python scripts to reflect that FML is now a submodule. Delete updateasmdata as it's in /fml/ now. Build should work once again. + LexManos: Change FML module to read-only connection. + Christian: Update submodule + LexManos: Copy over some needed files for debugging. + LexManos: Rework configuration, configs should now use Config.hasChanged to deterne if thehould call save(), also re-worked the saving to not use String.format as much. + LexManos: Fixed new python changes. + LexManos: + Updated FML: + MinecraftForge/FML@aed2cc446ad8d5882890c5f218eb894ea7bd2577 Force file name encoding to UTF-8, caused different zips on different systems. + LexManos: Fix animation location for textures with domains + LexManos: Add helper functions for deling with custom TextureStitched + LexManos: Add callback on TextureStitched to control texture loading. + LexManos: New world event for controlling potential entity spawnlists. For #430 + LexManos: Removed erroring imports and update build function to die on errors. + LexManos: Fix ItemSeedFood respecting custom soils. + LexManos: + Updated FML: + MinecraftForge/FML@debbdc00be8ea1a261cdff83785ddc7100419a74 Capture Minecraft logs into FML logging + MinecraftForge/FML@74fffc6fdc2eda8caa9a7feb0826d7babb84751a Update next render to 40 + Christian: + Call stitcher for non-existent textures as well. Probably allows + for generated textures. Hmmm + Christian: let's do it right this time. Hmmm + Christian: + Updated FML: + MinecraftForge/FML@abe4f73a9a3158f6f9d1ea2334798f54a25817bf FIX massive performance issue with FML. Thanks to @sfPlayer1 for finding this epic derp on my part! + Christian: Add an Icon to the LiquidStack, for rendering the liquid in various ways + LexManos: Readd second render pass to TileEntities and Entities, patches were missed when merging in master branch. As note, CB can DIAF. + LexManos: Fix compile error, forget to flush to disc. + LexManos: Make release quit on compile error. + Christian: Clean up Access Transformer mapping data + Christian: + Updated FML: + MinecraftForge/FML@e9ff699c2dcd787a3e0ebaa427c625a48de4c9fb Refresh the renderengine after modloading is complete. Should fix issues with out-of-place texture registration by mods. + MinecraftForge/FML@a723aa68606d57b0ee5bac8b1d1905abef440b54 Refresh copyright notices on everything + MinecraftForge/FML@c42a2101408b21799728c88e2d02c718c3b0dd36 Strip deprecated code + MinecraftForge/FML@6eeae8c49ff4359dc21c44eb73e4e043285cd8bf Fix up state transition derp when the server crashes with an error- it shouldn't double-derp + MinecraftForge/FML@81c6421f84c1bff359dfe927974e8730b348806a Tweak license text- any osi licensed project can use the asm transformer code + LexManos: + Updated to 1.5 Pre-release + Updated FML: + MinecraftForge/FML@2d98835db8c6a7665ef55117d60ab4318876836b Scala support! It's still primitive, I hope that people will like it. I do :) + MinecraftForge/FML@5bfaf7c1700191b6ed8f4752c9a95bf8c25323ef Global object registry, also, support the new itemblockwithmetadata constructor + MinecraftForge/FML@80a40c03e644840d827eb7d67ff97f6558eaa2e4 Update to MCP 1.5 and minecraft 1.5. + MinecraftForge/FML@b3e854a15d7c50b4967be8237df5fdace95a15ee Update for new MCP with srg reobf. + LexManos: Fix typos. + LexManos: Deprecated Forge's ISidedInventroy, there is a vanilla solution. Added temporary config option to legacy furnace slot orientation. + LexManos: + Updated FML: + MinecraftForge/FML@f1c6bdd57d41a938cb3326d509042f6842e42396 Support the MCP format of partial reobfuscation for portability. Ensure modloader-like compatibility + MinecraftForge/FML@0419b9d9751ade4497343aefaf2ca43703eb479a Update MCP info for latest + LexManos: Early define CrashReport classes to combat invalid crash details. + LexManos: Fix reobf call. + +Build 1.5-7.7.0.558-snapshot15: + Christian: Clean up Access Transformer mapping data + Christian: + Updated FML: + MinecraftForge/FML@e9ff699c2dcd787a3e0ebaa427c625a48de4c9fb Refresh the renderengine after modloading is complete. Should fix issues with out-of-place texture registration by mods. + MinecraftForge/FML@a723aa68606d57b0ee5bac8b1d1905abef440b54 Refresh copyright notices on everything + MinecraftForge/FML@c42a2101408b21799728c88e2d02c718c3b0dd36 Strip deprecated code + MinecraftForge/FML@6eeae8c49ff4359dc21c44eb73e4e043285cd8bf Fix up state transition derp when the server crashes with an error- it shouldn't double-derp + MinecraftForge/FML@81c6421f84c1bff359dfe927974e8730b348806a Tweak license text- any osi licensed project can use the asm transformer code + LexManos: + Updated to 1.5 Pre-release + Updated FML: + MinecraftForge/FML@2d98835db8c6a7665ef55117d60ab4318876836b Scala support! It's still primitive, I hope that people will like it. I do :) + MinecraftForge/FML@5bfaf7c1700191b6ed8f4752c9a95bf8c25323ef Global object registry, also, support the new itemblockwithmetadata constructor + MinecraftForge/FML@80a40c03e644840d827eb7d67ff97f6558eaa2e4 Update to MCP 1.5 and minecraft 1.5. + MinecraftForge/FML@b3e854a15d7c50b4967be8237df5fdace95a15ee Update for new MCP with srg reobf. + LexManos: Fix typos. + LexManos: Deprecated Forge's ISidedInventroy, there is a vanilla solution. Added temporary config option to legacy furnace slot orientation. + LexManos: + Updated FML: + MinecraftForge/FML@f1c6bdd57d41a938cb3326d509042f6842e42396 Support the MCP format of partial reobfuscation for portability. Ensure modloader-like compatibility + MinecraftForge/FML@0419b9d9751ade4497343aefaf2ca43703eb479a Update MCP info for latest + LexManos: Early define CrashReport classes to combat invalid crash details. + LexManos: Fix reobf call. + +Build 13w09c-7.7.0.556-snapshot15: + LexManos: Make release quit on compile error. + +Build 13w09c-7.7.0.555-snapshot15: + LexManos: Readd second render pass to TileEntities and Entities, patches were missed when merging in master branch. As note, CB can DIAF. + LexManos: Fix compile error, forget to flush to disc. + +Build 13w09c-7.7.0.553-snapshot15: + Christian: Add an Icon to the LiquidStack, for rendering the liquid in various ways + +Build 13w09c-7.7.0.552-snapshot15: + Christian: + Updated FML: + MinecraftForge/FML@abe4f73a9a3158f6f9d1ea2334798f54a25817bf FIX massive performance issue with FML. Thanks to @sfPlayer1 for finding this epic derp on my part! + +Build 13w09c-7.7.0.551-snapshot15: + Christian: let's do it right this time. Hmmm + +Build 13w09c-7.7.0.550-snapshot15: + Christian: + Call stitcher for non-existent textures as well. Probably allows + for generated textures. Hmmm + +Build 13w09c-7.7.0.549-snapshot15: + LexManos: Fix ItemSeedFood respecting custom soils. + LexManos: + Updated FML: + MinecraftForge/FML@debbdc00be8ea1a261cdff83785ddc7100419a74 Capture Minecraft logs into FML logging + MinecraftForge/FML@74fffc6fdc2eda8caa9a7feb0826d7babb84751a Update next render to 40 + +Build 13w09c-7.7.0.548-snapshot15: + LexManos: Removed erroring imports and update build function to die on errors. + +Build 13w09c-7.7.0.547-snapshot15: + LexManos: New world event for controlling potential entity spawnlists. For #430 + +Build 13w09c-7.7.0.546-snapshot15: + LexManos: Add callback on TextureStitched to control texture loading. + +Build 13w09c-7.7.0.545-snapshot15: + LexManos: Fix animation location for textures with domains + LexManos: Add helper functions for deling with custom TextureStitched + +Build 13w09c-7.7.0.544-snapshot15: + LexManos: Copy over some needed files for debugging. + LexManos: Rework configuration, configs should now use Config.hasChanged to deterne if thehould call save(), also re-worked the saving to not use String.format as much. + LexManos: Fixed new python changes. + LexManos: + Updated FML: + MinecraftForge/FML@aed2cc446ad8d5882890c5f218eb894ea7bd2577 Force file name encoding to UTF-8, caused different zips on different systems. + +Build 13w09c-7.7.0.543-snapshot15: + Christian: Update submodule + +Build 13w09c-7.7.0.542-snapshot15: + Christian: Fix up patches for FML, also, add in FML as a submodule rather than a zip + Christian: + Add in simple texture management for mods using the stitcher. Scope with "{domain}:{texture}" to + get textures that are not at /textures//{texture}.png but /mods/{domain}/textures//{texture}.png + instead + LexManos: Testing selective commit of submodule. + LexManos: + Added submodule changelog ganerator: + + Updated FML: + MinecraftForge/FML@e74087ee430633475c3ca058e54e3ef242a9d6aa Ignore again, testing submodule. + LexManos: Removed GNUWin32 files and uneeded files seince FML is now a submodule. + LexManos: Remove window helper batch files. + LexManos: Update python scripts to reflect that FML is now a submodule. Delete updateasmdata as it's in /fml/ now. Build should work once again. + LexManos: Change FML module to read-only connection. + +Build 13w09c-7.7.0.539-snapshot15: + LexManos: Updated Forge to s13w09c + +Build 13w05b-7.7.0.538-snapshot15: + LexManos: Not supposed to have debug stuff... + +Build 13w05b-7.7.0.537-snapshot15: + LexManos: + Sync up with FML, Will not run nativly as you need deobfusication_data.zip in your libs folder. + We have not setup the download for that yet, to make it yourself just zip joined.srg name it deobfusication_data.zip and put it in lib + +Build 13w02b-7.7.0.536-snapshot15: + mehvids: Gave entities and tile entities access to the second render pass for translucency. + Christian: Attempt to fix a possible NPE in the face of ChickenBones' hackery. ChickenBones. stop it! + Christian: + Fix a potential problem with "Entity already added" when using the dormant + chunk cache capability. The entities in the dormant chunk cache will get new + IDs prior to the cached chunk returning. + Christian: Fix NPE causing issue with the cache. Derpy derp. + Christian: + Add in TESR culling, and a new TileEntity method to allow for differential sizing of the + TESR view culling vs the TE collision bounding box (the former defaults to the latter) + Checked into a branch because it's likely to break expanded TileEntities. + Christian: Bump the revision number for the TESR and renderpass changes + Christian: + Add in a mechanism for explicit subclassing of WeightedRandomChestItem to allow for + generational style chest content generation rather than static. Cleans up some old code nicely + Christian: + We try and log a message if we detect a world leak: it's probably not infallible, but it should + help mod developers- if you see this when testing your mod with, say, mystcraft, you're probably + keeping a hold of an invalid handle to the World (either directly, or indirectly via Entity or TileEntity) + and you should look to refactor to wrap those handles in WeakReferences + LexManos: Moved warning logic down, so that no more tickets are isues if the mod is over it's alotment. Fixes #378 + LexManos: Forge Additions: Exposed ChunkCache.worldObj to public PR #383 + LexManos: Fixup a resource leak warning. + LexManos: Add DimensionManager.unregisterProviderType for PR #388 + LexManos: Added input getters for Ore recipies, and javadoc warning for modders, #390 + LexManos: Rework canSilkHarvest hook to try and honor vanilla overrides, should close #391 + LexManos: Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 + LexManos: Change access of upper and lower chest fields of InventoryLargeChest to public. Closes #387 + LexManos: Change WorldServer.allPlayersSleeping to public, and remove the SideOnly annotation on EntityPlayer.getSleepTimer() Closes #393 + LexManos: Fix initalization issue with the clamping threshold config value. And remove vanilla console spam related to it. + Christian: Fix small derp in TE + Christian: + Update FML:549b6fd + 549b6fd IMC tweaks: runtimeMessages now work (thanks for all that testing for this much requested feature!) and IMCEvent will no longer rem + 9fafdc1 More logging tweaks. You can probably configure individual mod log files if you wish now + f169f7c A log of logging cleanup. FML will now read logging.properties to configure logging channels a couple of times during startup. You + 3ac891f Try and handle "death on startup" a bit cleaner + 2dc0189 Deprecate the old GUI ticktype. They're dead and have been for some time. + dd98784 Tweak a method signature + 1c9a510 Add parameters to FML install to enable/disable certian aspects. Applying patches, running transformer/merger, and decompiling serv + 1bd6847 Fix up packages.csv ordering for easier diffing + Christian: + Add in "armor ticking"- implement the interface and the armor piece will tick. + + Update FML:22dbe41 + 22dbe41 Fix up mistake that broke all modloading. Nice. + Christian: Fix TESR rendering for double chests + Christian: Fix possible null case for collision bounding box. + Christian: Remove the single use interface ITickingArmor, and apply to Item directly. + Christian: + Fix ServerBrand retriever- forge is now forge,fml! + + Update FML: cd96718 + cd96718 Fix HD mob skins, FINALLY!!! Stupid eyes are stupid. + LexManos: Kill generated timestamp in config files, if you want to retreive this information, usethe file's modified time. Closes #404 + LexManos: Actually use the line parameter in ServerChatEvent, closes #401 + LexManos: Kill .sh wrappers until someone writes more robust versions, closes #392 and closes #402 + LexManos: Made LiquidStack.isLiquidEqual(ItemStack) properly check the contained liquid, in addition to obvious id/meta closes #399 and closes #403 + LexManos: Add item frame transformations to the EntityItem render helper Closes #407 + LexManos: Added a hook into SlotArmor so Items can control if they are classified as a Armor type. Closes #408 + LexManos: Fixes comparison for items in creative inventory, closes #411 + LexManos: Fix fortune modifier always passed as 0 to idDropped closes #412 + LexManos: Fix EventTransformer throwing an NPE when transforming a class that doesn't exist. Closes #413 + LexManos: Fix profiler issue with RenderGlobal patch. Closes #414 + LexManos: Jenkins needs this script, *pokes Overmind* -.- + LexManos: + Update FML to 556: + b6d6f235 Fix sprite map issue. + 1158aa46 Fix Language Registry, closes #FML 163 + 50ce6fb3 Option to disable renaming for srgnames. + LexManos: Disable automatic equiti of pcke dup items for players, and fixed index issues in Player.setCurrentItemOrArmor. + LexManos: Fixed entity colision above max world height, and below 0. Closes #400 + LexManos: Change usage of ketSet/get to entrySet in OreDictionary, closes #422 + LexManos: Fix movement speed check, closes #420 + LexManos: clarify what the size is measured in for the dormant chunk cache. -.- + LexManos: ItemStack sensitive versions of Item.getPotionEffect and Item.isPotionIngredient Closes #321 + LexManos: WorldGen*Trees shoud not respect custom soils. Closes #355 + LexManos: Added unload event for client worlds Closes #405 + LexManos: Store the glMultiTexCoord lightmap for later use with glDrawArrays closes #406 + LexManos: Add water and lava to liquid dictionary by default, closes #419 + LexManos: Bump version to 6.6.2, declaring Forge for MC 1.4.7 feature complete, as 1.5 is on the horizon, only bug fixes from this point on. Unless something major happens on Mojang's end. + LexManos: Fix TESR culling for beacons, and implement a good enough measure for Chests. + +Build 13w02b-7.7.0.535-snapshot15: + LexManos: + Merge commit '695b080197bd577cc34fe6dbc72b74f4a74b2d5c' into snapshot15 + Testing cherry picking. + +Build 1.4.7-6.6.2.534: + LexManos: Fix TESR culling for beacons, and implement a good enough measure for Chests. + +Build 1.4.7-6.6.2.533: + LexManos: Bump version to 6.6.2, declaring Forge for MC 1.4.7 feature complete, as 1.5 is on the horizon, only bug fixes from this point on. Unless something major happens on Mojang's end. + +Build 1.4.7-6.6.1.532: + LexManos: Added unload event for client worlds Closes #405 + LexManos: Store the glMultiTexCoord lightmap for later use with glDrawArrays closes #406 + LexManos: Add water and lava to liquid dictionary by default, closes #419 + +Build 1.4.7-6.6.1.531: + LexManos: WorldGen*Trees shoud not respect custom soils. Closes #355 + +Build 1.4.7-6.6.1.530: + LexManos: Fix movement speed check, closes #420 + LexManos: clarify what the size is measured in for the dormant chunk cache. -.- + LexManos: ItemStack sensitive versions of Item.getPotionEffect and Item.isPotionIngredient Closes #321 + +Build 1.4.7-6.6.1.529: + LexManos: Disable automatic equiti of pcke dup items for players, and fixed index issues in Player.setCurrentItemOrArmor. + LexManos: Fixed entity colision above max world height, and below 0. Closes #400 + LexManos: Change usage of ketSet/get to entrySet in OreDictionary, closes #422 + +Build 1.4.7-6.6.1.528: + LexManos: + Update FML to 556: + b6d6f235 Fix sprite map issue. + 1158aa46 Fix Language Registry, closes #FML 163 + 50ce6fb3 Option to disable renaming for srgnames. + +Build 1.4.7-6.6.1.527: + LexManos: Kill generated timestamp in config files, if you want to retreive this information, usethe file's modified time. Closes #404 + LexManos: Actually use the line parameter in ServerChatEvent, closes #401 + LexManos: Kill .sh wrappers until someone writes more robust versions, closes #392 and closes #402 + LexManos: Made LiquidStack.isLiquidEqual(ItemStack) properly check the contained liquid, in addition to obvious id/meta closes #399 and closes #403 + LexManos: Add item frame transformations to the EntityItem render helper Closes #407 + LexManos: Added a hook into SlotArmor so Items can control if they are classified as a Armor type. Closes #408 + LexManos: Fixes comparison for items in creative inventory, closes #411 + LexManos: Fix fortune modifier always passed as 0 to idDropped closes #412 + LexManos: Fix EventTransformer throwing an NPE when transforming a class that doesn't exist. Closes #413 + LexManos: Fix profiler issue with RenderGlobal patch. Closes #414 + LexManos: Jenkins needs this script, *pokes Overmind* -.- + +Build 1.4.7-6.6.1.524: + Christian: + Fix ServerBrand retriever- forge is now forge,fml! + + Update FML: cd96718 + cd96718 Fix HD mob skins, FINALLY!!! Stupid eyes are stupid. + +Build 1.4.7-6.6.1.523: + Christian: Remove the single use interface ITickingArmor, and apply to Item directly. + +Build 1.4.7-6.6.1.522: + Christian: Fix possible null case for collision bounding box. + +Build 1.4.7-6.6.1.521: + mehvids: Gave entities and tile entities access to the second render pass for translucency. + Christian: + Add in TESR culling, and a new TileEntity method to allow for differential sizing of the + TESR view culling vs the TE collision bounding box (the former defaults to the latter) + Checked into a branch because it's likely to break expanded TileEntities. + Christian: Bump the revision number for the TESR and renderpass changes + Christian: Fix small derp in TE + Christian: + Update FML:549b6fd + 549b6fd IMC tweaks: runtimeMessages now work (thanks for all that testing for this much requested feature!) and IMCEvent will no longer rem + 9fafdc1 More logging tweaks. You can probably configure individual mod log files if you wish now + f169f7c A log of logging cleanup. FML will now read logging.properties to configure logging channels a couple of times during startup. You + 3ac891f Try and handle "death on startup" a bit cleaner + 2dc0189 Deprecate the old GUI ticktype. They're dead and have been for some time. + dd98784 Tweak a method signature + 1c9a510 Add parameters to FML install to enable/disable certian aspects. Applying patches, running transformer/merger, and decompiling serv + 1bd6847 Fix up packages.csv ordering for easier diffing + Christian: + Add in "armor ticking"- implement the interface and the armor piece will tick. + + Update FML:22dbe41 + 22dbe41 Fix up mistake that broke all modloading. Nice. + Christian: Fix TESR rendering for double chests + +Build 1.4.7-6.6.1.520-TESRculling: + Christian: Fix small derp in TE + +Build 1.4.7-6.6.1.519-TESRculling: + Christian: + Add in a mechanism for explicit subclassing of WeightedRandomChestItem to allow for + generational style chest content generation rather than static. Cleans up some old code nicely + Christian: + We try and log a message if we detect a world leak: it's probably not infallible, but it should + help mod developers- if you see this when testing your mod with, say, mystcraft, you're probably + keeping a hold of an invalid handle to the World (either directly, or indirectly via Entity or TileEntity) + and you should look to refactor to wrap those handles in WeakReferences + LexManos: Moved warning logic down, so that no more tickets are isues if the mod is over it's alotment. Fixes #378 + LexManos: Forge Additions: Exposed ChunkCache.worldObj to public PR #383 + LexManos: Fixup a resource leak warning. + LexManos: Add DimensionManager.unregisterProviderType for PR #388 + LexManos: Added input getters for Ore recipies, and javadoc warning for modders, #390 + LexManos: Rework canSilkHarvest hook to try and honor vanilla overrides, should close #391 + LexManos: Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 + LexManos: Change access of upper and lower chest fields of InventoryLargeChest to public. Closes #387 + LexManos: Change WorldServer.allPlayersSleeping to public, and remove the SideOnly annotation on EntityPlayer.getSleepTimer() Closes #393 + LexManos: Fix initalization issue with the clamping threshold config value. And remove vanilla console spam related to it. + +Build 1.4.7-6.6.0.518: + LexManos: Fix initalization issue with the clamping threshold config value. And remove vanilla console spam related to it. + +Build 1.4.7-6.6.0.517: + LexManos: Moved warning logic down, so that no more tickets are isues if the mod is over it's alotment. Fixes #378 + LexManos: Forge Additions: Exposed ChunkCache.worldObj to public PR #383 + LexManos: Fixup a resource leak warning. + LexManos: Add DimensionManager.unregisterProviderType for PR #388 + LexManos: Added input getters for Ore recipies, and javadoc warning for modders, #390 + LexManos: Rework canSilkHarvest hook to try and honor vanilla overrides, should close #391 + LexManos: Added catch to TileEntityChestRenderer for potential crash when modders do bad things -.- Closes #389 + LexManos: Change access of upper and lower chest fields of InventoryLargeChest to public. Closes #387 + LexManos: Change WorldServer.allPlayersSleeping to public, and remove the SideOnly annotation on EntityPlayer.getSleepTimer() Closes #393 + +Build 1.4.7-6.6.0.516: + Christian: + We try and log a message if we detect a world leak: it's probably not infallible, but it should + help mod developers- if you see this when testing your mod with, say, mystcraft, you're probably + keeping a hold of an invalid handle to the World (either directly, or indirectly via Entity or TileEntity) + and you should look to refactor to wrap those handles in WeakReferences + +Build 1.4.7-6.6.0.515: + Christian: + Add in a mechanism for explicit subclassing of WeightedRandomChestItem to allow for + generational style chest content generation rather than static. Cleans up some old code nicely + +Build 1.4.7-6.6.1.514-TESRculling: + Christian: Bump the revision number for the TESR and renderpass changes + +Build 1.4.7-6.6.0.513-TESRculling: + mehvids: Gave entities and tile entities access to the second render pass for translucency. + +Build 1.4.7-6.6.0.511: + Christian: Fix NPE causing issue with the cache. Derpy derp. + +Build 1.4.7-6.6.0.510: + Christian: + Fix a potential problem with "Entity already added" when using the dormant + chunk cache capability. The entities in the dormant chunk cache will get new + IDs prior to the cached chunk returning. + +Build 1.4.7-6.6.0.509: + Christian: Attempt to fix a possible NPE in the face of ChickenBones' hackery. ChickenBones. stop it! + +Build 13w02b-7.7.0.508-snapshot15: + scott: Add ability to WorldTypes to display the 'Customize' button and react to it + LexManos: + Update FML: + New scripts for signing jars, and repackging source folders. + Fix LanguageRegistry loading files in UTF-8 format. loadLocalization should work for non-xml in all languages now (assumes UTF-8) + Fix incorrect end length calculation. Closes #161 Thanks BStramke! + LexManos: Fix check in getItem() to allow lowest item ID #361 + CovertJaguar: + Fixed render passes for EntityItems + + Should be < instead of <= + Christian: + Update licencing information to make clear that forge is allowed to redistribute and automatically + download parts of MCP, but this permission is not transitive to people distributing MinecraftForge + source independently of the MinecraftForge project. + + Update MCP to 7.26a and FML: 7ad8529 + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + Christian: + Update FML: a99c488 + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + aa822e3 Fix logical error in comment text + 26a5b31 FMLLogFormatter: dynamic log level name + Christian: Merge part of PR #375 related to ChunkEvent.Load for the client side + Christian: + Update FML: 5ce4e31 + 5ce4e31 Fix breaking change + Christian: + Add in patch to change how playerinstance sends TE chunk updates. It should always send just the TEs + that changed now, and not "ALL" TEs. Also, added configuration value to change the 64 threshold to a + configurable number + Christian: Some javadoc fixes + Christian: + Change DimensionManager.getCurrentSaveRootDirectory() to try and work even for the new server about to start event + + Update FML:8921cfe + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. A + Christian: + Update FML:aebf6eb + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + Christian: + Fix a couple of forge patches + + Update FML: d075daf + d075daf Merge branch 'master' into snapshot15 Fix up compilation and patching errors + 1bd6847 Fix up packages.csv ordering for easier diffing + dd832f2 Update for MCP7.30c - fixes redstone rendering issues + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. Also, added in a "pre-server + e1c6630 Javadoc cleanup + 5ce4e31 Fix breaking change + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + aa822e3 Fix logical error in comment text + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + 0165742 Fix mcp conf md5 signatures for the snapshot + 26a5b31 FMLLogFormatter: dynamic log level name + +Build 1.4.7-6.6.0.507: + Christian: + Update FML:aebf6eb + aebf6eb Add in a registry method to allow for alternative TileEntity names- they will be used to support loading maps containing the older definiti + +Build 1.4.7-6.6.0.506: + Christian: + Change DimensionManager.getCurrentSaveRootDirectory() to try and work even for the new server about to start event + + Update FML:8921cfe + 8921cfe Remember to add the new patches! + cd67596 The "ServerStarting" event should now properly crash the server if it fails, so the client will properly exit. A + +Build 1.4.7-6.6.0.505: + Christian: Some javadoc fixes + +Build 1.4.7-6.6.0.504: + Christian: + Update FML: 5ce4e31 + 5ce4e31 Fix breaking change + Christian: + Add in patch to change how playerinstance sends TE chunk updates. It should always send just the TEs + that changed now, and not "ALL" TEs. Also, added configuration value to change the 64 threshold to a + configurable number + +Build 1.4.7-6.6.0.503: + scott: Add ability to WorldTypes to display the 'Customize' button and react to it + CovertJaguar: + Fixed render passes for EntityItems + + Should be < instead of <= + Christian: Merge part of PR #375 related to ChunkEvent.Load for the client side + +Build 1.4.7-6.6.0.502: + Christian: + Update FML: a99c488 + a99c488 Merge branch 'patch-1' of https://github.com/bspkrs/FML into gh-updates + 94282c5 Merge branch 'FMLLogFormatter' of https://github.com/donington/FML into gh-updates + aa822e3 Fix logical error in comment text + 26a5b31 FMLLogFormatter: dynamic log level name + +Build 1.4.7-6.6.0.501: + Christian: + Update licencing information to make clear that forge is allowed to redistribute and automatically + download parts of MCP, but this permission is not transitive to people distributing MinecraftForge + source independently of the MinecraftForge project. + + Update MCP to 7.26a and FML: 7ad8529 + 7ad8529 Update MCP to MCP7.26a and refresh MCP names + 15534ed Update address of the FML repository to the new location in all the files + a14ab91 Update license text to make clear that FML is not a way to sidestep MCP licensing. + +Build 13w02b-7.7.0.500-snapshot15: + LexManos: Bump major and minor version numbers to mark 1.5, it's gunna break everything. Should be a compileable 1.5 build. + +Build 1.4.7-6.6.0.499: + LexManos: + Update FML: + New scripts for signing jars, and repackging source folders. + Fix LanguageRegistry loading files in UTF-8 format. loadLocalization should work for non-xml in all languages now (assumes UTF-8) + Fix incorrect end length calculation. Closes #161 Thanks BStramke! + LexManos: Fix check in getItem() to allow lowest item ID #361 + +Build 1.4.7-6.6.0.497: + LexManos: Added getter for Metadata smelting list, because, why not.. PR: #352 + LexManos: Fixed incorrect lighting in some cases. Closes issue #349 + LexManos: + Added event hooks to control to allow mod control of mob spawning. PR: #337 + Deprecated LivingSpecialSpawnEvent in favor of new LivingSpawnEvent.SpecialSpawn + +Build 1.4.7-6.6.0.496: + LexManos: Fix issue where dungeon loot table had wrong values. + LexManos: Fixed issue where ChunkPriderEvent.InitNoiseField used the wrong sizeY value. + LexManos: Some small code cleanups. + +Build 1.4.7-6.6.0.495: + Christian: + Update FML:6f1b762 + 6f1b762 Move server stopped *after* the server has actually stopped. *sigh* + +Build 1.4.7-6.6.0.494: + Christian: + Update FML:d9bfb29 + d9bfb29 Add in a "server stopped" event + +Build 1.4.7-6.6.0.493: + Christian: + Attempt to resolve the entity concurrency issue, by simply deferring unload + to the next tick + +Build 1.4.7-6.6.0.492: + Christian: Fix noisy exception logging + Christian: + Update FML:6fc7bc4 + 6fc7bc4 Add in some classloader debugging information: use fml.debugClassLoading=true as a system property to track down prob + +Build 1.4.7-6.6.0.491: + Christian: + Fix a missed patch and cleaned up other patches + Rollback a method name change that breaks a lot of mods + Update FML: fb701cd + fb701cd Revert MCP name change for canConnectRedstone - it conflicts with a forge method of the same name and breaks 1 + +Build 1.4.7-6.6.0.490: + Christian: + Update for MC 1.4.7 + Update FML: f7cc50b + +Build 1.4.6-6.5.0.489: + LexManos: Attempt a fix for the new chunk compression changes. + +Build 1.4.6-6.5.0.488: + Christian: + Update FML:1a232cf + 1a232cf Fix multiple GUI containers for ML containers. Sorry ultimatechest that this fix took so long, a bug report at + 853f54b Log if there's a problem reading the class bytes + +Build 1.4.6-6.5.0.487: + LexManos: Fix mobs spawning on inverted slabs/stairs. + +Build 1.4.6-6.5.0.486: + LexManos: Use nanoTime instead of currentTimeMillis for potential performance increase. + LexManos: Fixed order <.< you saw nothing. + +Build 1.4.6-6.5.0.484: + LexManos: Fixed issue with Efficancy enchatment when connected to vanilla servers. + LexManos: Fixed EntityMinecard missed patch, Issue #338 + LexManos: Fixed typo in dungeon loot + +Build 1.4.6-6.5.0.483: + Uristqwerty: + Force parent ListenerListInsts to rebuild. + + Without this change, it is possible (and, in fact, nearly guaranteed) for lists to rebuild endlessly if a parent list is marked as needing a rebuild but never actually read. This change forces the parent list(s) to rebuild as well, resulting in a significant performance increase and smoother framerate due to greatly reduced GC activity. + Christian: Protect deflation with a simple semaphore. Should close #336 + +Build 1.4.6-6.5.0.482: + LexManos: Update FML: Fix NPE in fingerprint loading, and pass expectged fingerprint to FMLFingerprintViolationEvent + +Build 1.4.6-6.5.0.481: + Christian: + Update FML: 7e6456d + 7e6456d Fix a message delivery issue in IMC + 664ebda Some tweaks for signing and ID matching + +Build 1.4.6-6.5.0.480: + LexManos: + Fixes a vanilla bug where the player view would dip when stepping between certain blocks + https://mojang.atlassian.net/browse/MC-1594 + Issue #318, let me know if you notice any issue. + +Build 1.4.6-6.5.0.479: + LexManos: Fixed parameter ordering u.u + +Build 1.4.6-6.5.0.478: + LexManos: + Re-write/Deprecated DungeonHooks loot tables, now uses ChestGenHooks like the rest of the world gen. Also fixes issue #330 by adding in enchanted books. + + Should be API compatible. + +Build 1.4.6-6.5.0.477: + LexManos: + Move chunk compression to the network thread in Packet 51 and 56 + + This will reduce the server load considerably by doing the chunk data compression in writePacketData, which will be run from the network thread. + + The chunk compression can easily use 1/4th of the overall server thread CPU time if someone is exploring much, especially when moving quickly (e.g. with quantum leggings). + + Player, this is how it's properly done. + +Build 1.4.6-6.5.0.476: + LexManos: Fix missed patch in EntityMinecart, #334 + LexManos: Explicitly check if useItem is not denied, allows for denying the item without denying the block + +Build 1.4.6-6.5.0.475: + LexManos: Delete unneeded patch. + +Build 1.4.6-6.5.0.474: + Christian: Some access transformations to allow mystcraft to work again. Closes #331 + +Build 1.4.6-6.5.0.473: + Christian: Fix Fireworks to always work in SMP + +Build 1.4.6-6.5.0.472: + Christian: + Fix up enchantment at the enchanting table vs via a book. Adds in a method + that previously exists under a new name: canApplyAtEnchantingTable() + to determine enchantments that can apply at the enchanting table (a smaller + subset of all possible enchantments for an item, now). Also, add your + enchantments to the anvil book application list, if neccessary. + +Build 1.4.6-6.5.0.471: + Christian: Tweak packet56 to see if this resolves the apparent worldgen derpiness + +Build 1.4.6-6.5.0.470: + Christian: + Server side only item callback: allow a held item to decide if it wants to pass sneak-clicks through + to a block, or not. Defaults false- the same as the new vanilla behaviour (sneak clicks with an item + in hand don't activateBlock anymore). + +Build 1.4.6-6.5.0.469: + Christian: Move another patch up a bit - should actually close #329 + +Build 1.4.6-6.5.0.468: + Christian: Add IPlantable to itemseedfood. Potato and carrot support! + +Build 1.4.6-6.5.0.467: + LexManos: + Update FML: + Fixed issue with users who don't have the JDK installed in there path + MCP will now output bfusicated files with windows reserved names to _name.class and FML will prioritize those names. + Fixed placement of onConnectionClosed callback + LexManos: Updated NetClientHandler for onConnectionClosed placement fix. + LexManos: Fixed cpw's derp in the PlayerInteractEvent logic. + +Build 1.4.6-6.5.0.466: + Christian: Fix ItemInWorldManager so that itemUseFirst works, and the playerinteractevent works. Minor patching mis hit. Apologies. + +Build 1.4.6-6.5.0.465: + Christian: OK. AT the right thing, and add in a call to always get the right thing. Clean up patch fuzz too. + +Build 1.4.6-6.5.0.464: + Christian: Access Transform a couple of methods + +Build 1.4.6-6.5.0.463: + LexManos: Fixe BiomeDecorator AT entry. + +Build 1.4.6-6.5.0.462: + Christian: Drop the item in onBlockHarvested, not breakBlock + +Build 1.4.6-6.5.0.461: + Christian: Fix up block drops for skulls and cocoa + +Build 1.4.6-6.5.0.460: + Christian: And fix up the other equals + +Build 1.4.6-6.5.0.459: + Christian: Fix comparing ItemStack tags for equality + +Build 1.4.6-6.5.0.458: + Christian: + Update FML: 40e57a2 + 40e57a2 Update MCP to newer version Fix fingerprint fire + +Build 1.4.6-6.5.0.457: + Christian: + Fix accidentally removed not-deprecated methods. + + Update FML: d604e44 + d604e44 InterModComms now supports a runtime polling based model for inter-mod comms at runtime. Deprecate method that shouldn't be used. COPY it's content to your mod. Don't CALL it. + 8b7778c Don't be as alarming about item overwrites. + +Build 1.4.6-6.5.0.456: + Christian: Fix binding the texture for multiple render passes. Thanks mdiyo! Closes #320 + +Build 1.4.6-6.5.0.455: + Christian: Allow RenderItem to be easily overridden for things that need to render entityitems. IronChest, BuildCraft, RP2, whatever... + +Build 1.4.6-6.5.0.454: + LexManos: Fixed items dieing improperly due to new EntityItem sync changes, also made items render offset when rendered in 3d. + +Build 1.4.6-6.5.0.453: + Christian: Fix RenderItem so that forge textures load for it + +Build 1.4.6-6.5.0.452: + LexManos: Removed all functions marked as deperacted for the new MC version + LexManos: + Updated FML: + Fixes startclient/startserver + + Added configuration file which allows modids to ignore ID validation checking. IT WILL CRASH YOUR GAME in 99.999% of cases. + + Immibis is a whingy ass. And TinyTimRob too. Now STFU and GTFO. closes fml/#510 for ever. + +Build 1.4.6-6.5.0.451: + LexManos: Inital update to 1.4.6, Version bumped to 6.5 + LexManos: Added jar signing to forge, we sign cpw/* and net/minecraftforge/* + LexManos: Try and print error while signing jar + +Build 1.4.5-6.4.2.448: + Christian: + Update FML: e98c311 + e98c311 Fix up handling null names. *sigh* + +Build 1.4.5-6.4.2.447: + Christian: + Update FML: 293edb3 + 293edb3 Some tweaks to item identification. The GameRegistry methods are deprecated to encourage you to use the new named ones instead. These will force a name on the item/block, allowing for stronger matching t + 9266ff3 Updated MCP download mirriors upon Searge's request. + 31695d5 Fix var name messup + bfb3020 Update released eclipse project to link BouncyCastle + 22a88ea Change ID management slightly. IDs are tracked by block type for itemblock items now. This means servers will need to update. Also, ordinal rearrangements within a mod will no longer trigger server disco + +Build 1.4.5-6.4.2.446: + LexManos: Make PlaySoundAtEntityEvent fire for players as well + LexManos: Remove erronious double call to PlayerDestroyItemEvent + +Build 1.4.5-6.4.2.445: + LexManos: Update FML to fix a typo + +Build 1.4.5-6.4.2.444: + LexManos: Automatically resolved imports. + LexManos: Fixup workspace for BC replacement + LexManos: Manual import fixes + LexManos: + Update FML: + Minecraft is now decompiled into sane package names. + Got rid of the src/common folder as the only folder that exists is src/mincraft, because the client and server codebase is merged. + ID Map generation/validation fixes + LexManos: Updated python scripts for removal of common folder + LexManos: Update patches for repackage. + LexManos: Update AT for repackage + LexManos: Update FML: Fixed the eclipse workspace to reference BouncyCastle library. + +Build 1.4.5-6.4.2.443: + LexManos: Bump version to 6.4.2 to mark the merge of TerrainGen branch. + +Build 1.4.5-6.4.1.442: + Christian: + Added terrain gen events + Added biome color events for @XCompWiz + Christian: Removed unchanged file + Christian: Readded unchanged version + Christian: For @XCompWiz, added a hook to allow mods to dynamically change the color that water is rendered. + Christian: Fix RenderBlocks patch, touch branch + +Build 1.4.5-6.4.1.441: + LexManos: + Update FML: + 2f34290e: Fix possible escape leakage.. + 83deece6: Change ID management slightly. IDs are tracked by block type for ItemBlock items now. This means servers will need to update. + + Also, ordinal rearrangements within a mod will no longer trigger server disconnection, though a warning will still be logged. + LexManos: Derp, imported the repackaged names not old names. + +Build 1.4.5-6.4.1.439: + LexManos: Update readme to reflect the fact that we now download MCP. + +Build 1.4.5-6.4.1.438: + LexManos: Fix ForgeDirection.ROTATION_MATRIX for issue #313 + LexManos: Made GuiContainer.drawSlotInventory overrideable for issue #312 + LexManos: Made BlockButton.func_82535_o overrideable for issue #311 + LexManos: Moved check if map cursor should 'spin' and which world a player respawns in to WorldProvider for PR #308 + LexManos: Add .DS_Store to the gitignore for mac users + LexManos: Add CloudRenderer for PR #304 + LexManos: New TileEntity function to determine if the TE should be destroied when Block/Meta changes, For Issue #300 + LexManos: Pistons now respect world height a little better, for PR #286, will review Rotation event later. + LexManos: Creative GUI will now remember what tab page you were on, thanks Matchlighter PR #290 + LexManos: Fix type in ForgeChunkManager.ticketCountAvaILableFor, thanks iChun PR: #285 + LexManos: Fixes crash when mods add TreeMaps to the Configuration map, thanks AtomicStryker, PR: #282 + LexManos: Fix shouldRiderSit() to properly determine if rider is sitting. + LexManos: Expose BiomeDecorator fields for custom Biome information, Issue: #239 + LexManos: Make BlockButton.sensible protected and non-final + +Build 1.4.5-6.4.1.437: + LexManos: Fix for FML Fixes eclipse workspace, now sets execution bits on astyle-osx, and mcp .sh files. Also now kills install if astyle is not found. + +Build 1.4.5-6.4.1.436: + LexManos: Fixed release -skipchangelog + LexManos: Fixed install --mcp-dir + LexManos: + Updated FML to 486: + 02b54ca8: Add a modid on the mods list, should make it easier to do things like forge chunkloading config + 70670f2f: Fix build eclipse extractor task + b9fa3fc9: Add in storage, detection and validation of the ItemID array between client and server + 5e5d8206: Fixing id map generation - should validate correctly now + f9fc06a8: Remade python dist as 32-bit. + 93d47a1c: Reenabled replacement of the eclipse folder. + +Build 1.4.5-6.4.1.435: + LexManos: And finally, fix up the release install script to have a parameter to specity the MCP directory. + +Build 1.4.5-6.4.1.434: + LexManos: Fix Forge install script to use python shipped with FML. + +Build 1.4.5-6.4.1.433: + LexManos: Push didn't get all of eclipse.... + +Build 1.4.5-6.4.1.432: + LexManos: + Cleaned up eclipse workspace and moved it to a zip file. + Setup will extract it if it doesn't already exist. + +Build 430: + Christian: Fix release script for new forge job name. Add in skip changelog option for local builds + +Build 1.4.5-6.4.1.426: + LexManos: Remove MCP from released src distro.. whops. + +Build 1.4.5-6.4.1.425: + Christian: + Fix static method, closes #271 + Don't spam the log if a mod requests a ticket beyond their maximum. A single message is fine. + +Build 1.4.5-6.4.1.424: + GuntherDW: Fix typo in chunkmanager config + Christian: fix List configs + Christian: Add Chunk Watch and UnWatch events. + +Build 1.4.5-6.4.1.414: + Christian: + Tweak release.py script: HEAD==master in general + + Update FML: 26a2ef5 + 26a2ef5 Add a modid on the mods list, should make it easier to do things like fo + b4e3490 Fix build eclipse extractor task + 828341f Fix typo + 7a8dae5 Try and make branch non-derpy + d3c0e1f Try defaulting branch differently + 9c77d3f Remove old eclipse workspace and ship/extract as a zip file (use ant set + 6371e9b Assume Forge is the parent directory when checking for AT configs. + 516954e Name both zips the same format + 1151d5c Last part of branch name only please + 25f1dda Try and get a valid branch name on jenkins + 39a146f Clean up build.xml script- support outputting a branched jar file + 037dcae Small derp in install.py + 01d6da3 Try marking python as binary. + 8b26659 FML will now attempt to download MCP as part of the install process Now + 42b3e6a Windows Python distrabution created using py2exe, thanks Fesh0r for the + e709ab8 Marked more spots in gui/items bitmask as being free. + +Build 1.4.5-6.4.1.413: + LexManos: Add wget and unzip from GnuWin32 for use in the setup scripts. + LexManos: Update FML, now includes python, and will download MCP for you + LexManos: Update python files to add support for specifying MCP directory and FML downloading MCP on the fly. + LexManos: Fix issue with DimensionManager.shouldLoadSpawn + +Build 1.4.5-6.4.1.411: + Christian: Fix #289 + +Build 1.4.5-6.4.1.410: + Christian: + Add in some additional ticket loading callbacks for ChickenBones. Closes #284 + Add in a call to determine if there are possible chunktickets for a world. This should let + Mystcraft and other dynamic world generating mods check if they should immediately load + a world based on existing chunk tickets. + +Build 1.4.5-6.4.1.409: + LexManos: Fix issue where non-BlockContainer TEs would not be removed properly. + +Build 1.4.5-6.4.1.408: + LexManos: Fix logic issue in ForgeChunkManager.ticketCountAvaliableFor(username) PR + LexManos: Fix issue where worlds were potentially unloaded improperly on server shutdown. + +Build 1.4.5-6.4.1.407: + LexManos: Small change to fix loading configs. + +Build 1.4.5-6.4.1.406: + LexManos: Added section of the EntityData NBT that will be persisted for players across respawning. + +Build 1.4.5-6.4.1.405: + LexManos: Exposed some ChunkLoader information for PR #278 + LexManos: Fix potential NPE in EntityJoin handler and print warning. + +Build 1.4.5-6.4.1.404: + LexManos: Small tweak to config to use Treemap + +Build 1.4.5-6.4.1.403: + xcompwiz: + Adds a more intelligent chunk constructor + + Adds a chunk constructor with full block id range, that's metadata + sensitive, has intelligent coord ordering, and which allows for + generation at greater heights than 127. + xcompwiz: Fixes some weird formatting + zach: + Fixes ordering for z & x loops (proper array increment order) + + The ordering before would skip about in the ids and metadata arrays. This runs linearly and should improve performance. + Done live on github + +Build 1.4.5-6.4.1.402: + LexManos: Fixed AIOOB issue with new sanity check in getBlock + +Build 1.4.5-6.4.1.401: + LexManos: Fix potential NPE in saving a property that didn't define a type. + +Build 1.4.5-6.4.1.400: + LexManos: + Added new functions to the Config class to allow for specification of comments when getting properties. + Added new getTerrainBlock whihc will limit the resuling ID to < 256, useful for world gen. + Calls to getBlock with IDs less then 256 will be assigned values above 256 {Thus freeing up terrain gen slots} + Made ConfigCategory implement Map should fix compatibility with most mods that broke two builds ago. + +Build 1.4.5-6.4.0.399: + xhamolk.class11: + OreDictionary addition: getOreID(ItemStack) + + Allow getting the oreID from a ItemStack, as an alternative from getOreID(String). + + Now is easier to exchange items for their equivalencies through the OreDictionary. + +Build 1.4.5-6.4.0.398: + LexManos: New nested configuration category support, for PR #258 + +Build 1.4.5-6.4.0.397: + LexManos: Fixed issue with abandoned chunks. + LexManos: Fixed random chest items not generating to there max stack sizes. + +Build 1.4.5-6.4.0.396: + ohai.iChun: + Add check that Entity saves to disk before saving entity to saved chunkloading data. + + Returning false to addEntityID prevents the entity from being saved (cred to LexManos) + Entities which do not save to disk but are chunkloaders causes errors the next time the world loads. This ought to fix it. + +Build 1.4.5-6.4.0.395: + LexManos: Updated FML, proper free-sprite list for /gui/items.png, and fixed MCP version. + +Build 1.4.5-6.4.0.394: + Christian: + Move server specific patch back to common from minecraft. + + Update FML: 1f5c58b + 1f5c58b Fix up MCP version + 61e4db2 Merge joined.exc add update howto + 5efc1eb Revert "Fix MC-2497 - derpy torch flames. Moved from forge. Everyone sho + 3b3600d Modified merger to just consider all server classes as common. And moved + edcc5ca Forgot mcp.cfg + ca79dfe Updated to 1.4.5b + 5945279 Fix python error + 57bf643 Modified decompile so that we do not have to decompile the server, saves + d9d0a46 Cleaned up some tabs + 2fac644 Change usage of ZipFile, fixes issues with Mac's default instation of py + +Build 1.4.5-6.4.0.393: + LexManos: Fix TE Issue + +Build 1.4.5-6.4.0.390: + LexManos: Removed GnuWin32 programs, should no longer be needed as we've moved to python. + LexManos: Updated to MC 1.4.5b + +Build 1.4.5-6.4.0.388: + Christian: Stupid eclipse resetting preferences. Spaces, not tabs!!! + Christian: + Update FML: 570592b + 570592b Attempt to fix a possible comodification risk + +Build 1.4.5-6.4.0.387: + Christian: Add in events when forcing and unforcing chunks. Hope this works for you ChickenBones! + +Build 1.4.5-6.4.0.386: + Christian: + Update FML: fde9414 + fde9414 Change texturebinding to use the textureId directly rather than iconInde + +Build 1.4.5-6.4.0.385: + LexManos: Fixed issue with default implementation of Beach plant type check + LexManos: Fixed custom soil checks for NetherStalk and Reeds + +Build 1.4.5-6.4.0.384: + LexManos: Release script will now include the Minecraft version in the arcive names. + +Build 6.4.0.383: + Christian: + Update FML: f348496 + f348496 Fix mod display list. Shouldn't be derpy anymore. + a5c31b5 Fix World patch- workaround no longer required and leftovers are bad. + 2dc3f0d Cleaned up the AT config updater, should work for any setup of the MCP w + +Build 6.4.0.382: + LexManos: Fixed beds not working properly when respawning. + +Build 6.4.0.381: + Christian: + Remove EntityFX patch - moved to FML. Patch SuspiciousClasses to add "forge" + + Update FML: fa56701 + fa56701 Fix MC-2497 - derpy torch flames. Moved from forge. Everyone should benefit. + 96935bb Fix an NPE in TileEntity trying to generate a crash report. Make suspicious classes just return the obvious. Fix NPE for FML crash report on server. Clean up dead pa + +Build 6.4.0.380: + Christian: Fix the derpy torch flames properly. Closes MC-2497 properly ;) + +Build 6.4.0.379: + Christian: + Update to MC 1.4.5 + Update FML: 43d3042 + 43d3042 Clean up a patch + fec221f Update FML for MC 1.4.5 + b0f0635 Fix for ModLoader static overrides not displaying. + 23a2513 Fix up derpy file name handling: closes #127 Fix up duping childmods: cl + a6eaa2b Fix spelling issue. + c6a0741 FML setup should now download and verify all the minecraft files needed + 5a1930e Small fix to some MCP metadata for pre2 + 418deba Update to MC 1.4.4 + 4ff2cff Fix bug when a modloader mod is run on a dedicated server and has a conn + +Build 6.3.0.378: + Christian: + Some liquid events. Non-API breaking. Add them at your leisure. This helps liquids know + what's happening to them. In case they're volatile or something ;) + +Build 6.3.0.377: + Christian: Another difference + +Build 6.3.0.376: + Christian: + Fix fillLiquidContainer - return null, not the empty container for + previous API compatibility + +Build 6.3.0.375: + LexManos: Update FML to fix ModLoader/addOverride functionality. + +Build 6.3.0.374: + kinglemming: + Fixed oversights in liquid registry, added functionality for instant checks as requested by CJ. + Liquid list return is now secure. + + Signed-off-by: King Lemming + Christian: Change name to LiquidContainerRegistry. Fix up missing API. This better be it now! + +Build 6.3.0.373: + kinglemming: + Liquid Manager Rewrite - slightly more memory usage, loads more efficient at runtime. + Added default Lava and Water registrations to Liquid Manager. + Removed method which relied on flawed assumption that a given liquid only had a single type of container. + + Signed-off-by: King Lemming + Christian: Rename some liquid stuff for more sensible naming. Tweak API slightly. + +Build 6.3.0.372: + Christian: + Add in the basic IBlockLiquid interface. The actual block implementation + will follow. + +Build 6.3.0.371: + Christian: + Add an ItemStack sensitive version of getIconForRenderPass, defers to + existing by default. Should allow NBT data to affect multipass icon rendering. + +Build 6.3.0.370: + Christian: Change getLeft to getRotation, around any axis. + +Build 6.3.0.369: + Christian: Some new stuff on the liquid API for better RP2 interaction. Coming soon: blocks! + +Build 6.3.0.367: + Christian: Tweak liquidcontainer API for sidedness capability + +Build 6.3.0.366: + LexManos: Updated FML, Fixed spelling issues in logs, and file name issues. + LexManos: Added saplings and leaves to the ore dict. PR: #242 + LexManos: Mods can use custom textures for Slot background overlay, instead of only items.png PR #245 and #246 + LexManos: Fix issue where players would spawn in the ground. + LexManos: Allow for modders to decide whether or not players are positioned on ridingEntities similarly to pigs PR #244 + LexManos: Fix breaking despite cancel in creative mode for PlayerInteractEvent OR #247 + +Build 6.3.0.364: + Christian: + As agreed, liquid API from BuildCraft has been migrated to minecraft forge. There will be cleanups to follow, + including sided handling and client rendering tweaks. Stay tuned! + Tweak forgedirection for a couple of naming constants + +Build 6.3.0.363: + Christian: Add toLeft rotational data to ForgeDirection + +Build 6.3.0.362: + LexManos: New field in ForgeDirection to hold just the valid directions. And made getOrientation a bit more efficient. + +Build 6.3.0.361: + LexManos: Fix entity items rendering on the ground. + LexManos: Fix crops not droping seeds properly. + +Build 6.3.0.360: + LexManos: Update to 1.4.4 + LexManos: Bumped version number for 1.4.4 + +Build 6.2.1.358: + LexManos: Ore Dictionary Improvements, replaces vanilla recipes with OreDict recipes for some vanilla items. Thanks Covert. + +Build 6.2.1.357: + LexManos: Made Item constructor public, and made setTextureFile chainable, requires mods to recompile, but as this is for 1.4.3 i'm not concerned. + +Build 6.2.1.356: + Christian: + Temporary update for 1.4.3 + Update FML: bd2123c + bd2123c Clean up some patch fuzz + c2a603c Update joined.exc file from latest conf + db12af4 Update to 1.4.3 + LexManos: + Readdaed teleporter sensitive versions of the teleport function + Added per-world list of custom teleporters, Modders, use World.Load to populate this list. + Changed the definition of our version schemes. + +Build 6.0.1.355: + Christian: + Update FML: 8356fe9 + 8356fe9 FUUUUUU! Stupid ticking. STOP REGISTERING TICK HANDLERS IN YOUR CONSTRUC + 6edce8b Patch a file handle leak in RegionFileCache handling when under memory p + ca2bbe0 Update MCP mapings again, yay bad syncs. + c8941a7 Updated MCP mapings. + 5e20c03 StartServer is now useable in merged code base. + +Build 6.0.1.354: + LexManos: Update FML: Updated MCP mapings, and fixed StartServer + +Build 6.0.1.353: + Christian: + Update FML: b19e882 + b19e882 Remove some debug, closes #123 + 9d7d32a Fix up tick management outside of mod loading phases for ModLoader mods. + d512539 Negatively cache failed class lookups, should help with @SideOnly performance issues. + +Build 6.0.1.351: + Christian: + This update fixes some world corrupting vanilla error handling, mostly caused by + mods doing something derpy. Hopefully, your world saves will thank me. + Note that if the mod does derp, it's data is lost. It's not FML or Minecraft Forge's + responsibility if "DirtChest 2000 Mk5" can't write their TileEntity method correctly + and you lose your 100000 diamonds. + + Update FML: a3a93f3 + a3a93f3 Fix some whitespace issues, handle possibly bugged entities as well + a7eb5dc Vanilla/mod bug fixes: CME on entity processing, TileEntity resetting chunk on save/load. + +Build 6.0.1.350: + LexManos: Fix cast issue when mods attempt to make fake worlds. + LexManos: Fix a vanilla bug related to certian seeds and stronholds. + LexManos: Cleanup some debug in the script, and fix version number for the current build. + +Build 6.0.1.349: + LexManos: Change logs should now be bundled with downloads, as well as avalible on files.minecraftforge.net + +Build 6.0.1.348: + Christian: + Update FML:b23081d + b23081d Support for ModLoader 1.4.2. Good job Risu! + 66db4ec Add in an exclusion list tag for @Mod. The backend code isn't yet implemented, but shows the basic idea. + +Build 6.0.1.345: + LexManos: EntityLiving.experianceValue private->public for Issue #225 + LexManos: Changeable name tag render distance for PR: 174 + LexManos: Remove some debug code + LexManos: New hook to allow items to be on multiple creative tabs PR 176 + LexManos: Fix issue where scroll bar would not render when switching tab pages. + LexManos: Added metadata sensitve experience to furnace recipies and added Item callback to determine experience gain. + LexManos: Exposed functions for adding superflat presets. + LexManos: New hook to allow for custom beacon support blocks. + CovertJaguar: + Added vanilla wood + dye to the Ore Dict + + Should help simplify interaction between mods that add similar items. + LexManos: Added Stonghold, Village, and Spawn biome management helpers for PR 207 + LexManos: Fix compile issue. + +Build 6.0.1.343: + csendek: Add event to cancel or change chat messages sent from server + csendek: Add event to cancel or change chat messages sent from server + +Build 6.0.1.342: + LexManos: Pickblock will new compare NBT data, should allow mods to refine there result better. + LexManos: Added system to place all configs that use Forge's Configuration function into a single file on disc. Optional config to enable this. Blame MattaBase for this idea.. + +Build 6.0.1.341: + LexManos: Fix ItemSeed placement to take into account the IPlantable interface. + +Build 6.0.1.339: + LexManos: Added a per-world MapStorage feature that provides a method to store data files associated with a specific world, as well as fixes the issue with villagers loosing there village. {Where villagers wouldn't go inside at night} + +Build 6.0.1.338: + pahimar: Update patches/common/net/minecraft/src/SlotCrafting.java.patch + Christian: + Fix the accessor and type on World.getPersistentChunksFor() + Update FML: 8bd98c3 + 8bd98c3 Fix a small problem with the new MCP container- it can cause NPEs. Nice. + 34cc42d Fix up some javadoc complaints + +Build 6.0.1.337: + Christian: + MCP information is now included in Minecraft Forge. They deserve the credit :) + + Update FML: 09eade4 + 09eade4 Update build - include MCP information in the source pack + 9bfe7df MCP deserves lots of credit. So here it is. + +Build 6.0.1.332: + Christian: + Update FML: 8006b77 + 8006b77 Fix instantiation bug + 7cc91cf Simple InterMod comms. Send a message using FMLInterModComms.sendMessage(). Receive messages through an @IMCCallback + 24d7285 Update for MC 1.4.2 + cedf3d5 Duplicate Mod display screen. + +Build 6.0.1.331: + LexManos: Downgrade to FML 415, issue with new IMC system. + +Build 6.0.1.330: + LexManos: Update to 1.4.2, obf stayed the same, so only small revision. + +Build 6.0.0.329: + LexManos: Update World patch to fix map provider issue. + +Build 6.0.0.328: + Christian: + Add an access transform for Block.setBlockBounds - should help a lot of code that uses this. + + Update FML: d915f39 + d915f39 Fix typo in access transformer + 346691c Fix the merge for forge + 6dadc1d Fix up references to minecraftDir in obf code + 8a55f68 Update FML for Minecraft 1.4.1 + 5645fa5 First update to 1.4.1, patches need updating. + ff0f00f Add some null checks, and throw descriptive exception when SideTransformer prevents a class from loading. + +Build 6.0.0.327: + LexManos: Update to MC 1.4.1 and Forge 6.0.0 + +Build 5.0.0.326: + LexManos: Fix color issues with Dyed Leather armor. + +Build 5.0.0.325: + LexManos: Remove deprecated code. + LexManos: Cleanup mirrored things in ShapedOreRecipe to address issue 208 and issue 210 + LexManos: Fix up the setHandeled/setHandled for events, it is now a generalized setResult, the meaning of which is defined by each event. + +Build 5.0.0.324: + LexManos: Fix NPE issue when mods add null EntityFX's to be rendererd. + +Build 5.0.0.323: + Christian: + Update FML: 7a34246 + 7a34246 Ship a client only class so the merge works both sides. + +Build 5.0.0.322: + Christian: Fix install.py so it can be installed properly from src distribution + +Build 5.0.0.321: + Christian: + Update FML (entire change log since last by me): 62a6b52 + 62a6b52 Fix RenderRegistry render ID - now at 36 Fix SpriteMaps - they're running out fast! Switch to forge if you can! RenderBiped now has an armo + b845cde Fix up FML python script for forge + 2c36dfb Update to MCP pre 3. Fixes some weirdnesses with explosions. + acd880d Merge branch '1.4' + e6f57e5 Update for MCP release + b1de0fc Remove fuzz from patches for INetworkManager change + ad44619 Fix for new names INetworkManager and ITexturePack. I also provide refactoring scripts for both, for your use... + 3a94211 Add a script to ignore git complaining about the eclipse workspace changing - run when you first open the eclipse workspace + 9386e23 Update gitignore - ignore the files that will change or be deleted + 10b318c Add in "starter" image for eclipse workspace + 995d5b7 Eclipse workspace fixup 2? + bbb12c8 Clean up eclipse workspace- part 1 + b50058e Clean up a bit of patch fuzz + 4a0bfa9 Fix CommonHandler for rename of the server thread class + 4d1ec66 Update with RC2 MCP. Use the joined.exc file directly since MCP now provides it. + b52e3d0 Fix exception for CodecMus + a1011c9 Fix some compilation issues. Requires resolving the worldclient abstract method + 0ebd4f3 Inital patch update to 1.4 + 89c68c4 Moved into EntityVillager + e4702cb Fix line ending detection during checkout. + 6e64fd7 We don't need logging here... + 014b3f4 remove useless -Server projects + 7628c67 Updated the AT config and Marker config for 1.4 obf + 54a322c Updae build to copy files that may decompile differently but are actually the same, and updated for 1.4 values. + aadf396 Update MCP Merge config. + 81e1855 Pull in MCP's 1.4 conf files. + 5686fd4 Fix error in merging of exec's + +Build 5.0.0.320: + LexManos: FML Update for 1.4 + LexManos: Fix recompile call for 1.4 MCP change + LexManos: Update Forge's AT for 1.4 names. + LexManos: Update for new names in 1.4 + LexManos: Remove final from 'villageCollectionObj' to allow for delayed setup of Map source objects. + LexManos: Moved to common where it should be + LexManos: No longer needed, getRenderDistance removed because Vanilla has it now, TileEntity.func_82115_m + LexManos: Forge spawn protection removed, now a vanilla feature. + LexManos: Patches that applied with little to no functional changes. + LexManos: Updated Render patches, Bipeds now have the ability to have helmets, of either blocks, or the new 'heads' + LexManos: BlockSnow now pretty much just passes harvestBlock to it's super. + LexManos: Entities have a new function to determine explosion strength that they create, and implemented Item frame pickblock. + LexManos: Patches removing forge spawn protection, now a vanilla feature. + LexManos: BlockCrops is now the parent class of multiple types of crops, Wheat, Potatoes, and Carrots, updated getBlockDropped patch to reflect. + LexManos: Removed Forge's TileEntity.getRenderDistance, now a vanilla feature: TileEntity.func_82115_m + LexManos: Teleporting has a new function (func_82448_a), made it so that you can supply your own teleporter to that function, and so it works with dimension movement factors. + LexManos: Updated World patch, there are a lot of new things happening int he constructor, xcomp should probably vet this. + LexManos: Updated Forge version to 5.0.0, for 1.4 + LexManos: Update release script for mcp changes, releases now build. + +Build 4.3.5.318: + LexManos: Remove some test code. + LexManos: Bump version to 4.3, final for 1.3.2 + +Build 4.2.5.317: + LexManos: Added ability for mods to cleanly define and display new creative tabs. + +Build 4.2.5.316: + Christian: Fix classloading issue preventing JRockit from running forge + +Build 4.2.5.315: + Christian: + Forge build change: the universal jar, if installed alongside a server jar file, can be executed to load forge. No server side merging required! + Update FML: 989ab3e + 989ab3e Update build.xml - add a classpath to the manifest. This means the universal jar is now a server side launche + 88f1dc9 Typos! + +Build 4.2.5.314: + Christian: + Update FML: 470a185 + 470a185 Try and avoid an NPE in crash reports + 0029518 Fix logging problems- log death messages and re-route the server through FML logs properly. + fe7a832 Fix the test mod + a2bc30b Coremods can be specified via the command line: fml.coreMod.load= This will help with developing coremods + bae1f74 Fix classpath for server + 887aa27 Add in the ability for a client to throw a custom exception that displays a custom gui instead of the default error message. + e17f267 Update FML internal classpath. Helpful for coremod devs + 3b9972a Don't use File to separate the last element of the path. It's a URL, they're always separated by '/' + 5c96afe Changed RelauchLibraryManager so that files with different paths on the same baseURL can be implemented in one ILibrarySet. + 1bca393 FML as a whole is now subject to transformers. + 27cf731 Bonus extra character. thanks randomitter! + 94c84cd Merge pull request #116 from Vazkii/patch-1 + c2d3195 Add Null check to FMLClientHandler.sendPacket + +Build 4.2.5.313: + LexManos: Make Item.createEntity only call when its specifically a EntityItem, not a subclass of it. + +Build 4.2.5.312: + LexManos: New Block hook to determine if it can be destroied by the ender dragon, for PR 199 + LexManos: Ship forgeversion.properties with release zips. Same format as fmlversion.properties. + LexManos: Dll files are binary as well. + +Build 4.2.5.311: + LexManos: Fill out the .gitattributes to help with line endings how they should be. + LexManos: Change the Crafting damage check to be the same as the usage damage check. (>= -> >) + LexManos: Allow hook into GuiSlot for background rendering for PR #203 + +Build 4.2.5.310: + Christian: Reorganize the forced chunks a bit- offload the cost of immutable map building to the mods, rather than the chunk tick + +Build 4.2.5.307: + Christian: Remove @SideOnly from removePotionEffect. Hi RichardG! + +Build 4.2.5.306: + LexManos: Add some accessors to teh ChunkLoader tickets. + +Build 4.2.5.305: + ohai.iChun: Fix not passing right render pass to Item class. + +Build 4.2.5.303: + Christian: Fix bounds checking on chunkcache. Should fix a bunch of rp2 and maybe other extended tile entity code + +Build 4.2.5.302: + Christian: + Use weak references to the worlds in our maps. WorldClient would otherwise + leak all over the show. + +Build 4.2.5.299: + mehvids: Add some of the model subsystem to the server. The part that doesn't require openGL. This allows for systems that dual models as collision/selection boxes etc. + xcompwiz: + Improves DimensionManager + + Adds handling for unloading and hotloading of worlds, fixes some typos, + allows for dimensions to be unregistered (allowing save specific + dimension registrations), general changes to match these features. + xcompwiz: + Adds world unloading and hotloading calls + + Adds world unloaded message to MinecraftServer on save. + Adds world unloading calls to chunk provider/manager when all chunks are + unloaded. + Adds call in MinecraftServer getWorld to hotload world if it isn't + loaded. + xcompwiz: + MapStorage Fix + + Fixes setting and timing of map storage object to allow for the + WorldProvider to use it during initialization + Forces single instance of map storage object (per side) + Moves setting of spawn to after provider setup + xcompwiz: + Lighting Time fix + + score_under's lighting fix that limits and fairly distributes the amount + of time spent on recalculating lighting + xcompwiz: + Server player concurrency fix + + Fixes an issue where the server can move a player while the player is + moving, process the player's last move (putting the player back where + they were before the teleport), and then complain about the player + moving too fast when the client catches up to it's new position. Also + fixes this issue while riding an entity. Only affects player + client/server movement sync. + Christian: + Remove dead WorldInfo patch. Tweak dimension code a bit for better naming, and use the new FML world loading facilities + Update FML: d0e7c9e + d0e7c9e Update patches *sigh* + f3e1cac Add in a savehandler strategy for reading and writing data to the world save. This service is only available to coremods via the WorldAccessConta + 51fb513 Add in some bukkit supporting code. Most of this is unimplemented until the bukkit coremod is complete. + 65c9fdd New stuff on the ModLoader! Risu has been busy. Closes #114 + c1d4458 Mods can now declare a range of minecraft versions they will run against + Christian: Update forge to 4.2 + +Build 4.1.4.298: + LexManos: Fix issue where light would not properly recalculate. + LexManos: Fix issue where mushrooms would not check the proper soil block. + +Build 4.1.4.297: + LexManos: Expanded DungeonHooks to allow for adding of custom DungeonLoot values directly, allowing for better control over the generated items. + +Build 4.1.4.296: + LexManos: Made PlayerEvent.BreakSpeed fire when a player cannot harvest the block. Issues #191 and #188 + +Build 4.1.4.295: + Christian: Dormant chunk cache might actually work now, and not mix chunks across worlds + Christian: + Update FML: ca1ca4f + ca1ca4f Fix maps supporting greater than byte() dimension sizing + 15ee8bf Fix language registry additions, closes #113 + a08b5b1 Merge pull request #112 from pahimar/master + 8dac58f Added ability to query the Language Registry by key and language for specific localized text, as well as loading in localization text f + +Build 4.1.4.294: + LexManos: Fix buckets, need to rethink for bukkit compatibility. + LexManos: Fix vanilla bug where the player would load chunks outside its range that would be 'abandoned' and never unloaded. + LexManos: Forgot comment, you see nothing... + +Build 4.1.4.292: + Christian: + A few requested features of ForgeChunkManager. Mods can specify a + chunkloading config directly in the config file, including chunk + loading overrides if they wish (and the config allows them). + Also added "player" tied tickets that bind to the player and not the + mod's quota. + +Build 4.1.4.291: + LexManos: Missing updates from last commit + LexManos: Location aware version og Block.lightOpacity for PR #169 + +Build 4.1.4.290: + LexManos: Fix bug in last commit that caused block to not break. + LexManos: Added preliminarty Player Interact event heavily based on the bukkit event. + +Build 4.1.4.289: + LexManos: Add PlayerEvent.HarvestCheck and PlayerEvent.BreakSpeed for dealing with things related to a player harvesting a block. + +Build 4.1.4.288: + LexManos: Fix bug where breaking texture would not apply to top/bottom of beds. + +Build 4.1.4.287: + Christian: Add in an "EntityEvent.EnteringChunk" event. Useful for your entity chunkloading stuff. + +Build 4.1.4.286: + LexManos: Support for no BOM. + +Build 4.1.4.285: + Christian: + Update FML: f083707 + f083707 Extreme headless mode is back! + +Build 4.1.4.284: + Christian: + Update FML: dd39ae5 + dd7502a Fix parent child counts showing properly. Closes #107 thanks scott! + b36d447 It's useMetadata, not usesMetadata. thanks myrathi and psx. closes #110 + efb1066 Fix random shuffling when manipulating biomes by using a LinkedHashSet to preserve iteration order. Closes #111 + Christian: + Some more tweaks to the chunkloading code. The world.load event fires slightly later- once the entity watcher is + set up, so entities can actually load into the server world. Also, tickets actually save and load properly + and null entities don't break the server + +Build 4.1.4.282: + LexManos: > != >= + +Build 4.1.4.281: + LexManos: Fix Configuration.getItem to return pre-shifted values suitible to pass into Item constructors. + +Build 4.1.4.280: + LexManos: Fire off PlayerDestroyItemEvent for crafting contianer items that get damaged to much. PR #183 + +Build 4.1.4.279: + LexManos: Configuration will now attempt to detect the encoding of the file using the Byte Order Mark. + LexManos: + Changed Configuration to use overloaded methods, and changed the order of arguments to be Category, Key, Value instead of Key, Category, Value to hopefully help cleanup some peopels code. + Added function to get a free Item id. Will only accept values that are not in the block space. Needs testing. + Marked all the old getOrCreate* functions as deprecated. + +Build 4.1.4.278: + Christian: Fix some errors if the config is unparseable. It should log an exception and carry on with defaults. + Christian: Support quoting in property and category names for almost all possible characters allowed + Christian: Fix up some config file handling to be even more resilient. + +Build 4.1.4.277: + Christian: + More modifications to the ticket callback handling system. There are up to two callbacks during world loading now. One to allow + selective preference for ticket types. The other to actually allow the mod to force chunks. + +Build 4.1.4.276: + Christian: + Update FML: dd39ae5 + dd39ae5 Try and fix the newline capture so consoles show on the server on windows again + b39f808 Readd ancient searge name so dan200 and computercraft can run again. REMOVE THAT CODE DAN. + Christian: + Some changes to the ForgeChunkManager. + Null modData is allowed now. + The entity id is actually properly persisted in the ticket now. + There is a new "orderedLoadingCallback" that allows you to provide a preferred ticket loading order in case of "excess tickets". Also, tickets + that are not in the returned list are now unregistered. + There is a way to resort the chunks in the forced chunklist on a ticket now. + Log the dormant cache configuration + +Build 4.1.4.275: + Christian: Simple chunkloading implementation + Christian: Working cross dimensional implementation of chunkloading for Forge. + Christian: + A lot of tweaks to the chunkloading for entity behaviour. Entities are now bound by a new + persistent id they *all* have, on the server side. + Christian: Remove @SideOnly flag for function now required on the server + Christian: Fix NPE in ForgeChunkManager + Christian: And a concurrentmodificationexception in the same code + Christian: + Simple chunk caching capability for the chunkloader. This will store "dormant" chunks in a + configurable cache, potentially saving the cost of reloading them from disk. + Christian: Delete some debug code + Christian: Some more fixes for chunkloading code. Works very reliably now. + Christian: + Update FML: a2c059e + a2c059e Fix missing import. Thanks ichun :( + 19316a0 Version file searching should work for directories too + fbc7a5c Fix bug causing NPE if non-whitelisted player joins an FML server without FML installed + e9cfd10 Merge pull request #103 from iChun/patch-2 + 1424883 Fixed ModTextureAnimation not updating and not binding to correct image. + +Build 4.1.4.274: + mitchpetrie29: + Update patches/common/net/minecraft/src/WorldProvider.java.patch + + Fixed WorldProvider.setDimension() setting the wrong variable. + LexManos: Fix patch errors in merge of last PR -.- + +Build 4.1.4.272: + LexManos: Fix accedental doubling of shift, Fixes saplings/flowers planting a space above where they should + +Build 4.1.4.271: + LexManos: New Plant API that allows for custom plants/soils. + +Build 4.1.3.270: + LexManos: Added new hooks for modifying the items generated in chests during world gen. + +Build 4.1.2.269: + LexManos: Redirect a lot of functions through WorldProvider for Mystcraft, allowing them to be overriden by the provider. + +Build 4.1.2.268: + CovertJaguar: Fixed Entity Item render helper + +Build 4.1.2.267: + ohai.iChun: Fix pick block key giving invalid spawn eggs + ohai.iChun: Logic derped + ohai.iChun: Logic derp (again) + +Build 4.1.2.266: + LexManos: Added side sensitivity to standard EntityDiggingFX, added Block functions to override spawning of digging and breaking effects. + +Build 4.1.2.265: + LexManos: Fix potential NPE in Custom item entity span code caused by item id misconfigurations. + +Build 4.1.2.264: + LexManos: Fix recursion issue with new special item entity code. + +Build 4.1.2.263: + Christian: + Update FML: 6c746ec + 6c746ec Tidy code + aacbfeb Change version.properties search slightly, allow access to found file from the preinit event + 1513b36 Add in the capability to read an internal version as .version from a file in the zip call versi + 35852a6 Fix up reversed assignment for version fallback + +Build 4.1.2.261: + pahimar: Changes to how PotionEffects are removed, now each PotionEffect can specify which ItemStacks can remove it's effect + pahimar: Inverted logic derp + +Build 4.1.2.260: + LexManos: Package all of paulscode/ with the universal jar to help mac users who cant understand how to merge folders -.- + +Build 4.1.2.259: + LexManos: Bump version to 4.1.2 to mark the end of todays changes. + +Build 4.1.1.258: + LexManos: Fix potential issue with custom events where the constructor is not visible from the EventBus class, Should never arise but meh. + LexManos: Read/Write config files as UTF-8 instead of ANSII, should fix issue with Turkish people. + LexManos: Allow for respawning in different dimensions. + LexManos: Move spawn fuzz to WorldProvider/WorldType, useful for VoidWorld types. + +Build 4.1.1.257: + LexManos: Make EntityJoinWorldEvent Cancelable properly + LexManos: Move Forge init message to MinecraftForge.initalize + LexManos: Add ability for Items to create custom Entities for themselves when added to the world, PR: #151 + +Build 4.1.1.256: + admin: Allow flight,player sensitive + +Build 4.1.1.255: + LexManos: Fix a few patch fuzzes + LexManos: Implemented isBlockFoliage for pull #141 + +Build 4.1.1.254: + LexManos: Clean up some javadoc warnings. + LexManos: + New EntityItem related events + Fixed player death event in SMP + Added Player specific drops event + Added generic EntityJoinWorldEvent + +Build 4.1.1.253: + LexManos: Fix FillBucketEvent to work with stacked buckets. New change in 1.3 + LexManos: EntityLiving variation of drawBlockDamageTexture to allow for Non-player viewports. + +Build 4.1.1.252: + Christian: Remove all references to ModLoader + Christian: + Update FML: 89b8236 + 89b8236 Fix onConnectionClosed not being called on the client side of a connection + +Build 4.1.1.251: + LexManos: Bump version to 4.1.1 + +Build 4.0.0.250: + Christian: + Update FML: 290a3c9 + 290a3c9 Merge pull request #94 from iChun/patch-1 + 9485dc5 Fix handleTinyPacket using short instead of int. + Christian: + Update FML: 70f55c5 + 70f55c5 Add in exclusion list for IFMLLoadingPlugin. + 1c1716d Remove debug cruft + d567f79 To properly align with packet9respawn, make packet1login's dimension an int as well + ecd4e46 Attempt to build some protocol negotiation, and fix packet1login so that the dimension is a short, matching packet9respawn + 16fe495 Compatibility level is now passed from server to client - and the client tracks it. This means certain packet changes can be made without b + 4f70d23 Fix dependency checking: you can depend on specific versions of FML + +Build 4.0.0.249: + Christian: + Update FML: e6abb69 + e6abb69 Fix up tiny packet handler to actually work + e862052 Allow javax to be shipped by mods. Should allow some more modloader mods to work unaltered + 4071ad1 Add in a little bit of protocol cleanup. Start work on allowing multiple protocol versions + 6061964 Give a way to build the packet131mapdata packet correctly populated + b818769 Capture and leverage Packet131MapData + +Build 4.0.0.248: + LexManos: Fix placing torches and the like on inverted woden slabs. + +Build 4.0.0.247: + Christian: + Update FML: 12bc4ba + 12bc4ba Make console logging pass through a single logging thread to avoid concurrency problems with launchers and stuff + 8fccfa2 Overlooked chat message support *sigh*. Fixes wierd mods that communicate through custom chat messages rather than + a697d04 Rescan mod packages where there was a possible mod identified to try and make sure we load it. Fixes Matmos r16 + +Build 4.0.0.246: + Christian: + Update FML: 9d812f1 + 9d812f1 And handle the other way to globally register an entity + 869cf78 Fix up mods trying to register entities outside of modloading. Now you'll get a big fat warning for doing such a de + 186680c Fix CJB mod compatibilty for real. Gui container registration can now happen in the constructor. YUK! + 5aed6d9 Fix compatibility with ModLoader dispenser hook. Fixes a bug with IDispenseHandler too - though it means that inter + 3d7a665 Fix headless operation, hopefully + +Build 4.0.0.245: + Christian: + Update FML: 10a7169 + + 10a7169 Fix up trying to re-add stuff to the classpath when it's already there + 0eb7180 Fix out of range entity id handling for ModLoader mods a bit more. Thanks Herobrine mod! + b1b4c61 Expose GuiMerchantButton + 359cfb5 Log a big fat warning for the developer in the case the network version is not acceptable to the mod itself. (This can happen because of a bad range specifier for example) + +Build 4.0.0.243: + Christian: + Update FML: 8656fd5 + 8656fd5 Also, make missing entity not blow things up + 25a4dcb Fix entity tracker "update" packet not computing correctly. Should work now.. + +Build 4.0.0.242: + Christian: + Update FML: c90a853 + c90a853 Fix up addRenderer to catch exceptions from the basemod, also, addrenderer now supplies a list of the default renderers from MC for editing and will note the + 18069d8 Change download location for FML libraries to files.minecraftforge.net, add an encoding param to the javac command line to force utf 8 + a40f4a7 Add in random jar/zip files to the classpath. UGH this is so fucking ugly it's not funny. + 5b6460b Use a null socket and try to prefer the result of getLocalHost in the broadcast data. + +Build 4.0.0.240: + Christian: + Update FML: c0d1348 + c0d1348 Add in an ItemRenderer null check so FML can run render adding mods + 482c163 Inverted boolean logic. Grrr. + 221d113 ModLoader mob spawns use packet 24- build a bypass system so that they can still use it + f19f426 Remove debug statements + +Build 4.0.0.239: + Christian: + Update FML: 9dd9b6e + 9dd9b6e Fix keybindings not loading properly from gamesettings file after restart + +Build 4.0.0.238: + LexManos: Fix silk touch on Ender Chests. + +Build 4.0.0.237: + t.tomkins: + Update patches/common/net/minecraft/src/NetServerHandler.java.patch + + Update patches/common/net/minecraft/src/NetServerHandler.java.patch + + Server mods can now use noClip to push players through solid blocks without is being an invalid move and resetting the players position. + + Useful for creating semi-solid blocks like quicksand. + +Build 4.0.0.236: + LexManos: Fix Issue #140: Custom items not properly having texture applied for partical effects. + +Build 4.0.0.235: + Christian: + Update FML: acb0b21 + acb0b21 Fix so we always send received packets to handlers. Renders 250 filtering useless unless i can figure a way to intercept + +Build 4.0.0.234: + Christian: + Update FML: b17dd3c + b17dd3c Some tests + fa66ffa Fix trying to load the client side packet handler, when on the server, hopefully? + b106420 Fix up network negotiation - now it will disconnect with a nice error screen if there are missing mods on the client vs se + +Build 4.0.0.233: + Christian: + Update FML: c971adb + c971adb Fix missing addCommand call: thanks "spawnwolf test command" + d6326de Fix a couple of modloader mods. Thanks! + 483667c Some functionality fixes for @Instance injection. + 8bef512 Versions now have two flavours: the @Mod(version) which is the "programmatic version" and is used for all version relationship calculatio + 501009c Always for ML mods into "public" class accessibility - we don't call from the default package like ML does. + d3d4308 Add in a convenience method for getting a class instance based on existence of another Mod. Useful for soft dependencies. + +Build 4.0.0.232: + Christian: + Update FML: 2d9b88b + 2d9b88b And more mod sorting fixes. + 93d5934 Actually *use* the sorted mod list + +Build 4.0.0.231: + LexManos: Fix FillBucketEvent to actually fire. + +Build 4.0.0.230: + LexManos: Fix call to createTileEntity on blocks that extend BlockContainer. + +Build 4.0.0.229: + Christian: + Update FML: 180a279 + 180a279 Merge pull request #82 from Chicken-Bones/master + cf38461 The access transformer will now handle classes in packages. + 2c85539 Reverse the meaning of state in fml.modStates system property and fmlModState.properties - it was very derpy before. Now: true is enabled, false is disabled, as you would expect + d651189 Actually fix the corrupt JSON problem + f6a8cd5 Fix isModLoaded for "disabled" mods, and the toposort as well + 3bde961 A bit more information for dependency handling + 6396bea Fix up handing corrupt mcmod.info + 6bc6def Fix a problem with network ids + 7328610 Fix up version handling properly. Hopefully, and the error screen. + 9fcc452 Only active mods should have dependencies checked, and be sorted + 26302a6 Fix oddity with Screen, print a version out in the sorted list! + +Build 4.0.0.228: + Christian: + Update FML: 62dbfb3 + 62dbfb3 Fix metadata + +Build 4.0.0.227: + Christian: + Update FML: b91cbe9 + b91cbe9 Fix up versioned dependencies so they work a lot better, also add in a missing mods screen + +Build 4.0.0.226: + Christian: + Update FML: 93b8ba9 + 93b8ba9 Fix missing serverSendPacket + 23fdbbd Trading support for ModLoader - thanks Herblore! + d7a74d8 Close the jar, for cleanliness sake + 58e6dd9 Fix authors - it'll read both "authors" and "authorList" from the json now + 907cf2d More ML compatibility - fix up dragon mounts, thanks! + ee48a36 Fix up loading mods that are grandchildren of BaseMod + c6f362b Fix entity handling for ModLoader mods, thanks parachute mod! + +Build 4.0.0.225: + LexManos: Fix lighting issue for air related to 4096 fix. + +Build 4.0.0.224: + LexManos: Made helper hooks for EntityLiving and EntityRenderer hooks for Optifine + LexManos: Removed deprecated ISpawnHandler, that never worked in 1.3.2 so noone should be using it. See FML's replacement. + +Build 4.0.0.223: + Christian: + Update FML: 6e01c59 + 6e01c59 Merge ChickenBones pull into FML - adds player trackers + a0cbd37 More precise error handling when an invalid class is present + 12323e2 Fix textures not applying properly + 789a4a3 Fix up entity spawning - hopefully they won't warp anymore. + a87d045 Add in a helper on the server start event for adding commands to the server. + 82e9309 Move villager trading hook up a bit. thanks sengir. + 8deaa37 Fix LAN to try hard to find a real network interface, not just localhost most of the time + b5363e3 Update build to not bother building client jar. Universal is everything now. + +Build 4.0.0.222: + LexManos: Pickblock now replaces the currently selected item if it could not find a empty space. + +Build 4.0.0.221: + dvrabel: + Use original minecart drag co-efficients for regular carts. + + Since the amount of speed lost is 1 - co-eff, rounding 0.997 to 0.99 + makes a big difference to the distance a minecart will travel (less + than half of the distance in vanilla 1.25). + +Build 4.0.0.220: + LexManos: + Update FML to 304: + Client side only classes are properly annotated, and denied loading on server side + Added missing client side only ModLoader.getContainerGUI function + Guis work for FML mods now. + Fixed MLProp handeling of null info + Fix up dispenser handling, add in new params for the dispenser: breaks IDispenseHandler, sorry + Christian: + Update FML: 28a10ac + 28a10ac Null protection for ticks() -- probably should uses EnumSet.noneOf() but you can also use null now to stop ticking. closes #77 + c349d51 Automatic mod entity registration into the global entity list. This might break entity code out there, sorry, but this way for most entities you no longer need to manage the global mod entity stuff at all. just remove it. FML will take care of the rest (note, worlds won't load the old entities) + ef01745 Add in a utility function that *might* tell you the context you're running in on either client or server: FMLCommonHandler.getEffectiveSide + c97d6a6 Try and stop sendPacketToAllAround from being crashy + 2062273 Mods can add mod specific crash information to the crash report now Forge needs to implement MinecraftForge.getCrashCallable + 6e6436e Fix up dispenser handling, add in new params for the dispenser: breaks IDispenseHandler, sorry + 38f4a22 Fix up MLProp handling for null info + 3a8b047 GUIs working in FML for ML mods + 52483ee Support gui opening for Shelf mod + dce1cbc Updated MCPMerger to annotate unique classes with there sides, and SideTransformer to null out any class that is loaded on the wrong side. + +Build 4.0.0.217: + LexManos: Updated onItemUseFirst call to include the new hit vector information, and updated readme. + +Build 4.0.0.216: + LexManos: Added missing server side onBlockStartBreak hook, fixes Sheers. + +Build 4.0.0.215: + LexManos: Fixed Forge's 4096 block filler initalization. + +Build 4.0.0.214: + LexManos: Fix IndexOutOfBounds exception, Major derp. + +Build 4.0.0.213: + Christian: + Update FML: 46c563a + + 46c563a Expose more of the village construction parts for building village piece + 1380c2e Allow access to the type "ComponentVillage" + 71a3818 Documentation and registration for villager stuff + e3a343c Fix javadoc derp + 195b1a0 Villager trading, manipulation and village enhancement. Still WIP but sh + 69e66c3 Fix exception based logging to actually log the exception! + +Build 4.0.0.212: + Christian: + Update FML: + 885637c Fix up keyboard events for modloader + 90a7c8f Pickup notification + +Build 4.0.0.211: + LexManos: Changed order in which EntityItemPickupEvent is called, it will no longer be called if the 'delay' on the item is still active. Also EntityItems that are in the world with invalid item stacks will now kill themselves. + +Build 4.0.0.210: + mitchel.pyl: Adds a SkyProvider class that can handle the rendering of the sky + +Build 4.0.0.209: + Christian: + Move and add a few AT for forge: rail and leaves stuff mostly + Update FML (reorg some AT for FML vs forge): + 2171c0c Update fml_at with new transforms + 924a6f9 Fix derp where client sided packet handler would be created on a dedi server env + ad4cffb Add in support for "dummy" keybindings- ones that are added to the list but never do anything so the mod can handle it all themselves. + cf77ffb Don't complain about minecraft source code being in "net.minecraft.src". Derp. + b2fdcd7 Fix ModLoader add XP Smelting + 094ce2a Actually register client/server packetspecs as their correct sides! fixes #71 + +Build 4.0.0.208: + LexManos: Fix MC packet bugs for remote servers that use blocks with ids > 256 + +Build 4.0.0.207: + LexManos: Fixed bug in EntityMinecart that would cause them to fall through the ground at the bottom of slopes. + +Build 4.0.0.206: + Christian: + Update FML: + + e8cb2c1 Error if channel name is invalid - either too short, or too long + 9c6c56c Add a connect and read timeout for downloading libraries. This should really stop the "waiting forever" at startup screen. + 0d5affe GIANT FAT WARNINGS if you use any code in net.minecraft.src or any subpackage thereof. Get it out of there, now! + 13f210f Fix up ML GUI ticking. Thanks sharose! + +Build 4.0.0.205: + LexManos: Fixed EntityEvent.CanUpdate + LexManos: Fix EntityItemPickupEvent 'pop' sound spamming. + LexManos: Added timeout to MC's download of sound resouces. + LexManos: Update WorldProvider.path diff. + +Build 4.0.0.204: + Christian: + Update fml: + c61ad51 Organize ALL the imports + c0842b0 Expose the server in serverstart event + 2851079 Fix up directory injection of log file locations + 5197524 Refer to FMLLog, not FMLRelaunchLog + 78efd1a Tidy up server launch - reflection not required anymore + eee0a99 Also, log what the directory discoverer finds for mcmod.info + 10c96c3 And log the exception if it has a problem reading the jar file + 07cc3fb Fix jar loader failing to inject any metadata at all if mcmod.info is not found. + e31f143 Change install.cmd to install.bat, why, cuz people are .... Updated readme to mention needing server and client. + +Build 4.0.0.200: + LexManos: Allow white space in the property name. + Christian: + Update FML to include some ML compatibility fixes. Minimap should run, assuming he + recompiles against standard ML interfaces. + This updates to official MCP 7.2, so you'll need to rebuild your workspace (some + small but important patches to MCP went in) + +Build 4.0.0.199: + Christian: Update FML, make the .sh scripts executable + +Build 4.0.0.196: + LexManos: Update FML to 285 + +Build 4.0.0.194: + draake: Added additional sound events to allow manipulation of a sound source at its creation. + draake: Removed SoundSetListenerEvent implementation. + +Build 4.0.0.193: + LexManos: Fix potential index exception in ForgeDirection + LexManos: Whops + +Build 4.0.0.192: + LexManos: Rename Orientation to ForgeDirection {Damn MCP naming a class Direction already} + +Build 4.0.0.191: + LexManos: Update FML again for mod screen blending fix. + +Build 4.0.0.190: + LexManos: Updated Orientation with new helper functionality. + LexManos: Fix ItemBlock placement, should fix RP Deployers placing blocks 1 tile down. + LexManos: Seperated block placmenet logic in ItemBlock as immibis requested: https://github.com/MinecraftForge/MinecraftForge/pull/110 + LexManos: New Command event. + LexManos: Fix issue with default getContainerItemStack + LexManos: Add render distance property to TileEntity. + +Build 4.0.0.189: + LexManos: Updated FML, should fix the new included eclipse workspace. + +Build 4.0.0.188: + LexManos: Cleanup repo, delete old code + LexManos: Update FML to 278, MC 1.3.2 + LexManos: Cleaned up forge scripts, and updated AT config for 1.3.2, deleted any reference to server specific code. + LexManos: Updated patches to 1.3.2 + LexManos: Fixed bug in DimensionManager that would cause Index error for custom dimensions, also made WorldProviders aware of what dimension they are. + +Build 4.0.0.187: + LexManos: Readded patch to allow for use of custom teleporter for transfering dimensions. + +Build 4.0.0.186: + LexManos: Update FML with entity spawning fixes + +Build 4.0.0.185: + LexManos: Updated FML, should fix 'derp?' RuntimeError + +Build 4.0.0.184: + LexManos: Fix PickBlock 'ghost item' bug when picking with a item selected. + +Build 4.0.0.183: + LexManos: Update FML, Tons of bug fixes and proper merging of client and server. + LexManos: Delete Forge server projects + LexManos: Update debug settings to use Client's internal MinecraftServer.main to debug dedi-server env. + LexManos: Update release script to create universal binary distro. + +Build 4.0.0.182: + j.marini: Fix bug where default bonemeal behavior wouldn't trigger. Only return if the event was canceled. + +Build 4.0.0.181: + LexManos: Update FML, new AT features, and error info. + +Build 4.0.0.180: + LexManos: Fixed ItemRenderer not grabbing custom texture files properly for block items + LexManos: Updated FML + LexManos: Delete dead IGuiHandler + LexManos: Update AT config to expose some block functions and a few extras. + +Build 4.0.0.179: + LexManos: Should fix commands.py patching not working properly first run. + +Build 4.0.0.178: + LexManos: + Updated FML, Should fix a lot of installing issues for MCP. + Made patches error and not apply if the target file is not found. + Updated Event Transformer to add a default constructor... + Fixed 4096 setup code in MinecraftForge.initalize() + +Build 4.0.0.177: + LexManos: Fix issue in install script for users with spaces in there paths. + +Build 4.0.0.176: + LexManos: Update FML, server should run now. Still issue with NPE with no mods installed. + LexManos: Updated FML, fixed custom tool hooks, and spawn protection/player reach hooks. + +Build 4.0.0.173: + LexManos: Fixed Diemsnion API related NPEs, and updated FML to 231. + +Build 4.0.0.172: + LexManos: Get rid of all old patches + LexManos: Added a better eclipse workspace for deving Forge + LexManos: inital push of updated setup script and cleaned up forge.py + LexManos: Dump old mcp config + LexManos: New Start.java which allows the user to login using a legit account for testing on servers. + LexManos: Committing inital work on generating sanitized MCP conf data. + LexManos: Add the direct copied files from MCP conf + LexManos: Add newids to that list + LexManos: Helper function grab all unique searge names that are shared client and server + LexManos: Added merging fields/methods/param csv files. And updated FML to 197 + LexManos: Remove eclipse files from old eclipse projects + LexManos: Updated build.py + LexManos: Update FML + LexManos: + Moved logo to new client folder + Added blank Access Transformer config for Forge + Implemented version storage + Added basic dummy FML mod container to remove the need for mod metadata file + Added beggining work on Forge event system + Updated and moved EnumHelper + LexManos: Updated update_patches.py, and made first patch! + LexManos: Moved paulscode to new client folder + LexManos: First push of some small patches and introduction of basic events. As well as the first cases for Forge's Access Transformer + LexManos: Missed a file + LexManos: Moved in OreDictionary stuff to new system. IOreHandler is replaced by OreDictionary.OreRegisterEvent + LexManos: Renamed MinecraftForge.eventBus to EVENT_BUS as it's constant. + LexManos: Implemented BonemealEvent (IBonemealHandler replacement), and bonemeal making grass. + LexManos: Implemeneted adding grass seeds, as well as IShearable for BlockTallGrass + LexManos: More progress on converting patches from 1.2.5 + LexManos: Some more patch migration before bed. + LexManos: + More patches converted. + Refactored some of the events to be a better hiarachy. + LexManos: A bulk of more patches converted, updated fml + LexManos: Moved some files. + LexManos: More work, moved over packet stuff, need to change everything to use new NetworkMod system + LexManos: More conversions, added all the entity living events. + LexManos: Finished World and EntityMinecart patches. + LexManos: Removed a lot of old files + LexManos: Updated Client side patches for the new Merged MCP workspace. + LexManos: Nope, unneeded patch + LexManos: Cleaned up some more, fixed infinite loop with cancelable annotation, Client now compiles and enters world just fine. + LexManos: Delete conf, server compile, update fml, and fix install script. + LexManos: Copy forge files over in install. + LexManos: Update fml + LexManos: Moved over Configuration + LexManos: Fix oreientation bug causing levers not being able to place. + LexManos: Added new pick block hook for blocks and entites to allow for better grained control of the result. + LexManos: Include Forge's AT config into redist zips. + LexManos: Update fml, impelemnted Diemsnion API stuff. + LexManos: Updated FML, updated patches + +Build 3.4.9.171: + Christian: Normalize the repo + LexManos: Rebase + LexManos: Bumped version to 3.4.9, final commit for 1.2.5. + +Build 3.3.8.170: + someh4x0r: Fix BlockTrapDoor.disableValidation on server + +Build 3.3.8.164: + LexManos: Should fix NPE on older ISoundHandlers EXA: http://minecraftforge.net/forum/index.php/topic,759.html + +Build 3.3.8.163: + Christian: Update fml with recent tick fix + +Build 3.3.8.162: + truebrain: + -Add: sync serverPos[XYZ] on spawning of entity + + This fixes the issue that, up to 400 ticks from getting in range, + entities have a wrong offset (because server and client don't agree on + the position to calculate relative updates from) + truebrain: -Fix: check for null where needed + truebrain: -Codechange: applied LexManos' request + +Build 3.3.8.161: + LexManos: Fixed a improper rounding in EntityMinecart + LexManos: Made WorldGenMinable metadata sensitive. + +Build 3.3.8.160: + Christian: Update fml to 175- fixes some weird ticking behaviours for ML mods, adds in new ticking behaviours for smart mods + +Build 3.3.8.159: + LexManos: Moved licenses and credits into install folder. + LexManos: Removed symlink files, shouldn't be in the repo. + LexManos: Updated some remaining scripts to call there python versions. + +Build 3.3.8.158: + LexManos: Fix furnaces not smelting the proper number of results after the first one. Damn you tahg, fix this! Keeps falling through my cracks. + +Build 3.3.8.157: + Christian: + Fix server check "blockHasTileEntity" used to determine if getDescriptionPacket + is sent for the block to be metadata sensitive. Thanks iChun! + +Build 3.3.8.156: + Christian: Fix ghost players who appear if they don't have the 4096 fix installed + +Build 3.3.8.155: + LexManos: Fix container creative to not add Blocks above 256 unless it's told to. + +Build 3.3.8.154: + Christian: + Fix world provider behaviour: WorldProvider.byDimension should always return + a new instance- otherwise you can end up with worlds overwriting one another + +Build 3.3.8.153: + LexManos: Fixed isBlockReplaceable and placing ItemBlocks' + +Build 3.3.8.152: + LexManos: Fucking spelling nazis + +Build 3.3.8.151: + LexManos: Fix bitmask bug related to 4096 in multi-block change. + LexManos: Updated FML to build 153 + +Build 3.3.8.150: + LexManos: Fix NPE related to server/client not having block ids synced properly. + LexManos: Add option to randomize potential spawn locations to have a more randomly dispersed spawn patern, useful for games like FTB vs. + LexManos: Added configuration option to disable the darkroom mechanic. For servers who wish to not risk destruction at one broken pipe. + +Build 3.3.8.148: + LexManos: FML 150, more tick related work. + +Build 3.3.8.147: + LexManos: Close inputstream + +Build 3.3.8.146: + LexManos: More bugfixes related to portal generation. Should be all now. + +Build 3.3.8.145: + LexManos: Some 4096 I missed in custom renderers. + LexManos: Updated to FML 149, should fix all ticking issues with ModLoader mods + LexManos: Fix Vanilla bug where nether portals would not work above 127 + +Build 3.3.8.144: + LexManos: Updated to FML build #142, fixed FML compilation issue causing missing files when reobfing. + +Build 3.3.8.143: + LexManos: Updated release script to automatically inject version info into .info file. + +Build 3.3.8.142: + LexManos: Updated to FML 141, should fix ticking issues with certian mods, and crash issue with TropiCraft + +Build 3.3.8.141: + LexManos: Bumped version number for new IEntityLiving interface. + +Build 3.3.7.140: + pahimar: Typo in the new EntityLivingHandler code + +Build 3.3.7.139: + LexManos: Made setFailsafeFieldValue public for Rob + LexManos: Implemented enchanced EntityLiving events. Thanks Atomic for parts of it. + +Build 3.3.7.138: + LexManos: Few more cases for 4096, thanks TrueBrain + +Build 3.3.7.137: + LexManos: Forgot Configuration in 4096 change. + +Build 3.3.7.136: + LexManos: Configurable kick message when you don't have forge. + LexManos: Initial 4096 fix based of mDiyo's work. + +Build 3.3.7.135: + LexManos: Fixed bug in new entity sound hook. + +Build 3.3.7.134: + LexManos: Updated to FML #135 {Fixed ModList rendering issue, and incorrect arument on crafting hook} + LexManos: Added new ISoundHandler.onPlaySoundAtEntity hook. Should be backwards compatible with any older ISoundHandler implementations. + LexManos: New onChunkUnload event for TileEntities, for psxlover. + LexManos: Bumped version number to 3.3.7 for full release. + +Build 3.2.6.132: + LexManos: Fixed concurent modification exception in the ore registry. + +Build 3.2.6.131: + LexManos: Fix for potential concurancy modification exceptions + +Build 3.2.6.130: + LexManos: Fixed possible NPE when blocks havent fully initalized yet. + +Build 3.2.6.129: + LexManos: Updated FML to 132, TextureFX fix, and bumped revision to 6. + +Build 3.2.5.128: + LexManos: Added bouncer functions for functions we removed. Makes MagicLauncher shut up about missing functions {not actually missing}, and therefor makes users stop thinking its a life or death error. + +Build 3.2.5.127: + LexManos: New Ore Dictionary recipies. Allows for simpler Ore Dictionary integration with recipies. IOreHandler should no longer be used. + +Build 3.2.5.126: + LexManos: Updated to FML 130 + LexManos: Added hackish workaround for Tessellator.textureID to provent crashing while we wait for Optifine to update. + +Build 3.2.5.125: + LexManos: Server side of ITextureProvider for Block/Item for compilations sake. + +Build 3.2.5.124: + LexManos: Backwards compatibility fix for ITextureProvider + +Build 3.2.5.123: + LexManos: Updated FML to 121 to fix world tick issues. + +Build 3.2.5.122: + LexManos: Updated MCP mapings. Moved the bulk of custom logic from RenderItem to ForgeHooksClient. + LexManos: All Items and Blocks now implement ITextureProvider, and have a setTextureFile(String) function, to support cleaner code in Mods and in Forge. + LexManos: Tag each Tessellator with it's associated texture ID. + +Build 3.2.5.121: + LexManos: Added kick info to disconnect event, updated to FML 120, keybindings, better image rendering in ModList ui. + +Build 3.2.5.120: + LexManos: Fix bug in cart functions where would always return null. + +Build 3.2.5.119: + LexManos: Fixed some inverted logic causing tress to not gen correctly. + +Build 3.2.5.118: + LexManos: Update FML to 117 + +Build 3.2.5.117: + LexManos: New Hooks addedf for custom tree/leaves. And better interaction with trees growing and rerplacing certain blocks. Should allow for ExtraBiomes to behave nicer, and RedPower to make there blocks un-breakable by trees. + LexManos: Also, new hook in last commit for blocks to determine if they are able to be replaced by ores, for any mod that adds new world gen. Bumped revision up. + +Build 3.2.4.116: + LexManos: We now bundle CodexIBXM from PaulsCode. See http://paulscode.com http://www.paulscode.com/forum/index.php?topic=4.0 and the included license files for more info. + LexManos: Updated to FML 115, added Forge Logo to the client dist, and in-game ModInfo page. + +Build 3.2.4.115: + LexManos: Updated to FML build 114 + +Build 3.2.4.114: + LexManos: Included fmlversion.properties in the release zips. + +Build 3.2.4.111: + LexManos: Added FML ReadMe, Credits, and License to release zips + +Build 3.2.4.110: + LexManos: Update FML to 92, this include full client side support, ModLoader nolonger needed. + LexManos: Added new source clean step to fix linux vs windows astyle issues. + LexManos: Cleaned up names for Minecraft Forge's text files so they dont clash with other mods. Fixed up the release script to include the license text, and executable permissions for install.sh. + LexManos: Added FML mod info file + LexManos: Updated MCP Mapings and patches. + LexManos: Updated patches for FML, moved some extranious code to Forge classes instead of patches. + LexManos: Updated to FML Build 95 + +Build 3.2.3.108: + LexManos: Bump version number for official release. + +Build 3.1.3.107: + LexManos: Fixed AudioMod compatibility with MultiMC style launchers. + +Build 3.1.3.106: + LexManos: Bit masked the entity ID to change the range from -127-127 to 0-255 + +Build 3.1.3.105: + LexManos: Updated MCP Mapings + +Build 3.1.3.104: + LexManos: Added forge identifier to statistics collection. + +Build 3.1.3.103: + LexManos: Fix for furnaces not smelting the final item in full stacks. + +Build 3.1.3.102: + CovertJaguar: static final vars are inlined during the compile step, making the version variables useless at runtime. + LexManos: Fixed Levers droping off the backs of stairs client side. + +Build 3.1.3.101: + LexManos: New block hooks for creating custom beds. + +Build 3.1.3.100: + cpw: Update to FML 74: fixes an important issue with MLProp + +Build 3.1.3.99: + LexManos: Bumped revision to 3 + +Build 3.1.2.98: + LexManos: Fixed Vinella mob spawning bug that prevented mobs from spawning on the top most chunk. Added new Block function to determine if a Mob can naturally spawn on the block. Add new hook to allow for special case handeling on natural entity spawn. + +Build 3.1.2.97: + LexManos: Fix for loading Minecart Entities in worlds that were last accessed before Forge was installed. + +Build 3.1.2.96: + LexManos: Moved MLMP compatibility functions to ModCompatibilityClient, and fixed issue where no vehicles would be spawned. + +Build 3.1.2.95: + LexManos: + New ISoundHandler interface, useful for adding custom sounds and dealign with sound based events. + Includes basuic AudioMod compatibility. + +Build 3.1.2.94: + LexManos: Fixed vinella bugs when trying to access chunk information with a y < 0 + +Build 3.1.2.93: + LexManos: Updated to FML build #73 + LexManos: Added MLMP hook invocation for vehicle spawn and opening GUI's to provide compatibility for clients that have both ModLoaderMP and forge installed. + +Build 3.1.2.92: + LexManos: Exposed TileEntityData packet to TileEntities. And added helper sender function. + +Build 3.1.2.91: + LexManos: Added metadata sensitive Chunk constructor for Bioxx + +Build 3.1.2.90: + LexManos: Added MinecraftApplet.clas to the force output list because users cant understand the concept of only replacing files they are told to. And bumped version to 3.1.2 + +Build 3.0.1.89: + LexManos: made the ID in PacketEntitySpawn unsigned. + LexManos: Added generic packet sending function to MinecraftForge class. + LexManos: Fixed shift-clicking issue with items that utilized the new ItemStack sensitive smelting system. + LexManos: Implemented a 'small' packet system for those mods that need to send rapid, small data packets and who are concered about the overhead of the 250 payload packet. It uses packet 131. + +Build 3.0.1.88: + LexManos: Implemented RichardG's Paged Achivement list GUI modifications. + +Build 3.0.1.87: + t.tomkins: Edits enable use of EntityPlayer.canHarvestBlock (for PlayerAPI) when the ToolClass has no rules for the block. + +Build 3.0.1.86: + LexManos: MAX_ENTITY_RADIUS Now works on the Y axis + LexManos: Respawning in dimensions should now properly set the dimension ID for the new player instance. + +Build 3.0.1.85: + LexManos: Fix for vanilla crash for chunk generation with block ID's above 127. + +Build 3.0.1.84: + cpw: Update fml to build 68: fixes a ticking issue and soft vs hard dependencies + +Build 3.0.1.83: + LexManos: + Changed entity Forge spawning code works to be more in line with normal spawning: + (World, double, double double) constructor is nolonger called, normal (World) constructor, and setPositionAndRotation is called afterwords. + yaw, pitch, and yawHead is sent (if the entity isn't a EntityLiving yawHead isn't used) + The datawatcher data is also sent like a normal Entity. + +Build 3.0.1.82: + LexManos: Fixed bug in BlockFire's old fields. + LexManos: Added variable entity radius to World, to be used if a mod make really large entities. + +Build 3.0.1.81: + LexManos: Fixed TileEntity bug that was causing Ghost tile entities. + +Build 3.0.1.80: + LexManos: Multi-pass item rendering now uese proper render pass number. + +Build 3.0.1.79: + LexManos: Added slope velocity hook for Covert + +Build 3.0.1.78: + LexManos: Fixed bugs in the Dimension transfer code, Now displays proper join message, and respawning in dimensions other then 0 works. + +Build 3.0.1.77: + CovertJaguar: Added a function for checking block harvest levels without having to resort to reflection. + LexManos: Try to fix jenkins build. + +Build 3.0.1.75: + LexManos: Added ItemStack sensitive burn time hook. + +Build 3.0.1.74: + LexManos: + Added new Item function to allow for multiple rendering passes. + Fixed a vinella bug where item layters would not line up for EntityItem's + Added new IItemRendere helper flag for 3d block translations. + +Build 3.0.1.73: + cpw: Update fml to 62- provision a server console command and fix mod loading order + cpw: Update FML for new hooks: onPlayerLogout and onPlayerDimensionChanged + LexManos: + Rewrote IItemRenderer to be a more generic and expandable version, Breaks previous interfaces, but this should be the last time the interface changes. + Implemented the MapRender hook ChickenBones requested. + +Build 3.0.0.72: + cpw: Fix separated login/announce handler + cpw: FML 59: don't send a zero length register packet, add mod channels + +Build 3.0.0.71: + cpw: Update to FML 57: fixes FML not calling it's login handler code + +Build 3.0.0.70: + LexManos: MCP Conf update for 1.2.5 + LexManos: Initial patch update to FML and MC 1.2.5 + LexManos: Deleted patches + LexManos: Fixed update_patches.py to now delete old patch files that have no working src relation + LexManos: Updated repo scripts to python, allowing more flexability and less code duplication. + LexManos: Finished up converting the source dist install scripts to python. Fixed a couple issues with the other scripts. + cpw: Update patches for FML fix. + cpw: Fix release script to import "inject_version" + cpw: Add in recent fml with fixes + cpw: Delete the old one too + LexManos: Rewrote the login code to delay full login untill forge fnishes negotiating network IDs. Should fix entities not having proper ID mapings. + LexManos: Added ChickenBones's request ITextureLoadHandler hook + LexManos: Updated patch for mapings + LexManos: Implemented ISaveEventHandler as ChickenBones's requested. + LexManos: Add server spawn protection config option as per someh4x0r's request. + LexManos: Couple of output fixups and added script to be executed by Jenkins during the build. First test build. + LexManos: Changed IGuiHandler's signature to be compatible with both sides. Took out ModLoaderMp reference in README. + +Build 2.0.0.68: + LexManos: Fix some shadowing warnings. + LexManos: Some cleanups to update_patches, should run properly on any system now. + LexManos: Add IChunkLoadHandler.canEntityUpdate() function to allow entities to update while in custom loaded chunks. + LexManos: Implemented a chat event handler system to allow for manipulating and handeling the various chat/command events. + +Build 2.0.0.67: + LexManos: Changed update_patches script to use python for the bulk, Prevents making 1800 temporary useless files. + LexManos: Fixed camelcasing in IConnectionHandler, ment to do during first upgrade. + +Build 2.0.0.66: + LexManos: Fixed typo bug in MinecraftForge.getEntityTrackerInfo + +Build 2.0.0.65: + LexManos: + Updated to MC: 1.2.4 MLMP: 1.2.4 v1 + Removed all code that was marked as deprecated, IE: ICustomItemRenderer, and the functions in Configuration + +Build 1.4.1.64: + LexManos: Reworked EntityPlayerMP.openGui to hopefully be more compatible with PlayerAPI + +Build 1.4.1.63: + LexManos: Cleanup the EffectRenderer patches, Allows custom food items to have the proper particals. Cleaned up special case class in favor of basic java generics. + +Build 1.4.1.62: + CovertJaguar: Added the ability to define custom categories for config files. + CovertJaguar: Removed createCategory() function and changed it to create categories as they are encountered. + LexManos: Updated MCP mapings + LexManos: + Fixed a couple of bugs in the Configuration categories pull request. + Added helper functions to Property for standard int/boolean usage. + LexManos: Added rider sit pull request. + +Build 1.4.1.61: + LexManos: Fixed NPE on CustomPayload packets with 0 data + LexManos: Changed logic in Configuration to allow for extended block ID mods easier access to change that. Just use reflection to change Configuration.configBlocks to whatever length you want. + LexManos: Implemented Pheenixm pull request allowing for more control over the camera. + LexManos: + Added MinecraftForge.isClient() function that returns true if you are in the Minecraft Client, (As defined as net.minecraft.client.Minecraft existing) false otherwise. + Fixed a typo on PacketEntitySpawn that caused speed to be assigned improperly. + A little code cleanup. + +Build 1.4.1.60: + LexManos: Fixed a few typos that CovertJaguire found in The Forge entity handeling code. And re-wrote the connection sequance so that clients get a list of mod ids before anything else. + +Build 1.4.1.59: + LexManos: Readded the deprecated interface ICustomItemRenderer. Added method to enforce deprecation cross Minecraft versions. + +Build 1.4.1.58: + newthead: Added new item render interfaces to Forge client + newthead: Added hook for rendering equipped items + newthead: Clarified render option for inventory items + newthead: Added remaining item render hooks, and fixed a static method access + newthead: Added render code for inventory items and entity items. + newthead: Cleanup/fix item render hooks + newthead: Added additional flag for rendering entity item bobbing + newthead: Merged item rendering interfaces into a single IItemRenderer + newthead: Updated render hooks and registration to use the IItemRenderer interface + newthead: Modified patches to use new item render hooks + newthead: Merged item rendering interfaces into a single IItemRenderer + CovertJaguar: Fix for network code. + newthead: Changed render hook checks to all use ItemStack instead of itemID + newthead: Reverted vanilla texture binding to an explicit if() statement based on item ID + LexManos: Fixed dyes showing twice in creative list + LexManos: Bumped version number to 1.4.1 + +Build 1.4.0.57: + LexManos: Fixed tile entities not properly being removed for blocks that do not extend BlockContainer, or override BlockContainer.onBlockRemoval + +Build 1.4.0.56: + LexManos: Fixed excessive need for user interaction in the install script. + LexManos: Fixed a class to a deprecated method to fix tool effectiveness. + +Build 1.4.0.55: + LexManos: Reworked the workspace scripts so the build should fail on compile errors. This build should fail as a test. + LexManos: Fixed IOException not found error in CovertJaguires pull request. Updated scripts so that build should now be fixed + +Build 1.4.0.53: + CovertJaguar: Added throws clause to ISpawnHandler functions to keep the functions consistent with similar functions and increase ease of use. Exceptions are already being caught everywhere these functions are called, so no further changes required. + LexManos: Fixed onTakenFromCrafting hooks to be called once per stack taken. Sadly due to how shift-click is handled, the passed in item stack is not garenteed to be the stack that the result was added to. + +Build 1.4.0.52: + LexManos: Fixed forgotten type identifier in clean_src + LexManos: New EntityInteract hook for handeling player vs entity interaction on the global level vs the item level. + LexManos: Fixed sides of grass not getting biome colors + LexManos: Fixed type on patch conversion messing up tile entities + LexManos: Proper fix for SDK's invalid bit shifts of parameters for chunk population + LexManos: Made BlockStairs, BlockFarmland, and BlockStep have proper sided-solidity. Can now place torches on any solid side of those blocks. + +Build 1.4.0.51: + cpw: + Fix worldgen doubleshifting in ModLoaderMP until SDK fixes it. + + This means mods can generate surface and nether in SMP again. + +Build 1.4.0.50: + eloraam: Fixed a merge error. + LexManos: + New script to fix decompile differences between windows and linux/osx. + Removed the MLProp special case, no longer needed as MLProp decompiles fine. + Updated patches to work on all systems. + Added warning and exit if the user does not say yes to the cleanup. + +Build 1.4.0.49: + eloraam: MCP Update. Fixed a few small bugs in the linux scripts. + +Build 1.4.0.48: + LexManos: Fixed the inverted logic in the missing mod check. + LexManos: Fixed a wrong argument for dimensions, should fix entity tracking. + LexManos: Custom dimensions should now honor the canRespawnHere function for respawning. + +Build 1.4.0.47: + LexManos: Fix up Configuration ids to only work for 256 ids until Jeb finishes the 4096 conversion. + +Build 1.4.0.46: + LexManos: Fixed a bug where vines were not shearable. + +Build 1.4.0.45: + CovertJaguar: Fixed a minor bug with the Minecart Dictionary. + +Build 1.4.0.44: + LexManos: 1.4.0 official release. + +Build 1.3.4.42: + LexManos: Updated to MLMPv3 + +Build 1.3.4.41: + LexManos: Hack-fix for players getting stuck during logins. Detailed fix when bug is actually tracked down. + LexManos: Implemented ChickenBone's Chunk handler + +Build 1.3.4.39: + LexManos: Fixed client side bonemeal on grass only making flowers + LexManos: Updated to latest MCP + +Build 1.3.4.38: + LexManos: Fixed MLMP thinking Network mods need a client side when they dont. + LexManos: Fixed a generic tile entity line i missed on the server side. + LexManos: Removed improper tile entity negation + +Build 1.3.4.37: + LexManos: Updated to SDK MLMP v2 + +Build 1.3.4.36: + LexManos: Fixed missing double array in MLMP's packet server side. Also, fixed the creative code again, brain failed. + +Build 1.3.4.35: + LexManos: Got my comparitor turned around + LexManos: Updated to SDK's 1.2.3 MLMP, Mush cleaner, no longer supporting Flan's. + +Build 1.3.4.34: + LexManos: Updated gitignore, fixed digging particles, fixed creative container showing to many blocks, fixed wrong argument for custom renderers. + +Build 1.3.4.33: + LexManos: Updated MCP's patch files. Fixes hangs on running MC as applet. + LexManos: ItemBlock now implements ITextureProvider so that blocks with custom textures will showup properly when being held. + +Build 1.3.4.32: + LexManos: Fixed NPE in the login handler + LexManos: Fixed directory issues in the setup script + LexManos: Cleanup of ModLoaderMP and proper update to the latest version of ModLoader + +Build 1.3.4.31: + LexManos: Fixed missing space in linux scripts + LexManos: No longer mark forge packets as chunk packets. + LexManos: Updated MCP mapings files + +Build 1.3.4.30: + LexManos: Updated scripts so that we use Fernflower now. Added a small python script to download fernflower for the user. And the scripts exit out if it fails. + LexManos: Deleted modLoaderMP.patch, unneeded now that we use Fernflower + LexManos: Updated eclipse project for MCP 1.2.3's inclusion of the Start folder in the src folder. + LexManos: Updated The Json enum helper to point to the new packaged names. And fixed a casing change in ModLoader + LexManos: Made mod_MinecraftForge extend NetworkMod, and changed NetworkMod to extend BaseModMP server side. + LexManos: Fixed unneeded imports in ForgePacket + LexManos: removed unneeded import, and fixed casing of args in IShearable + LexManos: Deleted EntityPigZombie patches, Who needed these? Why could you not do this via reflection? + LexManos: Conf for 1.2.3 + LexManos: Same patch diff, files. + LexManos: No longer needed, bug was fixed + LexManos: Client side initial patch update to Fernflower and MC 1.2.3 + LexManos: Bit of a cleanup of the client patches + LexManos: Couple of things I missed client side + LexManos: Deleted unneeded server side patches, Packet250 bug was fixed. And the others got moved to AnvilSaveHandler + LexManos: First push of server side patch updates for 1.2.3. MLMP is still not updated so it does not include those changes, and will not compile. + LexManos: Small imports cleanup + LexManos: Missed damageCarryover on the server + LexManos: Made the scripts forge updating md5s/mcp/names + LexManos: Updated for MLMP 1.2.3 v1 + +Build 1.3.4.29: + LexManos: Bumped version to 1.3.4, final commit for Minecraft v1.1 + +Build 1.3.3.28: + LexManos: Fixed bug in build script that caused the Minecraft/MinecraftServer classes to not be included. + +Build 1.3.3.27: + LexManos: Client side of the new Dimension support. + +Build 1.3.3.26: + thedeveducer: Fixed spelling mistake ('Frequancy') + LexManos: Fixed ITextureprovider for multi-textured items when rendering on the GUI. + LexManos: Fixed compile error for the spelling pull request. + +Build 1.3.3.24: + LexManos: Fixed up Shearable blocks to play nicer with sub-classes. + LexManos: Fixed line endings in windows update_patches + LexManos: Deleted Deprecated interfaces. + LexManos: Ran AStyle over forge code for uniform code formatting, and refactored old code a bit to have cleaner names. + +Build 1.3.3.23: + connor: People may think the server needs the mods to continue and not the client. + +Build 1.3.3.22: + LexManos: Fixed a bug in update_patches that caused apostrphies to be removed. Causing the last patch to be generated incorrectly. + +Build 1.3.3.21: + LexManos: + Initial attempt at server side extra dimensions support. + Mods must register there dimensions on load, by calling DimensionManager.registerDimension(uniqueID, WorldProvier, boolean) + Mods are resposible for writing there own transporter blocks. + Initial commit, needs some more testing and design thoughts. + +Build 1.3.3.20: + LexManos: Added new Item.getIconIndex context sensitive version. + LexManos: Implemented a response to Methuselah96's Arrow hook request. See IArrowNockHandler and IArrowLooseHandler + +Build 1.3.3.19: + LexManos: Changed the layout of the missing mods gui a little. Still needs a lot of work to look good. + LexManos: Marked forge packets as 'chunk' packets. Giving them a higher priority making the initial mod list check more reliable. + LexManos: Introduced some debugging info into Forge packets. And a debug flag in the client and server packet handlers. + LexManos: Moved Client side EntityPlayer.openGui work code to EntityPlayer for compatibility between player API. + +Build 1.3.3.16: + eloraam: Linux scripts fixed, TE bug fix. + eloraam: Fixed linux scripts, fixed TE bug. + +Build 1.3.3.15: + LexManos: Exposed getters for NetServerHandler.playerEntity and NetworkManager.netHandler + LexManos: + Introuduced NetworkMod, a BaseMod extension and replacement for BaseModMP. All mods that are designed to work in the server environment should extend this. + NetworkMods will be assigned unique ModIDs by the server, and those IDs will be sent to the client upon connection. + Refactored Forge packets to the net.minecraft.src.forge.packets package. And introduced the base ForgePacket class. + Added initial ModList request/response. + LexManos: + Expanded the Mod check to test for missing mods and display a GUI screen for the client if it is missing any. + The client now downloads NetworkMod ID's from the server upon connecting. + LexManos: Implemented a generic EntityPlayer.openGui system, and the network backend for it to work on server and client. + +Build 1.3.3.14: + LexManos: + Fixed up the install scripts. The linux script no longer needs sed. Should fix some issues on OSX's without gsed. + Also forge sources will only be copied to sides that were downloaded. + Also, install scripts now prompt for input to cleanup. + +Build 1.3.3.13: + LexManos: Split mod_MinecraftForge so that Clients arnt required to have MLMP installed if they don't use a MP mod. + +Build 1.3.3.12: + LexManos: Update MCP Mapings + LexManos: Small update to update_patches.bat, to skip patch reject files. + LexManos: Bumped version to 1.3.3 + +Build 1.3.2.10: + LexManos: + Refactored so that ISpecialArmor items do not see the factor of 25 on the damage. + The value returned form ISpecialArmor.getProperties is now copied, so mod items are free to re-use there return values. + +Build 1.3.2.9: + LexManos: + Reworked ISpecialArmor to provide better functionality as requested by IC2 devs. + Armor can now be prioritized over other armor. + It can deal with damaging it's own itemstacks. + Also impkemented the ISpecialArmor.getArmorDisplay + +Build 1.3.2.8: + LexManos: Lowered the amount of build log spam, and fixed the inject_version script for use on other systems. + LexManos: Fixed ITextureProvider support for items that have multiple colored overlays. + LexManos: Added Item.onLeftClickEntity hook. Used to intercept and cancel the 'attack' action within items. + LexManos: Implemented item.onBlockStartBreak call for creative single player. + LexManos: Implimented a new IShearable system. This allows mods to create both new shear-like items/blocks. As well as new Entities/Blocks that work with other mod's shear-like items. + +Build 1.3.2.7: + LexManos: Missed a caluse, ISpecialArmor should work as intended now. And not destroy Armor instanatly. + +Build 1.3.2.6: + LexManos: + Implmented Sengir's IPickupHandler. + http://www.mod-buildcraft.com/forums/topic/hook-intercept-item-pickups-by-player-entities/?view=all + +Build 1.3.2.5: + LexManos: + Merged in the change to ISpecialArmor to introduce the DamageSource argument. + As well as the concept of damage absorption vs reduction. + +Build 1.3.2.4: + LexManos: + Created a Entity tracking ans spawning system. + Mod creators should call MinecraftForge.registerEntity to register a entity. + All entity ID numbers are Mod Unique. Meaning two mods can have Entity #1. + Added client and server side packet handlers for the 'Forge' channel. For use in internal packets such as the new Spawn packet. + Updated the build scripts to copy over unique server source files now that there actually are some. + For modders: + If you have a entity that used MLMP's 'owner' system, you should have your entity implement IThrowableEntity + If you have a entity that implments MLMLP's ISpawnable, you should implement ISpawnHandler. + They provide the same functionality, just in a cleaner, more orginized way and will be the method used when we eventually drop MLMP. + +Build 1.3.2.3: + LexManos: Fixed return value for un/registerChannel. Now returns properly indicate when un/register commands should be sent. + +Build 1.3.2.2: + LexManos: + Setup .gitignore for eclipse bin dirs. + Fixed line endings in install.sh + Added mod_MinecraftForge for simpler logging of minecraft version in crash reports + Added new hooks for connection events, See IConnectionHandler for more details. + Added Packet250CustomPayload handeling and channel registraction management, see MessageManager and IPacketHandler for more details. + Forge now uses unsed fields in C->S Packet1Login to identify itself. None Forge clients will get a graceful disconnect message instead of the 'Unknown packet 230' + diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/main/java/com/ngb/projectzulu/common/DeathGamerules.java b/src/main/java/com/ngb/projectzulu/common/DeathGamerules.java deleted file mode 100644 index 83318f5..0000000 --- a/src/main/java/com/ngb/projectzulu/common/DeathGamerules.java +++ /dev/null @@ -1,529 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import java.util.logging.Level; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.item.EntityXPOrb; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.world.GameRules; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.event.entity.living.LivingDeathEvent; -import net.minecraftforge.event.entity.player.PlayerDropsEvent; -import net.minecraftforge.event.world.WorldEvent; -import com.ngb.projectzulu.common.api.BlockList; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -import com.google.common.base.Optional; - -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -public class DeathGamerules { - int maxDropXP = 100; - int percKeptXp = 0; - - int armorDeathDamage = 0; - int inventoryDeathDamage = 0; - int hotbarDeathDamage = 0; - - int armorDropDamage = 0; - int inventoryDropDamage = 0; - int hotbarDropDamage = 0; - - int armorDropChance = 100; - int inventoryDropChance = 100; - int hotbarDropChance = 100; - - int armorMaxDrop = 0; - int inventoryMaxDrop = 0; - int hotbarMaxDrop = 0; - - boolean tombstoneOnDeath = true; - boolean tombstoneAbsorbDrops = true; - boolean doDropEvent = true; - - boolean keepInventoryDefault = false; - boolean dropArmorDefault = false; - boolean dropInventoryDefault = false; - boolean dropHotbarDefault = false; - boolean dropXPDefault = false; - private ExperienceRedistributor redistributor; - private ItemBlacklist itemBlacklist; - - public DeathGamerules() { - redistributor = new ExperienceRedistributor(); - FMLCommonHandler.instance().bus().register(redistributor); - } - - public DeathGamerules loadConfiguration(File modConfigDirectory) { - itemBlacklist = new ItemBlacklist(); - Configuration config = new Configuration(new File(modConfigDirectory, DefaultProps.configDirectory - + DefaultProps.defaultConfigFile)); - config.load(); - itemBlacklist.loadFromConfig(config); - - tombstoneOnDeath = config.get("General Controls", "Drop Tombstone On Death", tombstoneOnDeath).getBoolean( - tombstoneOnDeath); - tombstoneAbsorbDrops = config.get("General Controls", "Tombstone Absorb Drops", tombstoneAbsorbDrops) - .getBoolean(tombstoneAbsorbDrops); - doDropEvent = config.get("General Controls", "doDropEvent", doDropEvent).getBoolean(doDropEvent); - - String category = "General Controls.gamerule_settings"; - maxDropXP = config - .get(category + ".Experience", "maxDropXP", 100, - "Maximum amount XP dropped on Death. The rest is lost if not kept via percKeptXp. 100 is vanilla default") - .getInt(100); - keepInventoryDefault = config.get(category, "keepInventoryDefault", false, - "The Default settings for the keepInventory gamerule").getBoolean(false); - Property keptXpProperty = config.get(category + ".Experience", "percKeptXp", 0, - "Percentage of XP (minus dropped amount) kept with the player on respawn."); - percKeptXp = keptXpProperty.getInt(); - if (percKeptXp < 0 || percKeptXp > 100) { - percKeptXp = percKeptXp < 0 ? 0 : percKeptXp > 100 ? 100 : percKeptXp; - keptXpProperty.set(percKeptXp); - } - dropArmorDefault = config.get(category + ".Armor", "isEnabledDefault", false, - "The Default settings for the dropArmor gamerule").getBoolean(false); - dropInventoryDefault = config.get(category + ".Inventory", "isEnabledDefault", false, - "The Default settings for the dropInventory gamerule").getBoolean(false); - dropHotbarDefault = config.get(category + ".Hotbar", "isEnabledDefault", false, - "The Default settings for the dropHotbar gamerule").getBoolean(false); - dropXPDefault = config.get(category + ".Experience", "isEnabledDefault", false, - "The Default settings for the dropXP gamerule").getBoolean(false); - - armorDeathDamage = handlePropMinMax(config.get(category + ".Armor", "armorDeathDamage", 0, - "Percentage of Max durability dealth on Death to armor slot items"), 0, 0, 100); - inventoryDeathDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDeathDamage", 0, - "Percentage of Max durability dealth on Death to inventory slot items"), 0, 0, 100); - hotbarDeathDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDeathDamage", 0, - "Percentage of Max durability dealth on Death to hotbar slot items"), 0, 0, 100); - - armorDropDamage = handlePropMinMax(config.get(category + ".Armor", "armorDropDamage", 0, - "Percentage of Max durability dealth on Drop to armor slot items"), 0, 0, 100); - inventoryDropDamage = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropDamage", 0, - "Percentage of Max durability dealth on Drop to inventory slot items"), 0, 0, 100); - hotbarDropDamage = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropDamage", 0, - "Percentage of Max durability dealth on Drop to hotbar slot items"), 0, 0, 100); - - armorDropChance = handlePropMinMax(config.get(category + ".Armor", "armorDropChance", 100, - "Chance that each armor slot item will drop on death"), 100, 0, 100); - inventoryDropChance = handlePropMinMax(config.get(category + ".Inventory", "inventoryDropChance", 100, - "Chance that each inventory slot item will drop on death"), 100, 0, 100); - hotbarDropChance = handlePropMinMax(config.get(category + ".Hotbar", "hotbarDropChance", 100, - "Chance that each hotbar slot item will drop on death"), 100, 0, 100); - - armorMaxDrop = handlePropMinMax(config.get(category + ".Armor", "armorMaxDrop", 0, - "Max number of armor slot items that can drop on death."), 0, 0, null); - inventoryMaxDrop = handlePropMinMax(config.get(category + ".Inventory", "inventoryMaxDrop", 0, - "Max number of inventory slot items that can drop on death"), 0, 0, null); - hotbarMaxDrop = handlePropMinMax(config.get(category + ".Hotbar", "hotbarMaxDrop", 0, - "Max number of hotbar slot items that can drop on death"), 0, 0, null); - config.save(); - return this; - } - - private int handlePropMinMax(Property prop, int value, Integer min, Integer max) { - value = prop.getInt(value); - if (min != null && value < min) { - prop.set(min); - value = min; - } else if (max != null && value > max) { - prop.set(max); - value = max; - } - return value; - } - - @SubscribeEvent - public void worldLoad(WorldEvent.Load event) { - GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } - createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); - createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); - createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); - createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); - } - - private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, boolean value) { - boolean added = false; - if (!gameRule.hasRule(gameruleName)) { - gameRule.addGameRule(gameruleName, Boolean.toString(value)); - added = true; - } - ProjectZuluLog.info("Gamerule %s is set to %s", gameruleName, gameRule.getGameRuleBooleanValue(gameruleName)); - return added; - } - - @SubscribeEvent - public void onPlayerDeath(LivingDeathEvent event) { - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - EntityPlayer player = (EntityPlayer) event.entity; - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player) : null; - if (tombstone != null) { - // tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString("Here lies " + player.getDisplayName().toUpperCase() + " slain by " + event.source.getSourceOfDamage().getCommandSenderName()); - } - - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - if (dropXP) { - if (!player.worldObj.isRemote) { - xpDropped = player.experienceTotal; - xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - int keptXp = (player.experienceTotal - xpDropped) * percKeptXp / 100; - redistributor.addExpereince(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - boolean isCancelled = false; - if (doDropEvent) { - PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - } - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - } else { - if (tombstoneAbsorbDrops) { - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } - } - - private void dropItems(EntityPlayer player, List drops) { - for (ItemStack itemDrop : drops) { - player.inventory.player.dropPlayerItemWithRandomChoice(itemDrop, true); - } - } - - private PlayerDropsEvent createPlayerDropEvent(EntityPlayer player, DamageSource damageSource, - ArrayList drops) { - int recentlyHit; - try { - recentlyHit = ObfuscationHelper.getCatchableFieldFromReflection("field_70718_bc", EntityLivingBase.class, - player, Integer.class); - } catch (NoSuchFieldException e) { - recentlyHit = ObfuscationHelper.getFieldFromReflection("recentlyHit", EntityLivingBase.class, player, - Integer.class); - } - return new PlayerDropsEvent(player, damageSource, player.capturedDrops, recentlyHit > 0); - } - - private TileEntityTombstone placeTombstone(EntityPlayer player) { - Optional chunkCoordinate = findValidTombstoneLocation(player); - if (chunkCoordinate.isPresent()) { - /* Place a Tombstone */ - player.worldObj.setBlock(chunkCoordinate.get().posX, chunkCoordinate.get().posY, - chunkCoordinate.get().posZ, BlockList.tombstone.get()); - TileEntity tileEntity = player.worldObj.getTileEntity(chunkCoordinate.get().posX, - chunkCoordinate.get().posY, chunkCoordinate.get().posZ); - StringBuilder sb = new StringBuilder(); - sb.append("A tombstone has been set to mark the 'passing' of ").append(player.getCommandSenderName()).append(" at ["); - sb.append(chunkCoordinate.get().posX).append(", "); - sb.append(chunkCoordinate.get().posY).append(", "); - sb.append(chunkCoordinate.get().posZ).append("]"); - player.addChatMessage(new ChatComponentText(sb.toString())); - if (tileEntity != null && tileEntity instanceof TileEntityTombstone) { - ProjectZuluLog.debug(Level.INFO, sb.toString()); - return (TileEntityTombstone) tileEntity; - } - } - ProjectZuluLog.warning("Failed to find location to place tombstone at player location {X:%s, Y:%s, Z:%s}", - player.posX, player.posY, player.posZ); - return null; - } - - private Optional findValidTombstoneLocation(EntityPlayer player) { - final int maxRadius = 100; - /** Search an increasing square box (only check edge) for a valid location */ - for (int radius = 0; radius < maxRadius; radius++) { - List validLocations = new ArrayList(); - validLocations.addAll(searchXPlaneAt(-radius, radius, player)); - validLocations.addAll(searchXPlaneAt(radius, radius, player)); - validLocations.addAll(searchZPlaneAt(-radius, radius, player)); - validLocations.addAll(searchZPlaneAt(radius, radius, player)); - validLocations.addAll(searchYPlaneAt(-radius, radius, player)); - validLocations.addAll(searchYPlaneAt(radius, radius, player)); - ChunkCoordinates closestPoint = null; - float bestDistance = 0; - for (ChunkCoordinates chunkCoordinates : validLocations) { - if (closestPoint != null) { - float distance = chunkCoordinates.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - if (distance < bestDistance) { - bestDistance = distance; - closestPoint = chunkCoordinates; - } - } else { - closestPoint = chunkCoordinates; - bestDistance = closestPoint.getDistanceSquared((int) player.posX, (int) player.posY, - (int) player.posZ); - } - } - if (closestPoint != null) { - return Optional.of(closestPoint); - } - } - return Optional.absent(); - } - - private List searchXPlaneAt(int xOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchZPlaneAt(int zOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int yOffset = -radius; yOffset <= radius; yOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private List searchYPlaneAt(int yOffset, int radius, EntityPlayer player) { - List matches = new ArrayList(); - for (int xOffset = -radius; xOffset <= radius; xOffset++) { - for (int zOffset = -radius; zOffset <= radius; zOffset++) { - ChunkCoordinates chunkCoordinates = new ChunkCoordinates((int) (player.posX + xOffset), - (int) (player.posY + yOffset), (int) (player.posZ + zOffset)); - if (isLocationValid(player, chunkCoordinates.posX, chunkCoordinates.posY, chunkCoordinates.posZ)) { - matches.add(chunkCoordinates); - } - } - } - return matches; - } - - private boolean isLocationValid(EntityPlayer player, int posX, int posY, int posZ) { - if (player.worldObj.isAirBlock(posX, posY, posZ) && player.worldObj.getBlock(posX, posY - 1, posZ).isOpaqueCube()) { - return true; - } - return false; - } - - private List dropArmor(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.armorInventory.length]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - - shuffleArray(placeArray, player.worldObj.rand); - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.armorInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((armorMaxDrop == 0 || countDrops < armorMaxDrop) - && (armorDropChance - player.worldObj.rand.nextInt(100) >= 1)) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? armorDeathDamage + armorDropDamage : armorDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.armorInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.armorInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private List dropInventory(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - if (player.inventory.mainInventory.length > 8) { - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[player.inventory.mainInventory.length - 9]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i + 9; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((inventoryMaxDrop == 0 || countDrops < inventoryMaxDrop) - && inventoryDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? inventoryDeathDamage + inventoryDropDamage : inventoryDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - } - return itemsToDrop; - } - - private List dropHotbar(EntityPlayer player) { - List itemsToDrop = new ArrayList(); - - int inventorySize = player.inventory.mainInventory.length > 9 ? 9 : player.inventory.mainInventory.length; - /* Array to determine the order the inventory array is processed. */ - int[] placeArray = new int[inventorySize]; - for (int i = 0; i < placeArray.length; i++) { - placeArray[i] = i; - } - shuffleArray(placeArray, player.worldObj.rand); - - int countDrops = 0; - for (int i = 0; i < placeArray.length; ++i) { - int slot = placeArray[i]; - ItemStack itemStack = player.inventory.mainInventory[slot]; - if (itemStack == null || itemBlacklist.isItemBlacklisted(itemStack)) { - continue; - } - boolean shouldDrop = false; - if ((hotbarMaxDrop == 0 || countDrops < hotbarMaxDrop) - && hotbarDropChance - player.worldObj.rand.nextInt(100) >= 1) { - shouldDrop = true; - } - int percentDamage = shouldDrop ? hotbarDeathDamage + hotbarDropDamage : hotbarDeathDamage; - percentDamage = percentDamage > 100 ? 100 : percentDamage; - itemStack.attemptDamageItem(itemStack.getMaxDamage() * percentDamage / 100, player.worldObj.rand); - - boolean itemDestroyed = itemStack.isItemStackDamageable() - && itemStack.getItemDamage() > itemStack.getMaxDamage(); - if (itemDestroyed) { - player.inventory.mainInventory[slot] = null; - } - - if (shouldDrop) { - if (!itemDestroyed) { - itemsToDrop.add(itemStack); - } - player.inventory.mainInventory[slot] = null; - countDrops++; - } - - } - return itemsToDrop; - } - - private void shuffleArray(int[] array, Random random) { - for (int i = array.length - 1; i >= 0; i--) { - int index = random.nextInt(i + 1); - int a = array[index]; - array[index] = array[i]; - array[i] = a; - } - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/ProjectZulu_Core.java b/src/main/java/com/ngb/projectzulu/common/ProjectZulu_Core.java deleted file mode 100644 index 7be48b4..0000000 --- a/src/main/java/com/ngb/projectzulu/common/ProjectZulu_Core.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.ngb.projectzulu.common; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.lang3.ArrayUtils; - -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemArmor.ArmorMaterial; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.util.EnumHelper; -import com.ngb.projectzulu.common.core.CreativePZGeneralTab; -import com.ngb.projectzulu.common.core.CreativePZPotionTab; -import com.ngb.projectzulu.common.core.CustomEntityManager; -import com.ngb.projectzulu.common.core.DefaultProps; -import com.ngb.projectzulu.common.core.EventHookContainerClass; -import com.ngb.projectzulu.common.core.ItemBlockManager; -import com.ngb.projectzulu.common.core.PacketPipeline; -import com.ngb.projectzulu.common.core.ProjectZuluLog; -import com.ngb.projectzulu.common.core.ZuluGuiHandler; -import com.ngb.projectzulu.common.core.terrain.FeatureGenerator; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaceBlock; -import com.ngb.projectzulu.common.dungeon.commands.CommandPlaySound; -import com.ngb.projectzulu.common.dungeon.commands.CommandSpawnEntity; -import com.ngb.projectzulu.common.dungeon.commands.CommandStreamSound; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.event.FMLServerStartedEvent; -import cpw.mods.fml.common.event.FMLServerStartingEvent; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.registry.GameRegistry; - -/*Useful OpenSource reference to Look at: ExtrabiomesXL, Gaurdsman*/ -@Mod(modid = DefaultProps.CoreModId, name = "Project Zulu Core", dependencies = DefaultProps.DesiredBefore, useMetadata = true) -public class ProjectZulu_Core { - - @Instance(DefaultProps.CoreModId) - public static ProjectZulu_Core modInstance; - - private static int defaulteggID = 300; - - public static int getNextDefaultEggID() { - return defaulteggID++; - } - - public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( - CreativeTabs.creativeTabArray.length, "projectZuluTab"); - public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( - CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); - - public static boolean enableTestBlock = false; - public static boolean enableTemperature = false; - - public static int testBlockID = 2540; - public static Block testBlock; - - /* Material Declarations */ - public static final ArmorMaterial desertClothMaterial = EnumHelper.addArmorMaterial("Desert Cloth Material", 2, - new int[] { 1, 2, 1, 1 }, 15); - public static final ArmorMaterial scaleMaterial = EnumHelper.addArmorMaterial("Scale Material", 5, new int[] { 1, - 3, 2, 1 }, 15); - public static final ArmorMaterial furMaterial = EnumHelper.addArmorMaterial("Fur Material", 3, new int[] { 1, 3, 2, - 1 }, 13); - public static final ArmorMaterial goldScaleMaterial = EnumHelper.addArmorMaterial("Gold Scale Material", 7, - new int[] { 2, 5, 3, 1 }, 25); - public static final ArmorMaterial ironScaleMaterial = EnumHelper.addArmorMaterial("Iron Scale Material", 15, - new int[] { 2, 6, 5, 2 }, 9); - public static final ArmorMaterial diamondScaleMaterial = EnumHelper.addArmorMaterial("Diamond Scale Material", 33, - new int[] { 3, 8, 6, 3 }, 10); - - public static File modConfigDirectoryFile; - - public static final FeatureGenerator featureGenerator = new FeatureGenerator(); - - private static PacketPipeline packetPipeline; - - public static PacketPipeline getPipeline() { - return packetPipeline; - } - - @SidedProxy(clientSide = "com.ngb.projectzulu.common.ClientProxyProjectZulu", serverSide = "com.ngb.projectzulu.common.CommonProxyProjectZulu") - public static CommonProxyProjectZulu proxy; - - private class ModuleInfo { - public Module module; - public boolean isEnabled; - - public ModuleInfo(Module module) { - this.module = module; - isEnabled = true; - } - - public String getIdentifier() { - return module.getIdentifier(); - } - } - - private List modules = new ArrayList(); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) { - modConfigDirectoryFile = event.getModConfigurationDirectory(); - - ProjectZuluLog.configureLogging(modConfigDirectoryFile); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Blocks"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Mobs"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_Dungeon"); - attemptLoadModule("com.ngb.projectzulu.common.ProjectZulu_World"); - - Configuration moduleConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.moduleConfigFile)); - moduleConfig.load(); - for (ModuleInfo moduleInfo : modules) { - moduleInfo.isEnabled = moduleConfig.get("isEnabled", moduleInfo.getIdentifier(), true, - "Set to false to disable module.").getBoolean(true); - if (moduleInfo.isEnabled) { - ProjectZuluLog.info("Module [%s] settings read and will be loaded.", moduleInfo.getIdentifier()); - } else { - ProjectZuluLog.info("Module [%s] settings read and will be disabled.", moduleInfo.getIdentifier()); - } - } - moduleConfig.save(); - Configuration zuluConfig = new Configuration(new File(event.getModConfigurationDirectory(), - DefaultProps.configDirectory + DefaultProps.defaultConfigFile)); - Properties.loadFromConfig(modConfigDirectoryFile); - zuluConfig.load(); - enableTemperature = zuluConfig.get("General Controls", "enableTemperature", enableTemperature).getBoolean( - enableTemperature); - zuluConfig.save(); - - proxy.bossHealthTicker(); - - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.registration(CustomEntityManager.INSTANCE); - moduleInfo.module.registration(ItemBlockManager.INSTANCE); - moduleInfo.module.registration(featureGenerator); - moduleInfo.module.preInit(event, modConfigDirectoryFile); - } - } - - ProjectZuluLog.info("Load Entity Moxdels and Render"); - ProjectZulu_Core.proxy.registerModelsAndRender(); - - ProjectZuluLog.info("Load Entity Properties"); - CustomEntityManager.INSTANCE.loadCreaturesFromConfig(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Setup"); - ItemBlockManager.INSTANCE.createBlocks(modConfigDirectoryFile); - - ProjectZuluLog.info("Starting ItemBlock Registration"); - ItemBlockManager.INSTANCE.registerBlocks(); - - ProjectZuluLog.info("Registering Entites"); - CustomEntityManager.INSTANCE.registerEntities(modConfigDirectoryFile); - } - - private void attemptLoadModule(String classResourceName) { - try { - Class moduleClass = Class.forName(classResourceName); - if (Module.class.isAssignableFrom(moduleClass)) { - Module module = (Module) (moduleClass.newInstance()); - ProjectZuluLog.info("Detected %s module.", module.getIdentifier()); - modules.add(new ModuleInfo(module)); - } - } catch (ClassNotFoundException e) { - ProjectZuluLog.info("Module [%s] missing; will be disabled.", classResourceName); - } catch (InstantiationException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } catch (IllegalAccessException e) { - ProjectZuluLog.severe("Failed to instantiate %s, report to modder.", classResourceName); - e.printStackTrace(); - } - } - - @EventHandler - public void load(FMLInitializationEvent event) { - NetworkRegistry.INSTANCE.registerGuiHandler(ProjectZulu_Core.modInstance, new ZuluGuiHandler()); - packetPipeline = new PacketPipeline("ProjectZulu"); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.init(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void postInit(FMLPostInitializationEvent event) { - BiomeDictionary.registerAllBiomes(); - - ProjectZuluLog.info("Registering Events"); - MinecraftForge.EVENT_BUS.register(new EventHookContainerClass()); - - ProjectZuluLog.info("Load Entity Biomes"); - CustomEntityManager.INSTANCE.loadBiomesFromConfig(modConfigDirectoryFile); - ProjectZuluLog.info("Register Entity Spawns"); - CustomEntityManager.INSTANCE.addSpawns(); - - ProjectZuluLog.info("Initializing TerrainFeatures"); - featureGenerator.initialize(modConfigDirectoryFile); - GameRegistry.registerWorldGenerator(featureGenerator, 1); - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.postInit(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStarting(event, modConfigDirectoryFile); - } - } - } - - @EventHandler - public void serverStart(FMLServerStartedEvent event) { - for (ModuleInfo moduleInfo : modules) { - if (moduleInfo.isEnabled) { - moduleInfo.module.serverStart(event, modConfigDirectoryFile); - } - } - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/core/PZPacket.java b/src/main/java/com/ngb/projectzulu/common/core/PZPacket.java deleted file mode 100644 index 01d1b6c..0000000 --- a/src/main/java/com/ngb/projectzulu/common/core/PZPacket.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public interface PZPacket extends IMessage { - /** - * Encode the packet data into the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * @param buffer the buffer to encode into - */ - public abstract void toBytes(ByteBuf buffer); - - /** - * Decode the packet data from the ByteBuf stream. Complex data sets may need specific data handlers (See - * - * @link{cpw.mods.fml.common.network.ByteBuffUtils ) - * @param buffer the buffer to decode from - */ - public abstract void fromBytes(ByteBuf buffer); - - /** - * Handle a packet on the client side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleClientSide(EntityPlayer player); - - /** - * Handle a packet on the server side. Note this occurs after decoding has completed. - * - * @param player the player reference - */ - public abstract void handleServerSide(EntityPlayer player); - - public IMessage handleMessage(PZPacket message, MessageContext ctx); -} diff --git a/src/main/java/com/ngb/projectzulu/common/core/PZPacketBase.java b/src/main/java/com/ngb/projectzulu/common/core/PZPacketBase.java deleted file mode 100644 index 44b9b85..0000000 --- a/src/main/java/com/ngb/projectzulu/common/core/PZPacketBase.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; - -import io.netty.buffer.ByteBuf; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; -import cpw.mods.fml.relauncher.Side; - -public abstract class PZPacketBase implements PZPacket { - - @Override - public IMessage handleMessage(PZPacket message, MessageContext ctx) { - if (ctx.side == Side.CLIENT) { - message.handleClientSide(Minecraft.getMinecraft().thePlayer); - } else if (ctx.side == Side.SERVER) { - message.handleServerSide(ctx.getServerHandler().playerEntity); - } - return null; - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/core/PacketPipeline.java b/src/main/java/com/ngb/projectzulu/common/core/PacketPipeline.java deleted file mode 100644 index a98cfc0..0000000 --- a/src/main/java/com/ngb/projectzulu/common/core/PacketPipeline.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.ngb.projectzulu.common.core; - -import net.minecraft.entity.player.EntityPlayerMP; - -import com.ngb.projectzulu.common.core.packets.PacketPlaySound; -import com.ngb.projectzulu.common.core.packets.PacketStreamSound; -import com.ngb.projectzulu.common.core.packets.PacketTameParticle; -import com.ngb.projectzulu.common.dungeon.packets.PacketMobSpawner; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; -import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; -import com.ngb.projectzulu.common.mobs.packets.PacketNameSync; -import com.ngb.projectzulu.common.mobs.packets.PacketTileText; - -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import cpw.mods.fml.relauncher.Side; - -/** - * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. - * - * Based on PacketPipeline example code by @author sirgingalot and @author cpw - */ -public class PacketPipeline { - private SimpleNetworkWrapper network; - private int discriminator = 0; - - public PacketPipeline(String channelName) { - network = NetworkRegistry.INSTANCE.newSimpleChannel(channelName); - registerClientMessage(PacketAnimTime.class, PacketAnimTime.class); - registerUniversalMessage(PacketMobSpawner.class, PacketMobSpawner.class); - registerServerMessage(PacketNameSync.class, PacketNameSync.class); - registerClientMessage(PacketPlaySound.class, PacketPlaySound.class); - registerClientMessage(PacketStreamSound.class, PacketStreamSound.class); - registerServerMessage(PacketTileText.class, PacketTileText.class); - registerClientMessage(PacketTameParticle.class, PacketTameParticle.class); - registerClientMessage(PacketFollowerMasterData.class, PacketFollowerMasterData.class); - } - - private void registerClientMessage( - Class> messageHandler, Class requestMessageType) { - network.registerMessage(messageHandler, requestMessageType, discriminator, Side.CLIENT); - discriminator++; - } - - private void registerServerMessage( - Class> messageHandler, Class requestMessageType) { - network.registerMessage(messageHandler, requestMessageType, discriminator, Side.SERVER); - discriminator++; - } - - private void registerUniversalMessage( - Class> messageHandler, Class requestMessageType) { - network.registerMessage(messageHandler, requestMessageType, discriminator, Side.CLIENT); - discriminator++; - network.registerMessage(messageHandler, requestMessageType, discriminator, Side.SERVER); - discriminator++; - } - - /** - * Send this message to everyone. - * - * @param message The message to send - */ - public void sendToAll(PZPacket message) { - network.sendToAll(message); - } - - /** - * Send this message to the specified player. - * - * @param message The message to send - * @param player The player to send it to - */ - public void sendTo(PZPacket message, EntityPlayerMP player) { - network.sendTo(message, player); - } - - /** - * Send this message to everyone within a certain range of a point. - * - * @param message The message to send - * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send - */ - public void sendToAllAround(PZPacket message, NetworkRegistry.TargetPoint point) { - network.sendToAllAround(message, point); - } - - /** - * Send this message to everyone within the supplied dimension. - * - * @param message The message to send - * @param dimensionId The dimension id to target - */ - public void sendToDimension(PZPacket message, int dimensionId) { - network.sendToDimension(message, dimensionId); - } - - /** - * Send this message to the server. - * - * @param message The message to send - */ - public void sendToServer(PZPacket message) { - network.sendToServer(message); - } - -} \ No newline at end of file diff --git a/src/main/java/com/ngb/projectzulu/common/core/packets/PacketPlaySound.java b/src/main/java/com/ngb/projectzulu/common/core/packets/PacketPlaySound.java deleted file mode 100644 index bfaab07..0000000 --- a/src/main/java/com/ngb/projectzulu/common/core/packets/PacketPlaySound.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; - -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public class PacketPlaySound extends PacketByteStream implements IMessageHandler { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketPlaySound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playSound(posX, posY, posZ, sound, 1.0f, 1.0f, false); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } - - @Override - public IMessage onMessage(PacketPlaySound message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} \ No newline at end of file diff --git a/src/main/java/com/ngb/projectzulu/common/core/packets/PacketStreamSound.java b/src/main/java/com/ngb/projectzulu/common/core/packets/PacketStreamSound.java deleted file mode 100644 index 6a9782a..0000000 --- a/src/main/java/com/ngb/projectzulu/common/core/packets/PacketStreamSound.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public class PacketStreamSound extends PacketByteStream implements IMessageHandler { - private int posX; - private int posY; - private int posZ; - private String sound; - - public PacketStreamSound setPacketData(int xPos, int yPos, int zPos, String sound) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.sound = sound; - return this; - } - - @Override - protected void writeData(ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - buffer.writeInt(sound.length()); - buffer.writeChars(sound); - } - - @Override - protected void readData(ByteBufInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - int soundLength = buffer.readInt(); - char[] soundChars = new char[soundLength]; - for (int i = 0; i < soundChars.length; i++) { - soundChars[i] = buffer.readChar(); - } - sound = new String(soundChars); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = player.worldObj; - worldObj.playRecord(sound, posX, posY, posZ); - } - - @Override - public void handleServerSide(EntityPlayer player) { - // TODO Auto-generated method stub - - } - - @Override - public IMessage onMessage(PacketStreamSound message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} \ No newline at end of file diff --git a/src/main/java/com/ngb/projectzulu/common/core/packets/PacketTameParticle.java b/src/main/java/com/ngb/projectzulu/common/core/packets/PacketTameParticle.java deleted file mode 100644 index 252a77c..0000000 --- a/src/main/java/com/ngb/projectzulu/common/core/packets/PacketTameParticle.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.ngb.projectzulu.common.core.packets; - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.PZPacketBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; -import com.ngb.projectzulu.common.mobs.packets.PacketFollowerMasterData; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -/** - * Send Tame event to Client such that the EntityGenericTameable taming effect can be performed - */ -public class PacketTameParticle extends PZPacketBase implements IMessageHandler { - private int entityIdToTriggerEffect; - private boolean tameingSuccess; - - public PacketTameParticle setPacketData(int entityIdToTriggerEffect, boolean tameingSuccess) { - this.entityIdToTriggerEffect = entityIdToTriggerEffect; - this.tameingSuccess = tameingSuccess; - return this; - } - - @Override - public void toBytes(ByteBuf buffer) { - buffer.writeInt(entityIdToTriggerEffect); - buffer.writeBoolean(tameingSuccess); - } - - @Override - public void fromBytes(ByteBuf buffer) { - entityIdToTriggerEffect = buffer.readInt(); - tameingSuccess = buffer.readBoolean(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToTriggerEffect); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).playTameEffect(tameingSuccess); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - } - - @Override - public IMessage onMessage(PacketTameParticle message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketByteStream.java b/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketByteStream.java deleted file mode 100644 index f22e2ab..0000000 --- a/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketByteStream.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.IOException; - -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.PZPacketBase; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -//import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; -//import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; - -/** - * Wraps ByteBuf into ByteStreams for additional read/write features such as writeString - */ -public abstract class PacketByteStream extends PZPacketBase { - - @Override - public void toBytes(ByteBuf buffer) { - ByteBufOutputStream data = new ByteBufOutputStream(buffer); - try { - writeData(data); - } catch (Exception e) { - ProjectZuluLog.severe("Error writing packet %s to ByteBufOutputStream", this); - e.printStackTrace(); - } - } - - protected abstract void writeData(ByteBufOutputStream buffer) throws IOException; - - @Override - public void fromBytes(ByteBuf buffer) { - ByteBufInputStream byteStream = new ByteBufInputStream(buffer); - try { - readData(byteStream); - } catch (Exception e) { - ProjectZuluLog.severe("Error reading packet %s from ByteBufInputStream", this); - e.printStackTrace(); - } - } - - protected abstract void readData(ByteBufInputStream buffer) throws IOException; -} diff --git a/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketDataStream.java b/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketDataStream.java deleted file mode 100644 index a74b267..0000000 --- a/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketDataStream.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import io.netty.buffer.ByteBuf; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.PZPacketBase; -import com.ngb.projectzulu.common.core.ProjectZuluLog; - -/** - * Packet uses exposes data writing/reading via ByteArrayOutputStream/DataInputStream - * - * This allows using Minecraft methods to write traditional Minecraft objects, such as NBT data - */ -public abstract class PacketDataStream extends PZPacketBase { - - @Override - public void toBytes(ByteBuf buffer) { - ByteArrayOutputStream byteArray = new ByteArrayOutputStream(); - DataOutputStream data = new DataOutputStream(byteArray); - try { - writeData(data); - } catch (Exception e) { - // TODO: log exception - } - byte[] bytes = byteArray.toByteArray(); - buffer.writeInt(bytes.length); - buffer.writeBytes(bytes); - } - - protected abstract void writeData(DataOutputStream buffer) throws IOException; - - @Override - public void fromBytes(ByteBuf buffer) { - int byteLength = buffer.readInt(); - byte[] dataBytes = new byte[byteLength]; - buffer.readBytes(dataBytes); - - ByteArrayInputStream byteArray = new ByteArrayInputStream(dataBytes); - DataInputStream data = new DataInputStream(byteArray); - try { - readData(data); - } catch (Exception e) { - // TODO: log exception - } - } - - protected abstract void readData(DataInputStream buffer) throws IOException; - - /** - * Reads a compressed NBTTagCompound from the InputStream - */ - protected static NBTTagCompound readNBTTagCompound(DataInputStream par0DataInputStream) throws IOException { - short length = par0DataInputStream.readShort(); - if (length < 0) - return null; - else { - byte[] compressed = new byte[length]; - par0DataInputStream.readFully(compressed); - return CompressedStreamTools.readCompressed(new ByteArrayInputStream(compressed)); - } - } - - /** - * Writes a compressed NBTTagCompound to the OutputStream - */ - protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutputStream par1DataOutputStream) - throws IOException { - if (par0NBTTagCompound == null) { - par1DataOutputStream.writeShort(-1); - } else { - byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); - par1DataOutputStream.writeShort((short) var2.length); - par1DataOutputStream.write(var2); - } - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketMobSpawner.java b/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketMobSpawner.java deleted file mode 100644 index 9925f56..0000000 --- a/src/main/java/com/ngb/projectzulu/common/dungeon/packets/PacketMobSpawner.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.ngb.projectzulu.common.dungeon.packets; - -import ibxm.Player; -import io.netty.buffer.ByteBuf; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.PZPacketBase; -import com.ngb.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; -import com.ngb.projectzulu.common.mobs.packets.PacketAnimTime; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public class PacketMobSpawner extends PacketDataStream implements IMessageHandler { - int entityIDtoSync; - private int posX; - private int posY; - private int posZ; - private NBTTagCompound customData; - - public PacketMobSpawner setPacketData(int xPos, int yPos, int zPos, NBTTagCompound customData) { - this.posX = xPos; - this.posY = yPos; - this.posZ = zPos; - this.customData = customData; - return this; - } - - @Override - protected void writeData(DataOutputStream buffer) throws IOException { - buffer.writeInt(posX); - buffer.writeInt(posY); - buffer.writeInt(posZ); - writeNBTTagCompound(customData, buffer); - } - - @Override - protected void readData(DataInputStream buffer) throws IOException { - posX = buffer.readInt(); - posY = buffer.readInt(); - posZ = buffer.readInt(); - customData = readNBTTagCompound(buffer); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - World world = player.getEntityWorld(); - TileEntity tileEntity = world.getTileEntity(posX, posY, posZ); - if (tileEntity != null && tileEntity instanceof TileEntityLimitedMobSpawner) { - tileEntity.readFromNBT(customData); - ((TileEntityLimitedMobSpawner) tileEntity).forceUpdate(); - } - } - - @Override - public void toBytes(ByteBuf buffer) { - // TODO Auto-generated method stub - - } - - @Override - public void fromBytes(ByteBuf buffer) { - // TODO Auto-generated method stub - - } - - @Override - public IMessage onMessage(PacketMobSpawner message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketAnimTime.java b/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketAnimTime.java deleted file mode 100644 index 8b9823c..0000000 --- a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketAnimTime.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.PZPacketBase; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericCreature; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public class PacketAnimTime extends PZPacketBase implements IMessageHandler { - - private int entityIDtoSync; - private int animTime; - - public PacketAnimTime setPacketData(int entityIDtoSync, int animTime) { - this.entityIDtoSync = entityIDtoSync; - this.animTime = animTime; - return this; - } - - @Override - public void toBytes(ByteBuf buffer) { - buffer.writeInt(entityIDtoSync); - buffer.writeInt(animTime); - } - - @Override - public void fromBytes(ByteBuf buffer) { - entityIDtoSync = buffer.readInt(); - animTime = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity entity = worldObj.getEntityByID(entityIDtoSync); - if (entity != null && entity instanceof EntityGenericCreature) { - ((EntityGenericCreature) entity).setAnimTime(animTime); - } else { - // TODO Print to Log Entity No longer Exists - } - } - - @Override - public void handleServerSide(EntityPlayer player) { - - } - - @Override - public IMessage onMessage(PacketAnimTime message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketFollowerMasterData.java b/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketFollowerMasterData.java deleted file mode 100644 index e9b47e1..0000000 --- a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketFollowerMasterData.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBuf; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.core.PZPacketBase; -import com.ngb.projectzulu.common.mobs.entity.EntityFollower; -import com.ngb.projectzulu.common.mobs.entity.EntityMaster; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public class PacketFollowerMasterData extends PZPacketBase implements IMessageHandler { - - int childEntityID; - int masterEntityID; - int followerIndex; - - public PacketFollowerMasterData setPacketData(int childEntityID, int masterEntityID, int followerIndex) { - this.childEntityID = childEntityID; - this.masterEntityID = masterEntityID; - this.followerIndex = followerIndex; - return this; - } - - @Override - public void toBytes(ByteBuf buffer) { - buffer.writeInt(childEntityID); - buffer.writeInt(masterEntityID); - buffer.writeInt(followerIndex); - } - - @Override - public void fromBytes(ByteBuf buffer) { - childEntityID = buffer.readInt(); - masterEntityID = buffer.readInt(); - followerIndex = buffer.readInt(); - } - - @Override - public void handleClientSide(EntityPlayer player) { - World worldObj = ((EntityPlayer) player).worldObj; - Entity childEntity = worldObj.getEntityByID(childEntityID); - Entity masterEntity = worldObj.getEntityByID(masterEntityID); - if (followerIndex == -1 || masterEntityID == -1 || childEntity == null - || !(childEntity instanceof EntityFollower) || masterEntity == null - || !(masterEntity instanceof EntityMaster)) { - return; - } - ((EntityFollower) childEntity).linkMasterWithFollower(masterEntityID, followerIndex); - } - - @Override - public void handleServerSide(EntityPlayer player) { - } - - @Override - public IMessage onMessage(PacketFollowerMasterData message, - MessageContext ctx) { - return handleMessage(message, ctx); - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketNameSync.java b/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketNameSync.java deleted file mode 100644 index 561fc7f..0000000 --- a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketNameSync.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; - -import java.io.IOException; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; -import com.ngb.projectzulu.common.mobs.entity.EntityGenericTameable; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -/** - * Sync entity Name to server from GUI - */ -public class PacketNameSync extends PacketByteStream implements IMessageHandler { - private int entityIdToBeNamed; - private String entityName; - - public PacketNameSync setPacketData(int entityIdToBeNamed, String entityName) { - this.entityIdToBeNamed = entityIdToBeNamed; - this.entityName = entityName; - return this; - } - - @Override - protected void writeData(ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(entityIdToBeNamed); - buffer.writeInt(entityName.length()); - buffer.writeChars(entityName); - } - - @Override - protected void readData(ByteBufInputStream buffer) throws IOException { - entityIdToBeNamed = buffer.readInt(); - int nameLength = buffer.readInt(); - char[] nameChars = new char[nameLength]; - for (int i = 0; i < nameLength; i++) { - nameChars[i] = buffer.readChar(); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - Entity entity = player.worldObj.getEntityByID(entityIdToBeNamed); - if (entity != null && entity instanceof EntityGenericTameable) { - ((EntityGenericTameable) entity).setUsername(entityName); - } - } - - @Override - public IMessage onMessage(PacketNameSync message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketTileText.java b/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketTileText.java deleted file mode 100644 index 2015ecd..0000000 --- a/src/main/java/com/ngb/projectzulu/common/mobs/packets/PacketTileText.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.ngb.projectzulu.common.mobs.packets; - -import java.io.IOException; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufInputStream; -import io.netty.buffer.ByteBufOutputStream; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import com.ngb.projectzulu.common.blocks.tombstone.TileEntityTombstone; -import com.ngb.projectzulu.common.core.PZPacket; -import com.ngb.projectzulu.common.dungeon.packets.PacketByteStream; - -import cpw.mods.fml.common.network.simpleimpl.IMessage; -import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; -import cpw.mods.fml.common.network.simpleimpl.MessageContext; - -public class PacketTileText extends PacketByteStream implements IMessageHandler { - private int tileLocationX; - private int tileLocationY; - private int tileLocationZ; - private String[] text; - - public PacketTileText setPacketData(int tileLocationX, int tileLocationY, int tileLocationZ, String[] text) { - this.tileLocationX = tileLocationX; - this.tileLocationY = tileLocationY; - this.tileLocationZ = tileLocationZ; - this.text = text; - return this; - } - - @Override - protected void writeData(ByteBufOutputStream buffer) throws IOException { - buffer.writeInt(tileLocationX); - buffer.writeInt(tileLocationY); - buffer.writeInt(tileLocationZ); - buffer.writeInt(text.length); - for (String string : text) { - buffer.writeInt(string.length()); - buffer.writeChars(string); - } - } - - @Override - protected void readData(ByteBufInputStream buffer) throws IOException { - tileLocationX = buffer.readInt(); - tileLocationY = buffer.readInt(); - tileLocationZ = buffer.readInt(); - int numTexts = buffer.readInt(); - text = new String[numTexts]; - for (int i = 0; i < numTexts; i++) { - int stringLength = buffer.readInt(); - char[] stringChars = new char[stringLength]; - for (int j = 0; j < stringLength; j++) { - stringChars[j] = buffer.readChar(); - } - text[i] = new String(stringChars); - } - } - - @Override - public void handleClientSide(EntityPlayer player) { - } - - @Override - public void handleServerSide(EntityPlayer player) { - if (player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ) instanceof TileEntityTombstone) { - TileEntity tile = player.worldObj.getTileEntity(tileLocationX, tileLocationY, tileLocationZ); - if (tile != null && tile instanceof TileEntityTombstone) { - TileEntityTombstone tombstone = (TileEntityTombstone) tile; - tombstone.signText = text; - player.worldObj.markBlockForUpdate(tileLocationX, tileLocationY, tileLocationZ); - } - } - } - - @Override - public IMessage onMessage(PacketTileText message, MessageContext ctx) { - return handleMessage(message, ctx); - } -} diff --git a/src/main/java/com/ngb/projectzulu/common/potion/PotionManager.java b/src/main/java/com/ngb/projectzulu/common/potion/PotionManager.java deleted file mode 100644 index 56f5443..0000000 --- a/src/main/java/com/ngb/projectzulu/common/potion/PotionManager.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.ngb.projectzulu.common.potion; - -import java.lang.reflect.Array; - -import net.minecraft.potion.Potion; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Configuration; -import com.ngb.projectzulu.common.api.PotionList; -import com.ngb.projectzulu.common.core.ObfuscationHelper; -import com.ngb.projectzulu.common.potion.effects.PotionCleansing; -import com.ngb.projectzulu.common.potion.effects.PotionCurse; -import com.ngb.projectzulu.common.potion.effects.PotionHarm2; -import com.ngb.projectzulu.common.potion.effects.PotionHeal2; -import com.ngb.projectzulu.common.potion.effects.PotionIncendiary; -import com.ngb.projectzulu.common.potion.effects.PotionSlowFall; -import com.ngb.projectzulu.common.potion.effects.PotionThorns; -import com.ngb.projectzulu.common.potion.effects.PotionZulu; - -import com.google.common.base.Optional; - -public enum PotionManager { - bubbling(21) { - @Override - protected void setupPotion() { - PotionList.bubbling = Optional.of((new PotionZulu(potionID, true, (165 << 16) + (131 << 8) + 70, 1, 2)) - .setPotionName("potion.shining")); - } - - @Override - protected void registerPotion() { - } - }, - incendiary(22) { - @Override - protected void setupPotion() { - PotionList.incendiary = Optional.of((new PotionIncendiary(potionID, true, (133 << 16) + (69 << 8) + 26)) - .setPotionName("potion.incendiary")); - } - - @Override - protected void registerPotion() { - } - }, - slowfall(23) { - @Override - protected void setupPotion() { - PotionList.slowfall = Optional.of((new PotionSlowFall(potionID, true, (214 << 16) + (214 << 8) + 214)) - .setPotionName("potion.slowfall")); - } - - @Override - protected void registerPotion() { - } - }, - cleansing(24) { - @Override - protected void setupPotion() { - PotionList.cleansing = Optional.of((new PotionCleansing(potionID, true, (141 << 16) + (153 << 8) + 79)) - .setPotionName("potion.cleansing")); - } - - @Override - protected void registerPotion() { - } - }, - curse(25) { - @Override - protected void setupPotion() { - PotionList.curse = Optional.of((new PotionCurse(potionID, true, (114 << 16) + (160 << 8) + 52)) - .setPotionName("potion.curse")); - } - - @Override - protected void registerPotion() { - } - }, - thorn(26) { - @Override - protected void setupPotion() { - PotionList.thorn = Optional.of((new PotionThorns(potionID, true, (18 << 16) + (133 << 8) + 34)) - .setPotionName("potion.thorn")); - } - - @Override - protected void registerPotion() { - } - }, - heal2(27) { - @Override - protected void setupPotion() { - PotionList.heal2 = Optional.of((new PotionHeal2(potionID, false).setPotionName("potion.heal2"))); - } - - @Override - protected void registerPotion() { - } - }, - harm2(28) { - @Override - protected void setupPotion() { - PotionList.harm2 = Optional.of((new PotionHarm2(potionID, true).setPotionName("potion.harm2"))); - } - - @Override - protected void registerPotion() { - } - }; - - int potionID; - public static boolean potionModuleEnabled = true; - public static boolean enableNullPotionHandler = true; - - protected abstract void setupPotion(); - - protected abstract void registerPotion(); - - PotionManager(int potionID) { - this.potionID = potionID; - } - - public static void loadSettings(Configuration config) { - potionModuleEnabled = config.get("Potion Controls", "Potion Module Enabled", potionModuleEnabled).getBoolean( - potionModuleEnabled); - enableNullPotionHandler = config.get("Potion Controls", "Enable Null Potion Handler", enableNullPotionHandler) - .getBoolean(enableNullPotionHandler); - for (PotionManager potion : PotionManager.values()) { - potion.potionID = config.get("Potion Controls." + potion.toString(), "PotionID", potion.potionID).getInt( - potion.potionID); - } - } - - public static void setupAndRegisterPotions() { - increaseVanillaPotionArray(64); - for (PotionManager potion : PotionManager.values()) { - if (potion.potionID > 0) { - potion.setupPotion(); - potion.registerPotion(); - } - } - - /** Register Events and Tickers Responsible for PotionEffect if appropriate potionEffects are declared */ - if (PotionList.cleansing.isPresent() || PotionList.thorn.isPresent()) { - MinecraftForge.EVENT_BUS.register(new PotionEventHookContainerClass()); - } - } - - private static void increaseVanillaPotionArray(int newSize) { - if (Potion.potionTypes.length < newSize) { - Potion[] a = Potion.potionTypes; - Class potionClass = a.getClass(); - if (potionClass.isArray()) { - int length = Array.getLength(a); - Class componentType = (Class) a.getClass().getComponentType(); - Potion[] newArray = (Potion[]) Array.newInstance(componentType, newSize); - System.arraycopy(a, 0, newArray, 0, length); - try { - ObfuscationHelper.setCatchableFieldUsingReflection("field_76425_a", Potion.class, Potion[].class, - false, true, newArray); - } catch (NoSuchFieldException e) { - ObfuscationHelper.setFieldUsingReflection("potionTypes", Potion.class, Potion[].class, false, true, - newArray); - } - } - } - } -} diff --git a/src/main/java/com/stek101/projectzulu/common/CommonProxyProjectZulu.java b/src/main/java/com/stek101/projectzulu/common/CommonProxyProjectZulu.java index 550e2a0..57d3f06 100644 --- a/src/main/java/com/stek101/projectzulu/common/CommonProxyProjectZulu.java +++ b/src/main/java/com/stek101/projectzulu/common/CommonProxyProjectZulu.java @@ -1,5 +1,7 @@ package com.stek101.projectzulu.common; +import java.io.File; + import net.minecraft.entity.player.EntityPlayer; public class CommonProxyProjectZulu { @@ -19,4 +21,9 @@ public void registerModelsAndRender() { } public EntityPlayer getClientPlayer() { return null; } + + // ========== Get Minecraft Directory ========== + public File getMinecraftDir() { + return new File("."); + } } diff --git a/src/main/java/com/stek101/projectzulu/common/DeathGamerules.java b/src/main/java/com/stek101/projectzulu/common/DeathGamerules.java index 76e5f31..156d608 100644 --- a/src/main/java/com/stek101/projectzulu/common/DeathGamerules.java +++ b/src/main/java/com/stek101/projectzulu/common/DeathGamerules.java @@ -159,14 +159,18 @@ private int handlePropMinMax(Property prop, int value, Integer min, Integer max) @SubscribeEvent public void worldLoad(WorldEvent.Load event) { GameRules gameRule = event.world.getGameRules(); - if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { - gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); - } + + // if (createGameruleIfAbsent(gameRule, "pzKeepInventory", keepInventoryDefault)) { + // System.out.println("******** pzKeepInventory rule is not present, creating it....."); + // + // gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); + // } //createGameruleIfAbsent(gameRule, "dropInventory", dropInventoryDefault); //createGameruleIfAbsent(gameRule, "dropHotbar", dropHotbarDefault); //createGameruleIfAbsent(gameRule, "dropArmor", dropArmorDefault); //createGameruleIfAbsent(gameRule, "dropXP", dropXPDefault); + gameRule.setOrCreateGameRule("keepInventory", Boolean.toString(keepInventoryDefault)); gameRule.setOrCreateGameRule("dropInventory", String.valueOf(dropInventoryDefault)); gameRule.setOrCreateGameRule("dropHotbar", String.valueOf(dropHotbarDefault)); gameRule.setOrCreateGameRule("dropArmor", String.valueOf(dropArmorDefault)); @@ -187,114 +191,130 @@ private boolean createGameruleIfAbsent(GameRules gameRule, String gameruleName, public void onPlayerDeath(PlayerDropsEvent event) { ArrayList drops = event.drops; int minDistance = 0; + Optional tombStoneBlock = BlockList.tombstone; - if (event.entity instanceof EntityPlayerMP) { - GameRules gameRules = event.entity.worldObj.getGameRules(); - - boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); - boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); - boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); - boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); - - String tombmsg =""; - EntityPlayer player = (EntityPlayer) event.entity; - - if (event.source.isExplosion()) { - minDistance = 10; - } - - TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player, minDistance) : null; - - if (tombstone != null) { - //tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); - tombstone.setSignString("HERE LIES " + event.source.func_151519_b((EntityPlayer) event.entity).getUnformattedTextForChat().toUpperCase()); - } - - /* Tombstone will not add drops */ - if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { - return; - } - - player.captureDrops = true; - //player.capturedDrops.clear(); - - /* Get items/XP to drop and clear them from Player */ - int xpDropped = 0; - - if (dropXP) { - if (!player.worldObj.isRemote) { - if (maxDropXP + percKeptXp > 100){ - ProjectZuluLog.warning("Warning : The total of MaxDropXP and percKeptXP is greater than 100. Resetting to default"); - maxDropXP = 100; - percKeptXp = 0; - } - //xpDropped = player.experienceTotal; - xpDropped = (int) (player.experienceTotal * ((float) maxDropXP/100)); - - int keptXp = (int) ((player.experienceTotal - xpDropped) * ((float) percKeptXp / 100)); - //xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; - - redistributor.addExperience(player, keptXp >= 0 ? keptXp : 0); - player.experienceLevel = 0; - player.experienceTotal = 0; - player.experience = 0; - } - } - - List itemsToDrop = new ArrayList(); - - if (dropArmor) { - itemsToDrop.addAll(dropArmor(player)); - } - - if (dropInventory) { - itemsToDrop.addAll(dropInventory(player)); - } - - if (dropHotbar) { - itemsToDrop.addAll(dropHotbar(player)); - } - - dropItems(player, itemsToDrop); - - boolean isCancelled = false; - - // Need to understand this lines more but so far feature repair is working... - // if (doDropEvent) { - // PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); - // isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); - // } - - player.captureDrops = false; - if (!isCancelled) { - /* Handler actually Dropping Items or Placing them in Tombstone */ - if (tombstoneAbsorbDrops && tombstone != null) { - for (EntityItem entityItem : player.capturedDrops) { - tombstone.addDrop(entityItem.getEntityItem()); - } - tombstone.experience = xpDropped; - player.capturedDrops.clear(); - } else { - if (tombstoneAbsorbDrops) { - System.out.println("Tombstone could not be placed so items dropping normally."); - ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); - } - while (xpDropped > 0) { - int j = EntityXPOrb.getXPSplit(xpDropped); - xpDropped -= j; - player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, - player.posZ, j)); - } - for (EntityItem item : player.capturedDrops) { - player.joinEntityItemWithWorld(item); - } - } - } else { - System.out.println("Tombstone drop event cancelled"); - ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." - + "Results may not desireable, consider disabling 'doDropEvent' in the config."); - } - } + if (tombStoneBlock.isPresent()) { + if (event.entity instanceof EntityPlayerMP) { + GameRules gameRules = event.entity.worldObj.getGameRules(); + + boolean dropInventory = gameRules.getGameRuleBooleanValue("dropInventory"); + boolean dropHotbar = gameRules.getGameRuleBooleanValue("dropHotbar"); + boolean dropArmor = gameRules.getGameRuleBooleanValue("dropArmor"); + boolean dropXP = gameRules.getGameRuleBooleanValue("dropXP"); + + String tombmsg =""; + EntityPlayer player = (EntityPlayer) event.entity; + + if (event.source.isExplosion()) { + minDistance = 10; + } + + TileEntityTombstone tombstone = tombstoneOnDeath ? placeTombstone(player, minDistance) : null; + + if (tombstone != null) { + //tombstone.setSignString(event.source.func_151519_b((EntityPlayer) event.entity).toString()); + tombstone.setSignString("HERE LIES " + event.source.func_151519_b((EntityPlayer) event.entity).getUnformattedTextForChat().toUpperCase()); + } + + /* Tombstone will not add drops */ + if (!dropInventory && !dropHotbar && !dropArmor && !dropXP) { + return; + } + + player.captureDrops = true; + //player.capturedDrops.clear(); + + /* Get items/XP to drop and clear them from Player */ + int xpDropped = 0; + + if (dropXP) { + if (!player.worldObj.isRemote) { + if ((maxDropXP > 100) && (maxDropXP < 0)){ + ProjectZuluLog.warning("Warning : The value of MaxDropXP is INVALID. Resetting to default value of 100"); + maxDropXP = 100; + } + + if ((percKeptXp > 100) && (percKeptXp < 0)){ + ProjectZuluLog.warning("Warning : The value of percKeptXp is INVALID. Resetting to default value of 0"); + percKeptXp = 0; + } + + //xpDropped = player.experienceTotal; + //System.out.println("total player xp on death : " + player.experienceTotal); + + xpDropped = (int) (player.experienceTotal * ((float) maxDropXP/100)); + + //System.out.println("total player xp to drop : " + xpDropped ); + //System.out.println("subtotal player xp minus xpDropped : " + (player.experienceTotal - xpDropped)); + //System.out.println("player kepXp percent : " + ((float) percKeptXp / 100)); + + int keptXp = (int) ((player.experienceTotal - xpDropped) * ((float) percKeptXp / 100)); + //xpDropped = xpDropped > maxDropXP ? maxDropXP : xpDropped; + + //System.out.println("total player xp to keep : " + keptXp ); + + redistributor.addExperience(player, keptXp >= 0 ? keptXp : 0); + player.experienceLevel = 0; + player.experienceTotal = 0; + player.experience = 0; + } + } + + List itemsToDrop = new ArrayList(); + + if (dropArmor) { + itemsToDrop.addAll(dropArmor(player)); + } + + if (dropInventory) { + itemsToDrop.addAll(dropInventory(player)); + } + + if (dropHotbar) { + itemsToDrop.addAll(dropHotbar(player)); + } + + dropItems(player, itemsToDrop); + + boolean isCancelled = false; + + // Need to understand this lines more but so far feature repair is working... + // if (doDropEvent) { + // PlayerDropsEvent dropEvent = createPlayerDropEvent(player, event.source, player.capturedDrops); + // isCancelled = MinecraftForge.EVENT_BUS.post(dropEvent); + // } + + player.captureDrops = false; + if (!isCancelled) { + /* Handler actually Dropping Items or Placing them in Tombstone */ + if (tombstoneAbsorbDrops && tombstone != null) { + for (EntityItem entityItem : player.capturedDrops) { + tombstone.addDrop(entityItem.getEntityItem()); + } + tombstone.experience = xpDropped; + player.capturedDrops.clear(); + } else { + if (tombstoneAbsorbDrops) { + System.out.println("Tombstone could not be placed so items dropping normally."); + ProjectZuluLog.warning("Tombstone could not be placed so items dropping normally."); + } + while (xpDropped > 0) { + int j = EntityXPOrb.getXPSplit(xpDropped); + xpDropped -= j; + player.worldObj.spawnEntityInWorld(new EntityXPOrb(player.worldObj, player.posX, player.posY, + player.posZ, j)); + } + for (EntityItem item : player.capturedDrops) { + player.joinEntityItemWithWorld(item); + } + } + } else { + System.out.println("Tombstone drop event cancelled"); + ProjectZuluLog.warning("Player drop event was cancelled, so items will not be dropped per convention." + + "Results may not desireable, consider disabling 'doDropEvent' in the config."); + } + } + } } private void dropItems(EntityPlayer player, List drops) { @@ -514,7 +534,6 @@ private List dropInventory(EntityPlayer player) { player.inventory.mainInventory[slot] = null; countDrops++; } - } } return itemsToDrop; diff --git a/src/main/java/com/stek101/projectzulu/common/KeyHandler.java b/src/main/java/com/stek101/projectzulu/common/KeyHandler.java new file mode 100644 index 0000000..43ea262 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/KeyHandler.java @@ -0,0 +1,54 @@ +package com.stek101.projectzulu.common; + +import net.minecraft.client.Minecraft; + +import com.stek101.projectzulu.common.mobs.packets.PZPacketKeyBind; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.InputEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + + +public class KeyHandler { + //public static KeyBinding mount_jump; + //public static KeyBinding mount_inv; + private PZPacketKeyBind message; + private Minecraft mc; + public static KeyHandler instance; + + public KeyHandler(){ + instance = this; + //mount_jump = new KeyBinding("key.ping", Keyboard.KEY_0, "key.categories.pz"); + // Define the "pong" binding, with (unlocalized) name "key.pong" and + // the category with (unlocalized) name "key.categories.mymod" and + // key code 25 ("P", LWJGL constant: Keyboard.KEY_P) + //mount_inv = new KeyBinding("key.pong", Keyboard.KEY_P, "key.categories.pz"); + + // Register both KeyBindings to the ClientRegistry + //ClientRegistry.registerKeyBinding(mount_jump); + //ClientRegistry.registerKeyBinding(mount_inv); + } + + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onKeyInput(InputEvent.KeyInputEvent event) { + if(Minecraft.getMinecraft().inGameHasFocus) { + if(Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed()) + { + message = new PZPacketKeyBind().setPacketData("jump", 90); + ProjectZulu_Core.packetHandler.sendToServer(message); + } + if(Minecraft.getMinecraft().gameSettings.keyBindInventory.getIsKeyPressed()){ + message = new PZPacketKeyBind().setPacketData("inventory", 0); + ProjectZulu_Core.packetHandler.sendToServer(message); + } + if(Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed()){ + message = new PZPacketKeyBind().setPacketData("dismount", 0); + ProjectZulu_Core.packetHandler.sendToServer(message); + } + + } + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Blocks.java b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Blocks.java index f429674..6c9b777 100644 --- a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Blocks.java +++ b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Blocks.java @@ -51,6 +51,7 @@ import com.stek101.projectzulu.common.blocks.itemblockdeclarations.ScaleItemDeclaration; import com.stek101.projectzulu.common.blocks.itemblockdeclarations.ScrapMeatDeclaration; import com.stek101.projectzulu.common.blocks.itemblockdeclarations.SpikesDeclaration; +import com.stek101.projectzulu.common.blocks.itemblockdeclarations.ThrowingRockDeclaration; import com.stek101.projectzulu.common.blocks.itemblockdeclarations.TombstoneDeclaration; import com.stek101.projectzulu.common.blocks.itemblockdeclarations.TumbleweedDeclaration; import com.stek101.projectzulu.common.blocks.itemblockdeclarations.UniversalFlowerPotDeclaration; @@ -85,8 +86,7 @@ public String getIdentifier() { @Override public void registration(ItemBlockManager manager) { - - + manager.addItemBlock(new AloeVeraDeclaration(), new WateredDirtDeclaration(), new TumbleweedDeclaration(), new JasperDeclaration(), new PalmTreeLogDeclaration(), new PalmTreePlankDeclaration(), new PalmTreeSlabDeclaration(), new PalmTreeDoubleSlabDeclaration(), new PalmTreeStairsDeclaration(), @@ -101,7 +101,7 @@ public void registration(ItemBlockManager manager) { new CoconutMilkFragmentDeclaration(), new CoconutSeedDeclaration(), new CoconutShellDeclaration(), new ScaleItemDeclaration(), new FurPeltDeclaration(), new GenericCraftingItemsDeclaration(), new CoconutItem(), new ScrapMeatDeclaration(), new RawMuttonDeclaration(), new CookedMuttonDeclaration(), - new DuckEggDeclaration(), new OstrichEggDeclaration(), new CoconutShellFuelDeclaration()); + new DuckEggDeclaration(), new OstrichEggDeclaration(), new CoconutShellFuelDeclaration(), new ThrowingRockDeclaration()); manager.addItemBlock(new ScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("scaleArmor")), new GoldScaleArmorDeclaration(ProjectZulu_Core.proxy.addArmor("goldscale")), @@ -142,6 +142,7 @@ public void preInit(FMLPreInitializationEvent event, File configDirectory) { @Override public void postInit(FMLPostInitializationEvent event, File configDirectory) { + ItemBlockRecipeManager.setupBlockModuleRecipies(); if (!PotionManager.potionModuleEnabled) { @@ -157,6 +158,7 @@ public void postInit(FMLPostInitializationEvent event, File configDirectory) { if (PotionManager.enableNullPotionHandler) { MinecraftForge.EVENT_BUS.register(new EventHandleNullPotions()); } + } @Override diff --git a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Core.java b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Core.java index 8333b81..b4d8822 100644 --- a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Core.java +++ b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Core.java @@ -24,6 +24,7 @@ import com.stek101.projectzulu.common.core.network.PZPacketHandler; import com.stek101.projectzulu.common.core.terrain.FeatureGenerator; +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; @@ -51,6 +52,7 @@ public static int getNextDefaultEggID() { public static final CreativeTabs projectZuluCreativeTab = new CreativePZGeneralTab( CreativeTabs.creativeTabArray.length, "projectZuluTab"); + public static final CreativeTabs projectZuluPotionTab = new CreativePZPotionTab( CreativeTabs.creativeTabArray.length, "projectZuluPotionTab"); @@ -115,6 +117,7 @@ public String getIdentifier() { @EventHandler public void preInit(FMLPreInitializationEvent event) { + //if (checkForUpdates) // UpdateMonitor.checkForUpdates(); //FMLCommonHandler.instance().bus().register(new UpdateEventHandler()); @@ -206,6 +209,11 @@ public void load(FMLInitializationEvent event) { moduleInfo.module.init(event, modConfigDirectoryFile); } } + FMLCommonHandler.instance().bus().register(new KeyHandler()); + //register the reto gen here + //FMLCommonHandler.instance().bus().register(new RetroactiveWorldGenerator()); + //MinecraftForge.EVENT_BUS.register(new RetroactiveWorldGenerator()); + } @EventHandler diff --git a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Dungeon.java b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Dungeon.java index 66232e2..b244356 100644 --- a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Dungeon.java +++ b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Dungeon.java @@ -4,6 +4,8 @@ import net.minecraftforge.common.MinecraftForge; +import com.google.common.base.Optional; +import com.stek101.projectzulu.common.api.BlockList; import com.stek101.projectzulu.common.core.DefaultProps; import com.stek101.projectzulu.common.core.ItemBlockManager; import com.stek101.projectzulu.common.dungeon.commands.CommandPlaceBlock; @@ -16,7 +18,8 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; public class ProjectZulu_Dungeon extends BaseModule { - + Optional itemBlock = BlockList.tombstone; + @Override public String getIdentifier() { return DefaultProps.DungeonModId; diff --git a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Mobs.java b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Mobs.java index 74bce20..8920fb5 100644 --- a/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Mobs.java +++ b/src/main/java/com/stek101/projectzulu/common/ProjectZulu_Mobs.java @@ -3,6 +3,7 @@ import java.io.File; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Configuration; import com.stek101.projectzulu.common.core.CustomEntityManager; import com.stek101.projectzulu.common.core.DefaultProps; @@ -13,8 +14,12 @@ import com.stek101.projectzulu.common.mobs.entitydefaults.BearBrownDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.BearPolarDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.BeaverDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleASDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BeetleBSDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.BloomDoomDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.BlueFinchDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.BoarDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.CamelDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.CentipedeDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.CrowDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.DeerDeclaration; @@ -35,15 +40,16 @@ import com.stek101.projectzulu.common.mobs.entitydefaults.HauntedArmorDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.HornbillDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.HorseBlackDeclaration; -import com.stek101.projectzulu.common.mobs.entitydefaults.HorseRandomDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.LizardDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.LizardSpitDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.MammothDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.MimicDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.MinotaurDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.MonkeyDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.MummyDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.OstrichEggDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.PZBatDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.PelicanDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.PenguinDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.PharaohDeclaration; @@ -53,14 +59,22 @@ import com.stek101.projectzulu.common.mobs.entitydefaults.RipperFinDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.SandwormDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.SkeletonnDeclaration; +import com.stek101.projectzulu.common.mobs.entitydefaults.ThrowingRockDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.TreeEntDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.VultureDeclaration; import com.stek101.projectzulu.common.mobs.entitydefaults.YellowFinchDeclaration; import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class ProjectZulu_Mobs extends BaseModule { - + private Configuration config; + private boolean bugRelease = false; + private boolean stickSpawn = true; + private int bugReleaseRate = 5; + private int stickSpawnRate = 5; + + @Override public String getIdentifier() { return DefaultProps.MobsModId; @@ -81,12 +95,13 @@ public void registration(CustomEntityManager manager) { //new HorseDarkBrownDeclaration(), new HorseGreyDeclaration(), new HorseWhiteDeclaration(), new EagleDeclaration(), new HornbillDeclaration(), new PelicanDeclaration(), new MinotaurDeclaration(), new HauntedArmorDeclaration(), new CentipedeDeclaration(), new FollowerDeclaration(), - new HorseRandomDeclaration(), new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), + new YellowFinchDeclaration(), new GoatDeclaration(), new DuckDeclaration(), new DuckEggDeclaration(), new DeerDeclaration(), new SkeletonnDeclaration(), new FishADeclaration(), new RipperFinDeclaration(), new OstrichEggDeclaration(), new GiantRatDeclaration(), new FishBDeclaration(), - new CrowDeclaration()); + new CrowDeclaration(), new CamelDeclaration(), new MonkeyDeclaration(), new ThrowingRockDeclaration(), // new AntRavegerDeclaration(), + new BeetleASDeclaration(), new BeetleBSDeclaration(), new BloomDoomDeclaration(), new PZBatDeclaration()); } - + @Override public void init(FMLInitializationEvent event, File configDirectory) { MinecraftForge.EVENT_BUS.register(new ChangeVanillaDrops()); diff --git a/src/main/java/com/stek101/projectzulu/common/api/CustomEntityList.java b/src/main/java/com/stek101/projectzulu/common/api/CustomEntityList.java index 53d0f8d..a6ab13e 100644 --- a/src/main/java/com/stek101/projectzulu/common/api/CustomEntityList.java +++ b/src/main/java/com/stek101/projectzulu/common/api/CustomEntityList.java @@ -13,10 +13,9 @@ public enum CustomEntityList { CREEPERBLOSSOMPRIMED, ARMADILLO, SANDWORM, LIZARD, MUMMYPHARAOH, MUMMY, VULTURE, TREEENT, MAMMOTH, FOX, BOAR, MIMIC, ALLIGATOR, FROG, PENGUIN, BEAVER, BLACKBEAR, BROWNBEAR, POLARBEAR, OSTRICH, RHINO, RABBIT, - REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSEBEIGE, HORSEBLACK, HORSEBROWN, - HORSEDARKBLACK, HORSEDARKBROWN, HORSEGREY, HORSEWHITE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, + REDFINCH, BLUEFINCH, GREENFINCH, GORILLA, GIRAFFE, ELEPHANT, HORSE, EAGLE, HORNBILL, PELICAN, MINOTAUR, HAUNTEDARMOR, CENTIPEDE, HORSERANDOM, LIZARDSPIT, FOLLOWER, YELLOWFINCH, GOAT, DUCK, DUCKEGG, DEER, SKELETONN, FISHA, RIPPERFIN, - OSTRICHEGG, GIANTRAT, FISHB, CROW; + OSTRICHEGG, GIANTRAT, FISHB, CROW, CAMEL, MONKEY, THROWINGROCK, RAVAGERANT, BEETLEAS, BEETLEBS, BLOOMDOOM, PZBAT; public Optional modData = Optional.absent(); private static final HashMap lookupEnum = new HashMap(); diff --git a/src/main/java/com/stek101/projectzulu/common/api/ItemList.java b/src/main/java/com/stek101/projectzulu/common/api/ItemList.java index 52b4b72..851cc8c 100644 --- a/src/main/java/com/stek101/projectzulu/common/api/ItemList.java +++ b/src/main/java/com/stek101/projectzulu/common/api/ItemList.java @@ -38,6 +38,7 @@ public enum ItemList { public static Optional hammerToolDiamond = Optional.absent(); public static Optional hammerToolGold = Optional.absent(); public static Optional xpGem = Optional.absent(); + public static Optional throwingRock = Optional.absent(); /* Armor */ public static Optional scaleArmorHead = Optional.absent(); diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/BlockAloeVera.java b/src/main/java/com/stek101/projectzulu/common/blocks/BlockAloeVera.java index 55c01d1..8d473a4 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/BlockAloeVera.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/BlockAloeVera.java @@ -20,8 +20,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockAloeVera extends BlockBush { - public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", +public class BlockAloeVera extends BlockBush{ + + public static final String[] imageSuffix = new String[] { "_b0", "_b1", "_b2", "_b3", "_t0", "_t1", "_t2", "_t3", "_t4" }; @SideOnly(Side.CLIENT) private IIcon[] blockIcons; @@ -30,7 +31,7 @@ public BlockAloeVera() { super(Material.plants); setTickRandomly(true); disableStats(); - setHardness(0); + setHardness(0.0F); setStepSound(Block.soundTypeGrass); } @@ -262,4 +263,5 @@ protected boolean canPlaceBlockOn(Block block) { return block == Blocks.grass || block == Blocks.dirt || block == Blocks.farmland || block == Blocks.sand || block == BlockList.aloeVera.get(); } + } diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/BlockCampfire.java b/src/main/java/com/stek101/projectzulu/common/blocks/BlockCampfire.java index c04819b..43a68a3 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/BlockCampfire.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/BlockCampfire.java @@ -70,7 +70,7 @@ public static Type getTypeByMeta(int meta) { public final int renderID; public BlockCampfire(int renderID) { - super(Material.wood); + super(Material.wood); setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); setTickRandomly(true); setBlockBounds(0f, 0.0F, 0.0f, 1.0f, 0.35f, 1.0f); @@ -198,7 +198,11 @@ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, E if (par5EntityPlayer.getCurrentEquippedItem() != null) { /* If Fire is not Lit and Coal is in Hand, Light Fire */ if (par1World.getBlockMetadata(par2, par3, par4) < 2 - && (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel)) { + && ( + (par5EntityPlayer.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(Blocks.torch)) + || + (par5EntityPlayer.getCurrentEquippedItem().getItem() == Items.flint_and_steel) + )) { if (!par5EntityPlayer.capabilities.isCreativeMode) { par5EntityPlayer.getCurrentEquippedItem().stackSize -= 1; } diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/ItemHammerTool.java b/src/main/java/com/stek101/projectzulu/common/blocks/ItemHammerTool.java index e20eb8c..332085d 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/ItemHammerTool.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/ItemHammerTool.java @@ -21,21 +21,20 @@ import com.stek101.projectzulu.common.api.BlockList; import com.stek101.projectzulu.common.core.DefaultProps; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.Side; - public class ItemHammerTool extends ItemTool { public float weaponDamage; private final Item.ToolMaterial material; + private boolean canHarvestBlocks; + private static final Set field_150915_c = Sets.newHashSet(new Block[] {Blocks.cobblestone, Blocks.double_stone_slab, Blocks.stone_slab, - Blocks.stone, Blocks.sandstone, Blocks.mossy_cobblestone, Blocks.iron_ore, Blocks.iron_block, - Blocks.coal_ore, Blocks.gold_block, Blocks.gold_ore, Blocks.diamond_ore, Blocks.diamond_block, Blocks.ice, Blocks.netherrack, - Blocks.lapis_ore, Blocks.lapis_block, Blocks.redstone_ore, Blocks.lit_redstone_ore, Blocks.rail, Blocks.detector_rail, - Blocks.golden_rail, Blocks.activator_rail, Blocks.crafting_table, Blocks.furnace, Blocks.chest, Blocks.planks, Blocks.bookshelf, Blocks.log, - Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin}); - //private static final Set field_150915_c = Sets.newHashSet(new Block[] {}); + Blocks.sandstone, Blocks.ladder, Blocks.stone_stairs, Blocks.oak_stairs, Blocks.acacia_stairs, Blocks.birch_stairs, + Blocks.spruce_stairs, Blocks.jungle_stairs, Blocks.dark_oak_stairs, Blocks.wooden_slab, Blocks.sandstone_stairs, Blocks.fence, + Blocks.fence_gate, Blocks.anvil, Blocks.brick_stairs, Blocks.cauldron, Blocks.cobblestone_wall, Blocks.double_wooden_slab, + Blocks.enchanting_table, Blocks.flower_pot, Blocks.iron_door, Blocks.jukebox, Blocks.wooden_door, Blocks.trapdoor, Blocks.wooden_pressure_plate, + Blocks.stone_pressure_plate, Blocks.rail, Blocks.wall_sign, Blocks.standing_sign, Blocks.bed, + Blocks.crafting_table, Blocks.furnace, Blocks.chest, Blocks.bookshelf, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin}); - public ItemHammerTool(String name, ToolMaterial mat) { + public ItemHammerTool(String name, ToolMaterial mat, boolean canHarvestBlocks) { super(1.0F, mat, field_150915_c); this.material = mat; this.maxStackSize = 1; @@ -45,249 +44,270 @@ public ItemHammerTool(String name, ToolMaterial mat) { setUnlocalizedName(name.toLowerCase()); setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); this.weaponDamage = 1.0f + mat.getDamageVsEntity(); - + this.canHarvestBlocks = canHarvestBlocks; + } + + @Override + public boolean func_150897_b(Block p_150897_1_) + { + return p_150897_1_ == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : + (p_150897_1_ != Blocks.diamond_block + && p_150897_1_ != Blocks.diamond_ore ? (p_150897_1_ != Blocks.emerald_ore && p_150897_1_ != Blocks.emerald_block ? (p_150897_1_ != Blocks.gold_block + && p_150897_1_ != Blocks.gold_ore ? (p_150897_1_ != Blocks.iron_block && p_150897_1_ != Blocks.iron_ore ? (p_150897_1_ != Blocks.lapis_block + && p_150897_1_ != Blocks.lapis_ore ? (p_150897_1_ != Blocks.redstone_ore && p_150897_1_ != Blocks.lit_redstone_ore ? (p_150897_1_.getMaterial() == + Material.rock ? true : (p_150897_1_.getMaterial() == Material.iron ? true : p_150897_1_.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : + this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : + this.toolMaterial.getHarvestLevel() >= 2); } @Override public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) { - return p_150893_2_.getMaterial() != Material.wood && p_150893_2_.getMaterial() != Material.plants && p_150893_2_.getMaterial() != Material.vine && - p_150893_2_.getMaterial() != Material.iron && p_150893_2_.getMaterial() != Material.anvil && - p_150893_2_.getMaterial() != Material.rock ? super.func_150893_a(p_150893_1_, p_150893_2_) : this.efficiencyOnProperMaterial; - - /*if (p_150893_2_ == Blocks.web) - { - return 15.0F; + float harvestSpeed = 1.0f; + + if (p_150893_2_.getMaterial() == Material.iron && p_150893_2_.getMaterial() == Material.anvil){ + harvestSpeed = 0.80f; + } + else if ( p_150893_2_.getMaterial() == Material.rock) { + harvestSpeed = 1.0f; + } + else if ( p_150893_2_.getMaterial() == Material.wood) { + harvestSpeed = 1.2f; } else - { - Material var3 = p_150893_2_.getMaterial(); - return var3 != Material.plants && var3 != Material.vine && var3 != Material.coral && var3 != Material.leaves && var3 != Material.plants ? 1.0F : 1.5F; - }*/ + harvestSpeed = 2.0f; + //super.func_150893_a(p_150893_1_, p_150893_2_) + //: this.efficiencyOnProperMaterial; + return harvestSpeed; } - + /** * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise * the damage on the stack. */ @Override - public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) - { + public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) + { p_77644_1_.damageItem(2, p_77644_3_); //p_77644_2_.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 80, 99)); return true; } - @Override - - public boolean onBlockDestroyed(ItemStack itemstack, World p_150894_2_, Block block, int x, int y, int z, EntityLivingBase entityLivingBase) - { - if ((double)block.getBlockHardness(p_150894_2_, x, y, z) != 0.0D) - { - EntityPlayer entityplayer = ProjectZulu_Core.proxy.getClientPlayer(); - itemstack.damageItem(1, entityLivingBase); - - World world = entityLivingBase.worldObj; - - boolean clearBlock = false; - Side side = FMLCommonHandler.instance().getEffectiveSide(); - - if (side == Side.SERVER && !entityplayer.capabilities.isCreativeMode) { - //entityplayer.addStat(StatList.mineBlockStatArray[world.getBlock(x, y, z).getIdFromBlock(world.getBlock(x, y, z))], 1); - - entityplayer.addExhaustion(0.025F); - world.playAuxSFX(2001, x, y, z, world.getBlock(x, y, z).getIdFromBlock(world.getBlock(x, y, z)) + (world.getBlockMetadata(x, y, z) << 12)); - - if (itemstack.getItemDamage() < itemstack.getMaxDamage()) { - Random randomGen = new Random(); - ItemStack itemstack1 = null; - ItemStack itemstack2 = null; - ItemStack itemstack3 = null; - //System.out.println("material name for hammer is" + material.name()); - //System.out.println("block hit is " + world.getBlock(x, y, z)); - - if (world.getBlock(x, y, z).equals(Blocks.cobblestone)) { - itemstack1 = new ItemStack(Blocks.gravel, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.crafting_table)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(3) + 2); - //clearBlock = true; - } - else if (world.getBlock(x, y, z).equals(Blocks.furnace)) { - itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(5) + 4); - } - else if (world.getBlock(x, y, z).equals(Blocks.chest)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(5) + 4); - //clearBlock = true; - } - else if (world.getBlock(x, y, z).equals(Blocks.ladder)) { - itemstack1 = new ItemStack(Items.stick, randomGen.nextInt(2) + 1); - //clearBlock= true; - } - else if (world.getBlock(x, y, z).equals(Blocks.stone_stairs)) { - itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(3) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.oak_stairs)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 0); - } - else if (world.getBlock(x, y, z).equals(Blocks.acacia_stairs)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 4); - } - else if (world.getBlock(x, y, z).equals(Blocks.birch_stairs)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 2); - } - else if (world.getBlock(x, y, z).equals(Blocks.spruce_stairs)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.jungle_stairs)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 3); - } - else if (world.getBlock(x, y, z).equals(Blocks.dark_oak_stairs)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 5); - } - else if (world.getBlock(x, y, z).equals(Blocks.wooden_slab)) { - itemstack1 = new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE); - } - else if (world.getBlock(x, y, z).equals(Blocks.stone_slab)) { - itemstack1 = new ItemStack(Blocks.cobblestone, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.sandstone_stairs)) { - itemstack1 = new ItemStack(Blocks.sandstone, randomGen.nextInt(2) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.fence)) { - itemstack1 = new ItemStack(Items.stick, randomGen.nextInt(3) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.fence_gate)) { - itemstack1 = new ItemStack(Items.stick, randomGen.nextInt(3) + 1); - itemstack2 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.anvil)) { - itemstack1 = new ItemStack(Blocks.iron_block, randomGen.nextInt(3) + 1); - itemstack2 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.bookshelf)) { - itemstack1 = new ItemStack(Items.book, randomGen.nextInt(3) + 1); - itemstack2 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 3); - } - else if (world.getBlock(x, y, z).equals(Blocks.brick_stairs)) { - itemstack2 = new ItemStack(Blocks.brick_block, randomGen.nextInt(2) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.cauldron)) { - itemstack1 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4) + 4); - } - else if (world.getBlock(x, y, z).equals(Blocks.cobblestone_wall)) { - itemstack1 = new ItemStack(Blocks.cobblestone, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.double_stone_slab)) { - itemstack1 = new ItemStack(Items.diamond, randomGen.nextInt(4) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.double_wooden_slab)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 1, OreDictionary.WILDCARD_VALUE); - } - else if (world.getBlock(x, y, z).equals(Blocks.enchanting_table)) { - itemstack1 = new ItemStack(Items.diamond, randomGen.nextInt(2) + 1); - itemstack2 = new ItemStack(Blocks.obsidian, randomGen.nextInt(3) + 2); - itemstack3 = new ItemStack(Items.book, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.flower_pot)) { - itemstack1 = new ItemStack(Items.brick, randomGen.nextInt(3) + 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.iron_door)) { - itemstack1 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4) + 3); - } - else if (world.getBlock(x, y, z).equals(Blocks.jukebox)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(5) + 4); - itemstack2 = new ItemStack(Items.diamond, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.trapdoor)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 3); - } - else if (world.getBlock(x, y, z).equals(Blocks.wooden_pressure_plate)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2)+1); - } - else if (world.getBlock(x, y, z).equals(Blocks.stone_pressure_plate)) { - itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(2)+1); - } - else if (world.getBlock(x, y, z).equals(Blocks.rail)) { - itemstack1 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4)+ 3); - itemstack2 = new ItemStack(Items.stick, 1); - } - else if ((world.getBlock(x, y, z).equals(Blocks.wall_sign)) || (world.getBlock(x, y, z).equals(Blocks.standing_sign))) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4)+ 3); - itemstack2 = new ItemStack(Items.stick, 1); - } - else if (world.getBlock(x, y, z).equals(Blocks.bed)) { - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2)+ 2); - itemstack2 = new ItemStack(Blocks.wool, randomGen.nextInt(2)+ 2); - } - else if (world.getBlock(x, y, z).equals(BlockList.tombstone.get())) { - itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(5)+ 4); - itemstack2 = new ItemStack(Items.sign, 1); - } - else if (world.getBlock(x, y, z).equals(BlockList.palmTreeDoubleSlab.get())) { - Block itemBlockx = BlockList.palmTreeSlab.get(); - itemstack1 = new ItemStack(itemBlockx, 1); - } - else if (world.getBlock(x, y, z).equals(BlockList.palmTreeSlab.get())) { - Block itemBlockx = BlockList.palmTreePlank.get(); - itemstack1 = new ItemStack(itemBlockx, randomGen.nextInt(2)+ 1); - } - else if (world.getBlock(x, y, z).equals(BlockList.campfire.get())) { - int blockMetaData = world.getBlockMetadata(x, y, z); - //System.out.println("meta of campfire is " + blockMetaData); - if (blockMetaData == 0){ - itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(3)+ 1, OreDictionary.WILDCARD_VALUE ); - itemstack2 = new ItemStack(Items.coal, 1, OreDictionary.WILDCARD_VALUE ); - } - else if (blockMetaData == 1){ - itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(2)+ 1); - itemstack2 = new ItemStack(Items.coal, 1, OreDictionary.WILDCARD_VALUE ); - } - } - - if (itemstack1 != null){ - double xrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - double yrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - double zrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - EntityItem itemDrop1 = new EntityItem(world, (double) x + xrand, (double) y + yrand, (double) z + zrand, itemstack1); - itemDrop1.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(itemDrop1); - } - - if (itemstack2 != null){ - double xrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - double yrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - double zrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - EntityItem itemDrop2 = new EntityItem(world, (double) x + xrand, (double) y + yrand, (double) z + zrand, itemstack2); - itemDrop2.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(itemDrop2); - } - - if (itemstack3 != null){ - double xrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - double yrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - double zrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; - EntityItem itemDrop3 = new EntityItem(world, (double) x + xrand, (double) y + yrand, (double) z + zrand, itemstack3); - itemDrop3.delayBeforeCanPickup = 10; - world.spawnEntityInWorld(itemDrop3); - } + @Override + public boolean onBlockDestroyed(ItemStack itemstack, World p_150894_2_, Block block, int x, int y, int z, EntityLivingBase entityLivingBase) + { + if ((double)block.getBlockHardness(p_150894_2_, x, y, z) != 0.0D) + { + EntityPlayer entityplayer = ProjectZulu_Core.proxy.getClientPlayer(); + //EntityPlayer entityplayer = Minecraft.getMinecraft().thePlayer; + itemstack.damageItem(1, entityLivingBase); + + World world = entityLivingBase.worldObj; + + boolean clearBlock = true; + //Side side = FMLCommonHandler.instance().getEffectiveSide(); + if(!world.isRemote){ + //if (!entityplayer.capabilities.isCreativeMode) { + //entityplayer.addStat(StatList.mineBlockStatArray[world.getBlock(x, y, z).getIdFromBlock(world.getBlock(x, y, z))], 1); + + //entityplayer.addExhaustion(0.025F); + world.playAuxSFX(2001, x, y, z, world.getBlock(x, y, z).getIdFromBlock(world.getBlock(x, y, z)) + (world.getBlockMetadata(x, y, z) << 12)); + + if (itemstack.getItemDamage() < itemstack.getMaxDamage()) { + Random randomGen = new Random(); + ItemStack itemstack1 = null; + ItemStack itemstack2 = null; + ItemStack itemstack3 = null; + //System.out.println("material name for hammer is" + material.name()); + //System.out.println("block hit is " + world.getBlock(x, y, z)); + + if (world.getBlock(x, y, z).equals(Blocks.cobblestone)) { + itemstack1 = new ItemStack(Blocks.gravel, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.sandstone)) { + itemstack1 = new ItemStack(Blocks.sand, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.crafting_table)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(3) + 2); + } + else if (world.getBlock(x, y, z).equals(Blocks.furnace)) { + itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(5) + 4); + } + else if (world.getBlock(x, y, z).equals(Blocks.chest)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(5) + 4); + } + else if (world.getBlock(x, y, z).equals(Blocks.ladder)) { + itemstack1 = new ItemStack(Items.stick, randomGen.nextInt(2) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.stone_stairs)) { + itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(3) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.oak_stairs)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 0); + } + else if (world.getBlock(x, y, z).equals(Blocks.acacia_stairs)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 4); + } + else if (world.getBlock(x, y, z).equals(Blocks.birch_stairs)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 2); + } + else if (world.getBlock(x, y, z).equals(Blocks.spruce_stairs)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.jungle_stairs)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 3); + } + else if (world.getBlock(x, y, z).equals(Blocks.dark_oak_stairs)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1, 5); + } + else if (world.getBlock(x, y, z).equals(Blocks.wooden_slab)) { + itemstack1 = new ItemStack(Blocks.planks, 1, OreDictionary.WILDCARD_VALUE); + } + else if (world.getBlock(x, y, z).equals(Blocks.stone_slab)) { + itemstack1 = new ItemStack(Blocks.cobblestone, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.sandstone_stairs)) { + itemstack1 = new ItemStack(Blocks.sandstone, randomGen.nextInt(2) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.fence)) { + itemstack1 = new ItemStack(Items.stick, randomGen.nextInt(3) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.fence_gate)) { + itemstack1 = new ItemStack(Items.stick, randomGen.nextInt(3) + 1); + itemstack2 = new ItemStack(Blocks.planks, randomGen.nextInt(2) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.anvil)) { + itemstack1 = new ItemStack(Blocks.iron_block, randomGen.nextInt(3) + 1); + itemstack2 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.bookshelf)) { + itemstack1 = new ItemStack(Items.book, randomGen.nextInt(3) + 1); + itemstack2 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 3); + } + else if (world.getBlock(x, y, z).equals(Blocks.brick_stairs)) { + itemstack2 = new ItemStack(Blocks.brick_block, randomGen.nextInt(2) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.cauldron)) { + itemstack1 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4) + 4); + } + else if (world.getBlock(x, y, z).equals(Blocks.cobblestone_wall)) { + itemstack1 = new ItemStack(Blocks.cobblestone, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.double_stone_slab)) { + itemstack1 = new ItemStack(Items.diamond, randomGen.nextInt(4) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.double_wooden_slab)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 1, OreDictionary.WILDCARD_VALUE); + } + else if (world.getBlock(x, y, z).equals(Blocks.enchanting_table)) { + itemstack1 = new ItemStack(Items.diamond, randomGen.nextInt(2) + 1); + itemstack2 = new ItemStack(Blocks.obsidian, randomGen.nextInt(3) + 2); + itemstack3 = new ItemStack(Items.book, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.flower_pot)) { + itemstack1 = new ItemStack(Items.brick, randomGen.nextInt(3) + 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.iron_door)) { + itemstack1 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4) + 3); + } + else if (world.getBlock(x, y, z).equals(Blocks.wooden_door)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 3, OreDictionary.WILDCARD_VALUE); + } + else if (world.getBlock(x, y, z).equals(Blocks.jukebox)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(5) + 4); + itemstack2 = new ItemStack(Items.diamond, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.trapdoor)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4) + 3); + } + else if (world.getBlock(x, y, z).equals(Blocks.wooden_pressure_plate)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2)+1); + } + else if (world.getBlock(x, y, z).equals(Blocks.stone_pressure_plate)) { + itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(2)+1); + } + else if (world.getBlock(x, y, z).equals(Blocks.rail)) { + itemstack1 = new ItemStack(Items.iron_ingot, randomGen.nextInt(4)+ 3); + itemstack2 = new ItemStack(Items.stick, 1); + } + else if ((world.getBlock(x, y, z).equals(Blocks.wall_sign)) || (world.getBlock(x, y, z).equals(Blocks.standing_sign))) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(4)+ 3); + itemstack2 = new ItemStack(Items.stick, 1); + } + else if (world.getBlock(x, y, z).equals(Blocks.bed)) { + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(2)+ 2); + itemstack2 = new ItemStack(Blocks.wool, randomGen.nextInt(2)+ 2); + } + else if (world.getBlock(x, y, z).equals(BlockList.tombstone.get())) { + itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(5)+ 4); + itemstack2 = new ItemStack(Items.sign, 1); + } + else if (world.getBlock(x, y, z).equals(BlockList.palmTreeDoubleSlab.get())) { + Block itemBlockx = BlockList.palmTreeSlab.get(); + itemstack1 = new ItemStack(itemBlockx, 1); + } + else if (world.getBlock(x, y, z).equals(BlockList.palmTreeSlab.get())) { + Block itemBlockx = BlockList.palmTreePlank.get(); + itemstack1 = new ItemStack(itemBlockx, randomGen.nextInt(2)+ 1); + } + else if (world.getBlock(x, y, z).equals(BlockList.campfire.get())) { + int blockMetaData = world.getBlockMetadata(x, y, z); + //System.out.println("meta of campfire is " + blockMetaData); + if (blockMetaData == 0){ + itemstack1 = new ItemStack(Blocks.planks, randomGen.nextInt(3)+ 1, OreDictionary.WILDCARD_VALUE ); + itemstack2 = new ItemStack(Items.coal, 1, OreDictionary.WILDCARD_VALUE ); + } + else if (blockMetaData == 1){ + itemstack1 = new ItemStack(Blocks.cobblestone, randomGen.nextInt(2)+ 1); + itemstack2 = new ItemStack(Items.coal, 1, OreDictionary.WILDCARD_VALUE ); + } + } + else + { + if (this.canHarvestBlocks){ // if not in the uncrafting list either set to destroy or harvest + clearBlock = false; + } + + } + + if (itemstack1 != null){ + double xrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop1 = new EntityItem(world, (double) x + xrand, (double) y + yrand, (double) z + zrand, itemstack1); + itemDrop1.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(itemDrop1); + } + + if (itemstack2 != null){ + double xrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop2 = new EntityItem(world, (double) x + xrand, (double) y + yrand, (double) z + zrand, itemstack2); + itemDrop2.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(itemDrop2); + } + + if (itemstack3 != null){ + double xrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (world.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop3 = new EntityItem(world, (double) x + xrand, (double) y + yrand, (double) z + zrand, itemstack3); + itemDrop3.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(itemDrop3); + } + - world.setBlockToAir(x, y, z); - //if (clearBlock){ - //this.onBlockDestroyed(itemstack, world, world.getBlock(x, y, z), x, y, z, entityplayer); - // world.setBlockToAir(x, y, z); - //} - //System.out.println("current item damage " + itemstack.getItemDamageForDisplay()); - return true; - } - - } else if (side == Side.CLIENT) { - return true; - } else { - return false; - } - } - return true; - } + if (clearBlock) { + world.setBlockToAir(x, y, z); + } + return true; + } + + //} + } + } + return true; + } } diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/ItemShearsTool.java b/src/main/java/com/stek101/projectzulu/common/blocks/ItemShearsTool.java new file mode 100644 index 0000000..a8c6e9d --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/blocks/ItemShearsTool.java @@ -0,0 +1,84 @@ +package com.stek101.projectzulu.common.blocks; + +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import net.minecraft.world.World; +import net.minecraftforge.common.IShearable; + +import com.google.common.collect.Sets; +import com.stek101.projectzulu.common.ProjectZulu_Core; +import com.stek101.projectzulu.common.core.DefaultProps; + +public class ItemShearsTool extends ItemTool { + + public float weaponDamage; + private final Item.ToolMaterial material; + private static final Set field_150915_c = Sets.newHashSet(new Block[] {Blocks.cobblestone, Blocks.double_stone_slab, Blocks.stone_slab, + Blocks.stone, Blocks.sandstone, Blocks.mossy_cobblestone, Blocks.iron_ore, Blocks.iron_block, + Blocks.coal_ore, Blocks.gold_block, Blocks.gold_ore, Blocks.diamond_ore, Blocks.diamond_block, Blocks.ice, Blocks.netherrack, + Blocks.lapis_ore, Blocks.lapis_block, Blocks.redstone_ore, Blocks.lit_redstone_ore, Blocks.rail, Blocks.detector_rail, + Blocks.golden_rail, Blocks.activator_rail, Blocks.crafting_table, Blocks.furnace, Blocks.chest, Blocks.planks, Blocks.bookshelf, Blocks.log, + Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin}); + //private static final Set field_150915_c = Sets.newHashSet(new Block[] {}); + + public ItemShearsTool(String name, ToolMaterial mat) { + super(1.0F, mat, field_150915_c); + this.material = mat; + this.maxStackSize = 1; + this.setMaxDamage(mat.getMaxUses()); + this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); + bFull3D = true; + setUnlocalizedName(name.toLowerCase()); + setTextureName(DefaultProps.blockKey + ":" + name.toLowerCase()); + this.weaponDamage = 1.0f + mat.getDamageVsEntity(); + + } + + @Override + public float func_150893_a(ItemStack p_150893_1_, Block p_150893_2_) + { + return p_150893_2_.getMaterial() != Material.wood && p_150893_2_.getMaterial() != Material.plants && p_150893_2_.getMaterial() != Material.vine && + p_150893_2_.getMaterial() != Material.iron && p_150893_2_.getMaterial() != Material.anvil && + p_150893_2_.getMaterial() != Material.rock ? super.func_150893_a(p_150893_1_, p_150893_2_) : this.efficiencyOnProperMaterial; + + /*if (p_150893_2_ == Blocks.web) + { + return 15.0F; + } + else + { + Material var3 = p_150893_2_.getMaterial(); + return var3 != Material.plants && var3 != Material.vine && var3 != Material.coral && var3 != Material.leaves && var3 != Material.plants ? 1.0F : 1.5F; + }*/ + } + + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + @Override + public boolean hitEntity(ItemStack p_77644_1_, EntityLivingBase p_77644_2_, EntityLivingBase p_77644_3_) + { + p_77644_1_.damageItem(2, p_77644_3_); + //p_77644_2_.addPotionEffect(new PotionEffect(Potion.moveSlowdown.getId(), 80, 99)); + return true; + } + + @Override + public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase living) + { + if (this.canHarvestBlock(block, stack) || block == Blocks.tripwire || block instanceof IShearable) + { + return true; + } + return super.onBlockDestroyed(stack, world, block, x, y, z, living); + } + +} diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/ItemThrowingRock.java b/src/main/java/com/stek101/projectzulu/common/blocks/ItemThrowingRock.java new file mode 100644 index 0000000..2259818 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/blocks/ItemThrowingRock.java @@ -0,0 +1,54 @@ +package com.stek101.projectzulu.common.blocks; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.ProjectZulu_Core; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.entity.EntityThrowingRock; + +public class ItemThrowingRock extends Item{ + + public ItemThrowingRock(boolean full3D, String name) { + super(); + this.maxStackSize = 24; + this.setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); + setMaxDamage(5); + bFull3D = full3D; + setHasSubtypes(true); + setUnlocalizedName(name); + setTextureName(DefaultProps.blockKey + ":" + name); + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + if (!p_77659_3_.capabilities.isCreativeMode) + { + --p_77659_1_.stackSize; + } + + p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); + + if (!p_77659_2_.isRemote) + { + float var7 = (float)8.99F / 20.0F; + var7 = (var7 * var7 + var7 * 2.0F) / 3.0F; + + if (var7 > 1.0F) + { + var7 = 1.0F; + } + p_77659_2_.spawnEntityInWorld(new EntityThrowingRock(p_77659_2_, p_77659_3_)); + //p_77659_2_.spawnEntityInWorld(new EntityThrowingRock(p_77659_2_, p_77659_3_, var7 * 2.0F)); + } + + return p_77659_1_; + } + +} diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/ItemZuluArmor.java b/src/main/java/com/stek101/projectzulu/common/blocks/ItemZuluArmor.java index 68a63b8..9828f70 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/ItemZuluArmor.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/ItemZuluArmor.java @@ -99,7 +99,7 @@ public boolean getBooleanCauseFastHeatTransferOnEquip(EntityPlayer player, float @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { - return DefaultProps.blockKey + ":armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" + return DefaultProps.blockKey + ":textures/armor_sets/" + RenderBiped.bipedArmorFilenamePrefix[renderIndex] + "_" + (armorType == 2 ? 2 : 1) + ".png"; } } diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/PZBlockDamageable.java b/src/main/java/com/stek101/projectzulu/common/blocks/PZBlockDamageable.java deleted file mode 100644 index aee0e5d..0000000 --- a/src/main/java/com/stek101/projectzulu/common/blocks/PZBlockDamageable.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.stek101.projectzulu.common.blocks; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class PZBlockDamageable extends Block{ - protected int blockMaxDmg; - protected int blockCurDmg; - - protected PZBlockDamageable(Material p_i45394_1_) { - super(p_i45394_1_); - // TODO Auto-generated constructor stub - } - - public void setDmgBlock(Block block, int dmgValue){ - - } - - /** - * Returns the maximum damage an item can take. - */ - public int getMaxDamage() - { - return this.blockMaxDmg; - } - - /** - * set max damage of an Item - */ - public PZBlockDamageable setMaxDamage(int p_77656_1_) - { - this.blockMaxDmg = p_77656_1_; - return this; - } - - public int getDamage(PZBlockDamageable block) - { - //return block.itemDamage; - return 0; - } - - /** - * Write the stack fields to a NBT object. Return the new NBT object. - - public NBTTagCompound writeToNBT(NBTTagCompound p_77955_1_) - { - p_77955_1_.setShort("id", (short)Item.getIdFromItem(this.field_151002_e)); - p_77955_1_.setByte("Count", (byte)this.stackSize); - p_77955_1_.setShort("Damage", (short)this.itemDamage); - - if (this.stackTagCompound != null) - { - p_77955_1_.setTag("tag", this.stackTagCompound); - } - - return p_77955_1_; - }*/ - - /** - * Read the stack fields from a NBT object. - - public void readFromNBT(NBTTagCompound p_77963_1_) - { - func_150996_a(Item.getItemById(p_77963_1_.getShort("id"))); - this.stackSize = p_77963_1_.getByte("Count"); - this.itemDamage = p_77963_1_.getShort("Damage"); - - if (this.itemDamage < 0) - { - this.itemDamage = 0; - } - - if (p_77963_1_.hasKey("tag", 10)) - { - this.stackTagCompound = p_77963_1_.getCompoundTag("tag"); - } - }*/ - -} diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/HammerToolDeclaration.java b/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/HammerToolDeclaration.java index 19e6c38..c40321b 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/HammerToolDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/HammerToolDeclaration.java @@ -2,6 +2,7 @@ import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; +import net.minecraftforge.common.config.Configuration; import com.google.common.base.Optional; import com.stek101.projectzulu.common.api.ItemList; @@ -13,6 +14,7 @@ public class HammerToolDeclaration extends ItemSetDeclaration { public final int renderIndex; + private boolean canHarvestBlocks; public HammerToolDeclaration(int renderIndex) { super(new String[] { "HammerToolWood", "HammerToolStone", "HammerToolIron", @@ -20,9 +22,10 @@ public HammerToolDeclaration(int renderIndex) { this.renderIndex = renderIndex; } - //public HammerToolDeclaration() { - // super("HammerTool"); - //} + @Override + protected void preCreateLoadConfig(Configuration config) { + canHarvestBlocks = config.get("Misc Game Settings", "PZ Hammer option canHarvest", this.canHarvestBlocks).getBoolean(canHarvestBlocks); + } @Override protected boolean createItem(int partIndex) { @@ -31,19 +34,19 @@ protected boolean createItem(int partIndex) { switch (partIndex) { case 0: - ItemList.hammerToolWood = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.WOOD)); + ItemList.hammerToolWood = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.WOOD, this.canHarvestBlocks)); return true; case 1: - ItemList.hammerToolStone = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.STONE)); + ItemList.hammerToolStone = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.STONE, this.canHarvestBlocks)); return true; case 2: - ItemList.hammerToolIron = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.IRON)); + ItemList.hammerToolIron = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.IRON, this.canHarvestBlocks)); return true; case 3: - ItemList.hammerToolGold = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.GOLD)); + ItemList.hammerToolGold = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.GOLD, this.canHarvestBlocks)); return true; case 4: - ItemList.hammerToolDiamond = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.EMERALD)); + ItemList.hammerToolDiamond = Optional.of(new ItemHammerTool(name[partIndex].toLowerCase(), ToolMaterial.EMERALD, this.canHarvestBlocks)); return true; } return false; diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/SpikesDeclaration.java b/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/SpikesDeclaration.java index 8f07837..fe56eee 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/SpikesDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/SpikesDeclaration.java @@ -20,6 +20,7 @@ public class SpikesDeclaration extends BlockDeclaration { private int renderID = -1; private String material; + private boolean spikesInvulnerable = false; public SpikesDeclaration(String mat) { super("Spikes" + "_" + mat); @@ -30,28 +31,29 @@ public SpikesDeclaration(String mat) { protected void preCreateLoadConfig(Configuration config) { renderID = config.get("Do Not Touch", "Spike Render ID", renderID).getInt(renderID); renderID = renderID == -1 ? RenderingRegistry.getNextAvailableRenderId() : renderID; + spikesInvulnerable = config.get("Misc Game Settings", "Spikes Invulnerable", this.spikesInvulnerable).getBoolean(spikesInvulnerable); } @Override protected boolean createBlock() { if (material == "Ivory") { BlockList.spike_ivory = Optional - .of(new BlockSpikes(renderID).setBlockName(name.toLowerCase()) + .of(new BlockSpikes(renderID, this.spikesInvulnerable).setBlockName(name.toLowerCase()) .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); } else if (material == "Wood") { BlockList.spike_wood = Optional - .of(new BlockSpikes(renderID, Material.wood, 0).setBlockName(name.toLowerCase()) + .of(new BlockSpikes(renderID, Material.wood, 0, this.spikesInvulnerable).setBlockName(name.toLowerCase()) .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); } else if (material == "Stone") { BlockList.spike_stone = Optional - .of(new BlockSpikes(renderID, Material.rock, 0).setBlockName(name.toLowerCase()) + .of(new BlockSpikes(renderID, Material.rock, 0, this.spikesInvulnerable).setBlockName(name.toLowerCase()) .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); } else if (material == "Iron") { BlockList.spike_iron = Optional - .of(new BlockSpikes(renderID, Material.iron, 0).setBlockName(name.toLowerCase()) + .of(new BlockSpikes(renderID, Material.iron, 0, this.spikesInvulnerable).setBlockName(name.toLowerCase()) .setBlockTextureName(DefaultProps.blockKey + ":" + name.toLowerCase())); } return true; diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/ThrowingRockDeclaration.java b/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/ThrowingRockDeclaration.java new file mode 100644 index 0000000..88a51fc --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/blocks/itemblockdeclarations/ThrowingRockDeclaration.java @@ -0,0 +1,29 @@ +package com.stek101.projectzulu.common.blocks.itemblockdeclarations; + +import net.minecraft.item.Item; + +import com.google.common.base.Optional; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.blocks.ItemThrowingRock; +import com.stek101.projectzulu.common.core.itemblockdeclaration.ItemDeclaration; + +import cpw.mods.fml.common.registry.GameRegistry; + +public class ThrowingRockDeclaration extends ItemDeclaration { + + public ThrowingRockDeclaration() { + super("ThrowingRock"); + } + + @Override + protected boolean createItem() { + ItemList.throwingRock= Optional.of(new ItemThrowingRock(false, name.toLowerCase())); + return true; + } + + @Override + protected void registerItem() { + Item item = ItemList.throwingRock.get(); + GameRegistry.registerItem(item, name); + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/blocks/spike/BlockSpikes.java b/src/main/java/com/stek101/projectzulu/common/blocks/spike/BlockSpikes.java index a34917e..f456574 100644 --- a/src/main/java/com/stek101/projectzulu/common/blocks/spike/BlockSpikes.java +++ b/src/main/java/com/stek101/projectzulu/common/blocks/spike/BlockSpikes.java @@ -5,8 +5,6 @@ import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; -import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EffectRenderer; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; @@ -34,13 +32,14 @@ public class BlockSpikes extends BlockContainer { public static final String[] imageSuffixB = new String[] { "", "_poison", "_sticky" }; Material blockMaterial; int defaultIvory; + private boolean isSpikeInvulnerable; @SideOnly(Side.CLIENT) private IIcon[] icons; public final int renderID; - public BlockSpikes(int renderID, Material mat, int defaultIvory) { + public BlockSpikes(int renderID, Material mat, int defaultIvory, boolean spikesInvulnerable) { super(mat); setCreativeTab(ProjectZulu_Core.projectZuluCreativeTab); disableStats(); @@ -68,10 +67,11 @@ else if (mat == Material.iron){ setStepSound(Block.soundTypeGlass); } this.renderID = renderID; + this.isSpikeInvulnerable = spikesInvulnerable; } - public BlockSpikes(int RenderID){ - this(RenderID, Material.rock, 1); + public BlockSpikes(int RenderID, boolean spikesInvulnerable){ + this(RenderID, Material.rock, 1, spikesInvulnerable); } @Override @@ -205,7 +205,12 @@ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4 @Override public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { - EffectRenderer efrenderer = Minecraft.getMinecraft().effectRenderer; + //EffectRenderer efrenderer; + + //if (!par1World.isRemote){ + + // EffectRenderer efrenderer = Minecraft.getMinecraft().effectRenderer; + //} if ((par5Entity instanceof EntityLiving || par5Entity instanceof EntityPlayer) && ((par5Entity.prevPosY > par3 + this.maxY * 0.9f && par5Entity.posY < par3 + this.maxY * 0.9f) @@ -247,19 +252,27 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p } TileEntity tileEntity = par1World.getTileEntity(par2, par3, par4); - - if (tileEntity != null && tileEntity instanceof TileEntitySpikes) { + + if (!this.isSpikeInvulnerable){ + if (tileEntity != null && tileEntity instanceof TileEntitySpikes) { ((TileEntitySpikes) tileEntity).setDamage(1); - //System.out.println("Spike max damage is " + ((TileEntitySpikes) tileEntity).getMaxDmg()); - //System.out.println("Spike current damage is " + ((TileEntitySpikes) tileEntity).getCurrDamage()); if (((TileEntitySpikes) tileEntity).getCurrDamage() > ((TileEntitySpikes) tileEntity).getMaxDmg()) { - efrenderer.addBlockDestroyEffects((int)par2 - 1, (int)par3 + 1, (int)par4, Blocks.iron_block, 0); + + if (par1World.isRemote) { + Random rand = new Random(); + par1World.spawnParticle("crit", par5Entity.posX, par5Entity.posY, par5Entity.posZ, 0.0D, 0.0D, 0.0D); + for (int i = 0; i < 6; i++) { + par1World.spawnParticle("crit", par2 + rand.nextDouble(), par3 + 1 + rand.nextDouble()*0.2, par4 + rand.nextDouble(), 0, 0, 0); + } + } + par1World.playSoundAtEntity(par5Entity, "random.break", 1.0F, 1.0F); par1World.removeTileEntity(par2, par3, par4); par1World.setBlockToAir(par2, par3, par4); } } + } } } super.onEntityCollidedWithBlock(par1World, par2, par3, par4, par5Entity); diff --git a/src/main/java/com/stek101/projectzulu/common/core/DefaultProps.java b/src/main/java/com/stek101/projectzulu/common/core/DefaultProps.java index e2983c8..339dc9c 100644 --- a/src/main/java/com/stek101/projectzulu/common/core/DefaultProps.java +++ b/src/main/java/com/stek101/projectzulu/common/core/DefaultProps.java @@ -5,7 +5,7 @@ public class DefaultProps { /* ModIDs, Dependencies, and Version */ public static final String DesiredBefore = "after:ExtrabiomesXL@"; - public static final String VERSION_STRING = "1.7.10-1.3f"; + public static final String VERSION_STRING = "1.7.10-1.4b4"; public static final int Version_Code = 1710135; public static final String CoreModId = "ProjectZulu|Core"; public static final String BlocksModId = "ProjectZulu|Block"; diff --git a/src/main/java/com/stek101/projectzulu/common/core/EventHookContainerClass.java b/src/main/java/com/stek101/projectzulu/common/core/EventHookContainerClass.java index cb2693c..97e9b5a 100644 --- a/src/main/java/com/stek101/projectzulu/common/core/EventHookContainerClass.java +++ b/src/main/java/com/stek101/projectzulu/common/core/EventHookContainerClass.java @@ -1,24 +1,34 @@ package com.stek101.projectzulu.common.core; +import java.io.File; import java.util.Iterator; import java.util.List; import java.util.Random; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.config.Configuration; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed; +import net.minecraftforge.event.world.BlockEvent.BreakEvent; +import com.stek101.projectzulu.common.api.CustomEntityList; import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.entity.EntityCentipede; import com.stek101.projectzulu.common.mobs.entity.EntityTreeEnt; import cpw.mods.fml.common.Loader; @@ -29,8 +39,6 @@ public class EventHookContainerClass { protected float zLevel = 0.0F; boolean nearBossTriggered = false; - Random classRand = new Random(); - @SubscribeEvent public void onPlayerUpdateStarve(LivingUpdateEvent event) { World worldObj = event.entity.worldObj; @@ -155,5 +163,4 @@ public void treeEntDefendForest(BreakSpeed event) { } } - } diff --git a/src/main/java/com/stek101/projectzulu/common/core/GuiID.java b/src/main/java/com/stek101/projectzulu/common/core/GuiID.java index 23e234e..d94398f 100644 --- a/src/main/java/com/stek101/projectzulu/common/core/GuiID.java +++ b/src/main/java/com/stek101/projectzulu/common/core/GuiID.java @@ -7,6 +7,7 @@ public enum GuiID { AnimalName(2), MobSpawner(3), BrewingStand(4), + CamelChest(5), Unknown(-1); private int iD; diff --git a/src/main/java/com/stek101/projectzulu/common/core/ItemGenerics.java b/src/main/java/com/stek101/projectzulu/common/core/ItemGenerics.java index de1aa9f..380889c 100644 --- a/src/main/java/com/stek101/projectzulu/common/core/ItemGenerics.java +++ b/src/main/java/com/stek101/projectzulu/common/core/ItemGenerics.java @@ -19,7 +19,7 @@ public class ItemGenerics extends Item implements IngredientProperty { public enum Properties { /* Generic Items */ PoisonDroplet("Poison Droplet", 0), Tusk("Tusk", 1), RawFiber("Raw Fiber", 2), LizardSpit("lizardspit", 39), - DuckEgg("DuckEgg", 40), OstrichEgg("OstrichEgg", 41), + DuckEgg("DuckEgg", 40), OstrichEgg("OstrichEgg", 41), ThrowingRock("ThrowingRock", 42), /* Potion Effect Ingredients */ BlackLichen("Black Lichen", 20), Pulp("Pulp", 21), Salt("Salt", 22), PlantStalk("Plant Stalk", 26), Antennae( diff --git a/src/main/java/com/stek101/projectzulu/common/core/ZuluGuiHandler.java b/src/main/java/com/stek101/projectzulu/common/core/ZuluGuiHandler.java index 9392231..4d19fa0 100644 --- a/src/main/java/com/stek101/projectzulu/common/core/ZuluGuiHandler.java +++ b/src/main/java/com/stek101/projectzulu/common/core/ZuluGuiHandler.java @@ -12,6 +12,8 @@ import com.stek101.projectzulu.common.blocks.universalpot.TileEntityUniversalFlowerPot; import com.stek101.projectzulu.common.dungeon.GuiLimitedMobSpawner; import com.stek101.projectzulu.common.dungeon.TileEntityLimitedMobSpawner; +import com.stek101.projectzulu.common.mobs.ContainerCamelInventory; +import com.stek101.projectzulu.common.mobs.GuiScreenCamelInventory; import com.stek101.projectzulu.common.potion.brewingstands.ContainerBrewingStandSingle; import com.stek101.projectzulu.common.potion.brewingstands.GuiBrewingStandSingle; import com.stek101.projectzulu.common.potion.brewingstands.TileEntityBrewingBase; @@ -36,6 +38,9 @@ public Object getServerGuiElement(int guiID, EntityPlayer player, World world, i if (tileEntityServer instanceof TileEntityBrewingBase) { return new ContainerBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityServer); } + case CamelChest: + return new ContainerCamelInventory(player.inventory, x, world); + //return new GuiScreenCamelInventory(world, player.inventory, x); case Unknown: throw new IllegalStateException("GuiID cannot be Found" + guiID); default: @@ -74,11 +79,13 @@ public Object getClientGuiElement(int guiID, EntityPlayer player, World world, i if (tileEntityClient instanceof TileEntityBrewingBase) { return new GuiBrewingStandSingle(player.inventory, (TileEntityBrewingBase) tileEntityClient); } + case CamelChest: + return new GuiScreenCamelInventory(world, player.inventory, x); case Unknown: throw new IllegalStateException("GuiID cannot be Found" + guiID); } return null; - } + } } diff --git a/src/main/java/com/stek101/projectzulu/common/core/network/PZPacketHandler.java b/src/main/java/com/stek101/projectzulu/common/core/network/PZPacketHandler.java index 7ad0d5f..b4aeb5b 100644 --- a/src/main/java/com/stek101/projectzulu/common/core/network/PZPacketHandler.java +++ b/src/main/java/com/stek101/projectzulu/common/core/network/PZPacketHandler.java @@ -9,6 +9,7 @@ import com.stek101.projectzulu.common.dungeon.packets.PZPacketMobSpawner; import com.stek101.projectzulu.common.mobs.packets.PZPacketAnimTime; import com.stek101.projectzulu.common.mobs.packets.PZPacketFollowerMasterData; +import com.stek101.projectzulu.common.mobs.packets.PZPacketKeyBind; import com.stek101.projectzulu.common.mobs.packets.PZPacketNameSync; import com.stek101.projectzulu.common.mobs.packets.PZPacketTileText; @@ -35,20 +36,19 @@ public class PZPacketHandler { public void init() { int messageID = 0; - // Server to Client: - + // Server to Client: this.network.registerMessage(PZPacketPlaySound.class, PZPacketPlaySound.class, messageID++, Side.CLIENT); this.network.registerMessage(PZPacketStreamSound.class, PZPacketStreamSound.class, messageID++, Side.CLIENT); this.network.registerMessage(PZPacketTameParticle.class, PZPacketTameParticle.class, messageID++, Side.CLIENT); this.network.registerMessage(PZPacketAnimTime.class, PZPacketAnimTime.class, messageID++, Side.CLIENT); this.network.registerMessage(PZPacketFollowerMasterData.class, PZPacketFollowerMasterData.class, messageID++, Side.CLIENT); this.network.registerMessage(PZPacketMobSpawner.class, PZPacketMobSpawner.class, messageID++, Side.CLIENT); - - // Client to Server: - + + // Client to Server: this.network.registerMessage(PZPacketNameSync.class, PZPacketNameSync.class, messageID++, Side.SERVER); this.network.registerMessage(PZPacketTileText.class, PZPacketTileText.class, messageID++, Side.SERVER); this.network.registerMessage(PZPacketMobSpawner.class, PZPacketMobSpawner.class, messageID++, Side.SERVER); + this.network.registerMessage(PZPacketKeyBind.class, PZPacketKeyBind.class, messageID++, Side.SERVER); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/BossHealthDisplayTicker.java b/src/main/java/com/stek101/projectzulu/common/mobs/BossHealthDisplayTicker.java index 2bd53b4..c7fd862 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/BossHealthDisplayTicker.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/BossHealthDisplayTicker.java @@ -1,14 +1,18 @@ package com.stek101.projectzulu.common.mobs; +import java.io.File; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.config.Configuration; import org.lwjgl.opengl.GL11; +import com.stek101.projectzulu.common.core.DefaultProps; import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -17,30 +21,43 @@ public class BossHealthDisplayTicker { - - public static EntityGenericAnimal targetBoss; + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + public static EntityGenericAnimal targetBoss; + protected Minecraft mc = Minecraft.getMinecraft(); protected float zLevel = 0.0F; static EntityPlayer player; + private Configuration config; + private boolean displayBossHealth = true; + private boolean bugRelease = true; // public BossHealthDisplayTicker (EntityGenericAnimal mobEntity) { // this.targetBoss = mobEntity; // } - public static void registerEntity(EntityGenericAnimal newTicker) { + public static void registerEntity(EntityGenericAnimal newTicker) { targetBoss = newTicker; } public static boolean validTargetPresent(EntityGenericAnimal targetBoss) { if (Minecraft.getMinecraft().thePlayer != null){ - return targetBoss != null && !targetBoss.isDead && targetBoss.canEntityBeSeen(Minecraft.getMinecraft().thePlayer); - } - else + //return targetBoss != null && !targetBoss.isDead && targetBoss.canEntityBeSeen(Minecraft.getMinecraft().thePlayer); + return targetBoss != null && !targetBoss.isDead && Minecraft.getMinecraft().thePlayer.canEntityBeSeen(targetBoss) + && (targetBoss.getDistanceToEntity(Minecraft.getMinecraft().thePlayer) < 16.0f); + } + else return false; } @SubscribeEvent public void TickEvent(RenderTickEvent event) { - if (event.phase == Phase.END) { + + config = new Configuration(new File( "." + "/config/", DefaultProps.configDirectory + + DefaultProps.defaultConfigFile)); + config.load(); + displayBossHealth = config.get("mob controls", "Display PZBoss HealthBar", this.displayBossHealth).getBoolean(displayBossHealth); + config.save(); + + if (event.phase == Phase.END && displayBossHealth) { if (validTargetPresent(targetBoss) && Minecraft.getMinecraft().thePlayer != null) { renderBossHealthBar(targetBoss, targetBoss.getDefaultEntityName() + " Health"); } @@ -49,7 +66,7 @@ public void TickEvent(RenderTickEvent event) { } public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) { - Minecraft mc = Minecraft.getMinecraft(); + FontRenderer fontRenderer = mc.fontRenderer; /* Draw Title */ @@ -59,8 +76,8 @@ public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) fontRenderer.drawStringWithShadow(healthBarTitle, screenWidth / 2 - fontRenderer.getStringWidth(healthBarTitle) / 2, healthBarHeight - 10, 16711935); - /* Draw Health Bar */ - GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(Gui.icons).getGlTextureId()); + /* Draw Health Bar */ + GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture(icons).getGlTextureId()); short fullHealthBarWidth = 182; int healthBarOffset = screenWidth / 2 - fullHealthBarWidth / 2; int currHealthBarWidth = (int) ((float) boss.getHealth() / (float) boss.getMaxHealth() * (fullHealthBarWidth + 1)); @@ -70,10 +87,10 @@ public void renderBossHealthBar(EntityGenericAnimal boss, String healthBarTitle) this.drawTexturedModalRect(healthBarOffset, healthBarHeight, 0, 79, currHealthBarWidth, 5); } - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } - - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { + + public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { float var7 = 0.00390625F; float var8 = 0.00390625F; diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/ContainerCamelInventory.java b/src/main/java/com/stek101/projectzulu/common/mobs/ContainerCamelInventory.java new file mode 100644 index 0000000..abba776 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/ContainerCamelInventory.java @@ -0,0 +1,168 @@ +package com.stek101.projectzulu.common.mobs; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.mobs.entity.EntityCamel; + +public class ContainerCamelInventory extends Container { + + private IInventory field_111243_a; + private final IInventory camelInv; + private EntityCamel theEntity; + + //public ContainerCamelInventory(IInventory p_i1817_1_, final IInventory p_i1817_2_, final EntityCamel p_i1817_3_) + public ContainerCamelInventory(InventoryPlayer p_i1817_1_, int entityID, World world) + { + final IInventory p_i1817_2_; + final EntityCamel p_i1817_3_; + + this.theEntity = (EntityCamel) world.getEntityByID(entityID); + p_i1817_3_ = theEntity; + camelInv = theEntity.camelChest; + p_i1817_2_ = this.camelInv; + this.field_111243_a = p_i1817_2_; + + byte var4 = 3; + p_i1817_2_.openInventory(); + int var5 = (var4 - 4) * 18; + + this.addSlotToContainer(new Slot(p_i1817_2_, 0, 8, 18) + { + public boolean isItemValid(ItemStack p_75214_1_) + { + return super.isItemValid(p_75214_1_) && p_75214_1_.getItem() == Items.saddle && !this.getHasStack(); + } + }); + + + /* this.addSlotToContainer(new Slot(p_i1817_2_, 1, 8, 36) + { + + public boolean isItemValid(ItemStack p_75214_1_) + { + return super.isItemValid(p_75214_1_) && EntityCamel.func_146085_a(p_75214_1_.getItem()); + } + + public boolean func_111238_b() + { + return false; + } + });*/ + + int var6; + int var7; + if (p_i1817_3_.isChested()) + { + for (var6 = 0; var6 < var4; ++var6) + { + for (var7 = 0; var7 < 5; ++var7) + { + this.addSlotToContainer(new Slot(p_i1817_2_, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18)); + } + } + } + + for (var6 = 0; var6 < 3; ++var6) + { + for (var7 = 0; var7 < 9; ++var7) + { + this.addSlotToContainer(new Slot(p_i1817_1_, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5)); + } + } + + for (var6 = 0; var6 < 9; ++var6) + { + this.addSlotToContainer(new Slot(p_i1817_1_, var6, 8 + var6 * 18, 160 + var5)); + } + + //bindPlayerInventory(p_i1817_1_); + } + + protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 9; j++) { + addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + for (int i = 0; i < 9; i++) { + addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); + } + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.field_111243_a.isUseableByPlayer(p_75145_1_) && this.theEntity.isEntityAlive() && this.theEntity.getDistanceToEntity(p_75145_1_) < 8.0F; + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack var3 = null; + Slot var4 = (Slot)this.inventorySlots.get(p_82846_2_); + if (var4 != null && var4.getHasStack()) + { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); + + if (p_82846_2_ < this.field_111243_a.getSizeInventory()) + { + if (!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.inventorySlots.size(), true)) + { + return null; + } + } + else if (this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack()) + { + if (!this.mergeItemStack(var5, 1, 2, false)) + { + return null; + } + } + else if (this.getSlot(0).isItemValid(var5)) + { + if (!this.mergeItemStack(var5, 0, 1, false)) + { + return null; + } + } + else if (this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false)) + { + return null; + } + + if (var5.stackSize == 0) + { + var4.putStack((ItemStack)null); + } + else + { + var4.onSlotChanged(); + } + } + + return var3; + } + + + /** + * Called when the container is closed. + */ + @Override + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + this.field_111243_a.closeInventory(); + } + +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/EntityAFightorFlight.java b/src/main/java/com/stek101/projectzulu/common/mobs/EntityAFightorFlight.java index ed66c36..1e2264a 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/EntityAFightorFlight.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/EntityAFightorFlight.java @@ -36,6 +36,16 @@ public EntityAFightorFlight setEntity(EntityGenericCreature par1, World par2, fl return this; } + public EntityAFightorFlight setEntity(EntityGenericCreature par1, World par2, float par3, double par4, boolean shouldHop) { + this.entity = par1; + this.worldObj = par2; + this.aggroLevel = par3; + this.aggroRange = par4; + this.aiEntityAvoidEntity = new EntityAIAvoidEntity(entity, EntityPlayer.class, 16.0f, 1.3D, 1.2D, shouldHop); + return this; + } + + public void updateEntityAFF(World worldobj, Item temptItem){ ItemStack var1 = null; //ItemStack var1 = this.entityplayer.getCurrentEquippedItem(); @@ -54,6 +64,8 @@ public void updateEntityAFF(World worldobj, Item temptItem){ } } + + if (this.aggroRange != 0 && temptingItem == false ){ /** 0 means deactivate FoF behavior or entity player is too far**/ /* Check if target can be detected, then entity will decide whether to fight or flee, ignore if tamed */ diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/GuiScreenCamelInventory.java b/src/main/java/com/stek101/projectzulu/common/mobs/GuiScreenCamelInventory.java new file mode 100644 index 0000000..19ee28f --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/GuiScreenCamelInventory.java @@ -0,0 +1,88 @@ +package com.stek101.projectzulu.common.mobs; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.mobs.entity.EntityCamel; +import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiScreenCamelInventory extends GuiContainer +{ + + private static final ResourceLocation camelGuiTextures = new ResourceLocation("textures/gui/container/horse.png"); + private IInventory field_147030_v; + private IInventory field_147029_w; + private EntityCamel field_147034_x; + private float field_147033_y; + private float field_147032_z; + private int entityID; + private String entityName; + + public GuiScreenCamelInventory(World world, InventoryPlayer p_i1093_1_, int entityID) + { + super(new ContainerCamelInventory(p_i1093_1_, entityID, world)); + this.field_147030_v = p_i1093_1_; + this.entityID = entityID; + entityName = ((EntityGenericAnimal) world.getEntityByID(entityID)).getEntityTamed(); + + this.field_147034_x = (EntityCamel) world.getEntityByID(entityID); + this.field_147029_w = field_147034_x.camelChest; + //this.field_147029_w = p_i1093_2_; + //this.field_147034_x = p_i1093_3_; + + this.allowUserInput = false; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + this.fontRendererObj.drawString(this.field_147029_w.hasCustomInventoryName() ? this.field_147029_w.getInventoryName() : I18n.format(this.field_147029_w.getInventoryName(), new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147030_v.hasCustomInventoryName() ? this.field_147030_v.getInventoryName() : I18n.format(this.field_147030_v.getInventoryName(), new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + //this.mc.getTextureManager().bindTexture(camelGuiTextures); + this.mc.renderEngine.bindTexture(camelGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (this.field_147034_x.isChested()) + { + this.drawTexturedModalRect(k + 79, l + 17, 0, this.ySize, 90, 54); + } + + // if (this.field_147034_x.func_110259_cr()) for armor + // { + // this.drawTexturedModalRect(k + 7, l + 35, 0, this.ySize + 54, 18, 18); + // } + + GuiInventory.func_147046_a(k + 51, l + 60, 17, (float)(k + 51) - this.field_147033_y, (float)(l + 75 - 50) - this.field_147032_z, this.field_147034_x); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + this.field_147033_y = (float)p_73863_1_; + this.field_147032_z = (float)p_73863_2_; + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} + diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/GuiScreenHorseInventory.java b/src/main/java/com/stek101/projectzulu/common/mobs/GuiScreenHorseInventory.java new file mode 100644 index 0000000..7de11c5 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/GuiScreenHorseInventory.java @@ -0,0 +1,75 @@ +package com.stek101.projectzulu.common.mobs; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.passive.EntityHorse; +import net.minecraft.inventory.ContainerHorseInventory; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiScreenHorseInventory extends GuiContainer +{ + private static final ResourceLocation horseGuiTextures = new ResourceLocation("textures/gui/container/horse.png"); + private IInventory field_147030_v; + private IInventory field_147029_w; + private EntityHorse field_147034_x; + private float field_147033_y; + private float field_147032_z; + private static final String __OBFID = "CL_00000760"; + + public GuiScreenHorseInventory(IInventory p_i1093_1_, IInventory p_i1093_2_, EntityHorse p_i1093_3_) + { + super(new ContainerHorseInventory(p_i1093_1_, p_i1093_2_, p_i1093_3_)); + this.field_147030_v = p_i1093_1_; + this.field_147029_w = p_i1093_2_; + this.field_147034_x = p_i1093_3_; + this.allowUserInput = false; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + this.fontRendererObj.drawString(this.field_147029_w.hasCustomInventoryName() ? this.field_147029_w.getInventoryName() : I18n.format(this.field_147029_w.getInventoryName(), new Object[0]), 8, 6, 4210752); + this.fontRendererObj.drawString(this.field_147030_v.hasCustomInventoryName() ? this.field_147030_v.getInventoryName() : I18n.format(this.field_147030_v.getInventoryName(), new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(horseGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (this.field_147034_x.isChested()) + { + this.drawTexturedModalRect(k + 79, l + 17, 0, this.ySize, 90, 54); + } + + if (this.field_147034_x.func_110259_cr()) + { + this.drawTexturedModalRect(k + 7, l + 35, 0, this.ySize + 54, 18, 18); + } + + GuiInventory.func_147046_a(k + 51, l + 60, 17, (float)(k + 51) - this.field_147033_y, (float)(l + 75 - 50) - this.field_147032_z, this.field_147034_x); + } + + /** + * Draws the screen and all the components in it. + */ + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + this.field_147033_y = (float)p_73863_1_; + this.field_147032_z = (float)p_73863_2_; + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityAntRavager.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityAntRavager.java new file mode 100644 index 0000000..f76f218 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityAntRavager.java @@ -0,0 +1,124 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.EnumSet; + +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + + +public class EntityAntRavager extends EntityGenericAnimal implements IAnimals { + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + + public EntityAntRavager(World par1World) { + super(par1World); + this.setPosition(this.posX, this.posY, this.posZ); + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIWander(this, 1.0f, 120)); + tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0f, false)); + tasks.addTask(5, new EntityAIMate(this, 1.0f)); + tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.spider_eye, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0f)); + + targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); + targetTasks.addTask(4, + new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + EntityPlayer.class, 16.0F, 0, true)); + targetTasks.addTask(5, + new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "ravantlivingsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "ravanthurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; + } + + @Override + public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { + return true; + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.spider_eye); + } + } + + @Override + protected void updateAITick() { + super.updateAITick(); + } + + + /** + * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each + * Entity if deviations from default are desired + */ + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null + && (itemStack.getItem() == Items.bread || itemStack.getItem() == Items.spider_eye)) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + } else { + return super.isValidBreedingItem(itemStack); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeaver.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeaver.java index 6909e11..33db00b 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeaver.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeaver.java @@ -74,7 +74,7 @@ public void onLivingUpdate() { super.onLivingUpdate(); if (Math.round(this.aggroRange) != 0) { EAFF.updateEntityAFF(worldObj); - } EAFF.updateEntityAFF(worldObj); + } } /** diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeetleAS.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeetleAS.java new file mode 100644 index 0000000..f152a90 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeetleAS.java @@ -0,0 +1,130 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.Random; + +import net.minecraft.entity.EntityList; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + + +public class EntityBeetleAS extends EntityGenericAnimal implements IAnimals { + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + + public EntityBeetleAS(World par1World) { + super(par1World); + this.setSize(0.35f, 0.35f); + this.setPosition(this.posX, this.posY, this.posZ); + + Random rand1 = new Random(); + this.textureID = rand1.nextInt(3); + + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIWander(this, 1.0f, 120)); + + /* Attack On Collide Declared in SubClass */ + tasks.addTask(5, new EntityAIMate(this, 1.0f)); + tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.potato, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0f)); + + //targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); + //targetTasks.addTask(4, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityPlayer.class, 16.0F, 0, true)); + // targetTasks.addTask(5, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ + // @Override + // protected String getLivingSound() { + // return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlelivingsound"; + // } + + /** + * Returns the sound this mob makes when it is hurt. + */ + // @Override +// protected String getHurtSound() { +// return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlehurtsound"; +// } + +// @Override +// public int getTalkInterval() { +// return 160; +// } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.potato); + } + + if (this.ticksExisted > 10000){ + //this.despawnEntity(); + this.setDead(); + } + } + + @Override + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 0; + } + + @Override + protected void updateAITick() { + super.updateAITick(); + } + + /** + * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each + * Entity if deviations from default are desired + */ + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null + && (itemStack.getItem() == Items.potato)) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + } else { + return super.isValidBreedingItem(itemStack); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeetleBS.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeetleBS.java new file mode 100644 index 0000000..2eaf499 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBeetleBS.java @@ -0,0 +1,130 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.Random; + +import net.minecraft.entity.EntityList; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + + +public class EntityBeetleBS extends EntityGenericAnimal implements IAnimals { + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + + public EntityBeetleBS(World par1World) { + super(par1World); + this.setSize(0.35f, 0.35f); + this.setPosition(this.posX, this.posY, this.posZ); + + Random rand1 = new Random(); + this.textureID = rand1.nextInt(3); + + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIWander(this, 1.0f, 120)); + + /* Attack On Collide Declared in SubClass */ + tasks.addTask(5, new EntityAIMate(this, 1.0f)); + tasks.addTask(6, new EntityAITempt(this, 1.2f, Items.potato, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 1.1f)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0f)); + + //targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); + //targetTasks.addTask(4, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityPlayer.class, 16.0F, 0, true)); + // targetTasks.addTask(5, + // new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + // EntityLiving.class, 16.0F, 0, false, true, IMob.mobSelector)); + } + + /** + * Returns the sound this mob makes while it's alive. + */ +// @Override +// protected String getLivingSound() { +// return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlelivingsound"; +// } + + /** + * Returns the sound this mob makes when it is hurt. + */ + // @Override + // protected String getHurtSound() { + // return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "beetlehurtsound"; + // } + +// @Override +// public int getTalkInterval() { + // return 160; +// } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.potato); + } + + if (this.ticksExisted > 10000){ + //this.despawnEntity(); + this.setDead(); + } + } + + @Override + protected int getExperiencePoints(EntityPlayer p_70693_1_) + { + return 0; + } + + @Override + protected void updateAITick() { + super.updateAITick(); + } + + /** + * Checks if the Provided ItemStack is considered an item that should be used for Breeding This is overriden by each + * Entity if deviations from default are desired + */ + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null + && (itemStack.getItem() == Items.potato)) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + } else { + return super.isValidBreedingItem(itemStack); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBloomDoom.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBloomDoom.java new file mode 100644 index 0000000..f68aec9 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityBloomDoom.java @@ -0,0 +1,120 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.EnumSet; + +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIStayStill; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + +public class EntityBloomDoom extends EntityGenericAnimal implements IMob { + + protected int wakeUpTimer = 0; + + public int getWakeUpTimer() { + return wakeUpTimer; + } + + boolean shouldHover = false; + + public EntityBloomDoom(World par1World) { + super(par1World); + setSize(1.0f, 1.0f); + getNavigator().setAvoidsWater(true); + + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIStayStill(this, EntityStates.idle)); + tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); + tasks.addTask(5, new EntityAIWander(this, 1.0f, 120)); + targetTasks.addTask(3, new EntityAIHurtByTarget(this, false, false)); + targetTasks.addTask(4, + new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + EntityPlayer.class, 16.0F, 0, true)); + } + + public EntityBloomDoom(World par1World, double parx, double pary, double parz, boolean shouldHover) { + this(par1World); + setLocationAndAngles(parx, pary, parz, 1, 1); + setPosition(parx, pary, parz); + this.shouldHover = shouldHover; + } + + @Override + public int getTotalArmorValue() { + return 2; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + if (getEntityState() != EntityStates.idle){ + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "dbloomlivingsound"; + } + return null; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "dbloomhurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; + } + + @Override + public void onLivingUpdate() { + if (shouldHover == true) { + this.motionY = 0; + if (ticksExisted > (20 * 10)) { + shouldHover = false; + } + } + + if (this.worldObj.isDaytime() && !this.worldObj.isRemote && ticksExisted % (10 * 20) == 0) { + heal(1); + } + + super.onLivingUpdate(); + + /* If Player is Still Nearby after activation, do not become passive */ + if (getEntityState() != EntityStates.idle && worldObj.getClosestPlayerToEntity(this, 8D) != null) { + setAngerLevel(400); + } + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + @Override + public boolean canBePushed() { + if (getEntityState() == EntityStates.idle) { + return false; + } else { + return !this.isDead; + } + } + + // Called when player interacts with mob, eg get milk, saddle + @Override + public boolean interact(EntityPlayer par1EntityPlayer) { + entityAttackedReaction(par1EntityPlayer); + return super.interact(par1EntityPlayer); + } + +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCamel.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCamel.java new file mode 100644 index 0000000..e60b1a6 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCamel.java @@ -0,0 +1,946 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.AnimalChest; +import net.minecraft.inventory.IInvBasic; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.ProjectZulu_Core; +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.packets.PZPacketTameParticle; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + +import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint; + +public class EntityCamel extends EntityGenericAnimal implements IInvBasic { + + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + public boolean camelSaddled; + public AnimalChest camelChest; + private static final int[] armorValues = new int[] {0, 5, 7, 11}; + private boolean animalChested; + protected float jumpPower = 0.0f; + protected boolean mountJumping; + public boolean mountJump = false; + private World parWorld; + private int field_110285_bP; + + public EntityCamel(World par1World) { + super(par1World); + setSize(1.6f, 1.8f); + this.setChested(false); + this.setSaddled(false); + this.camelSaddled = false; + this.parWorld = par1World; + this.setPosition(this.posX, this.posY, this.posZ); + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.0f)); + tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); + tasks.addTask(3, new EntityAILookIdle(this)); + tasks.addTask(5, new EntityAIMate(this, 0.8f)); + tasks.addTask(6, new EntityAITempt(this, 0.9f, Items.water_bucket, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 0.9f)); + tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); + tasks.addTask(9, new EntityAIWander(this, 0.8f, 120)); + + targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); + targetTasks.addTask(2, + new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + EntityPlayer.class, 16.0F, 0, true)); + this.createCamelChest(); + } + + @Override + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(22, Integer.valueOf(0)); //mount armor + this.dataWatcher.addObject(26, Integer.valueOf(0)); //chested aka saddle bags + } + + @Override + protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { + return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.water_bucket); + } + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "camellivingsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "camelhurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; + } + + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null && itemStack.getItem() == Item.getItemFromBlock(Blocks.leaves)) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + + } else { + return super.isValidBreedingItem(itemStack); + } + } + + @Override + public boolean isValidTamingItem(ItemStack itemStack) { + if (itemStack == null) { + return false; + } + + if (itemStack.getItem() == Items.water_bucket) { + return true; + } + return super.isValidTamingItem(itemStack); + } + + @Override + public boolean isRideable() { + return true; + } + + private void createCamelChest() + { + AnimalChest animalchest = this.camelChest; + this.camelChest = new AnimalChest("CamelChest", 17); + this.camelChest.func_110133_a(this.getCommandSenderName()); + + if (animalchest != null) + { + animalchest.func_110132_b((IInvBasic) this); + int i = Math.min(animalchest.getSizeInventory(), this.camelChest.getSizeInventory()); + + for (int j = 0; j < i; ++j) + { + ItemStack itemstack = animalchest.getStackInSlot(j); + + if (itemstack != null) + { + this.camelChest.setInventorySlotContents(j, itemstack.copy()); + } + } + animalchest = null; + } + + this.camelChest.func_110134_a((IInvBasic) this); + } + + public void func_146086_d(ItemStack p_146086_1_) + { + this.dataWatcher.updateObject(22, Integer.valueOf(this.getCamelArmorIndex(p_146086_1_))); + //this.func_110230_cF(); + } + + /** + * 0 = iron, 1 = gold, 2 = diamond + */ + private int getCamelArmorIndex(ItemStack p_110260_1_) + { + if (p_110260_1_ == null) + { + return 0; + } + else + { + Item item = p_110260_1_.getItem(); + return item == Items.iron_horse_armor ? 1 : (item == Items.golden_horse_armor ? 2 : (item == Items.diamond_horse_armor ? 3 : 0)); + } + } + + public void setCamelSaddled(boolean p_110251_1_) + { + //this.setHorseWatchableBoolean(4, p_110251_1_); + this.setSaddled(true); + } + + /** + * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. + */ + @Override + public void onInventoryChanged(InventoryBasic p_76316_1_) + { + int i = this.getMountArmorValue(); + boolean flag = this.isCamelSaddled(); + //this.func_110232_cE(); + + if (this.ticksExisted > 20) + { + if (!(p_76316_1_.getStackInSlot(0) == null)) { + if (p_76316_1_.getStackInSlot(0).getItem() ==Items.saddle){ + this.setSaddled(true); + this.playSound("mob.horse.leather", 0.5F, 1.0F); + } + }else + { + this.setSaddled(false); + } + + if (i == 0 && i != this.getMountArmorValue()) + { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + else if (i != this.getMountArmorValue()) + { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + } + } + + public boolean isCamelSaddled() + { + return this.getSaddled(); + } + +/* public boolean isChested() + { + return this.animalChested; + }*/ + + public int getMountArmorValue() + { + return this.dataWatcher.getWatchableObjectInt(22); + } + + +/* public EntityGenericAgeable createChild(EntityGenericAgeable p_90011_1_) { + //EntityCamel entity = (EntityCamel)p_90011_1_; + EntityCamel entityCamel1 = new EntityCamel(this.worldObj); + return entityCamel1; + //return null; + }*/ + + /** + * Called when the entity is attacked. + */ + @Override + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) + { + Entity entity = p_70097_1_.getEntity(); + return this.riddenByEntity != null && this.riddenByEntity.equals(entity) ? false : super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + + /** + * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue + */ + @Override + public int getTotalArmorValue() + { + //return armorValues[this.getMountArmorValue()]; + return 2; + } + + public void dropChests() + { + if (!this.worldObj.isRemote && this.isChested()) + { + this.dropItem(Item.getItemFromBlock(Blocks.chest), 1); + this.setChested(false); + } + } + + /* public void setChested(boolean p_110207_1_) + { + this.animalChested = p_110207_1_; + }*/ + + @Override + public boolean shouldNotifySimilar(EntityPlayer attackingPlayer) { + return true; + } + + /** + * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. + */ + @Override + public boolean interact(EntityPlayer p_70085_1_) + { + ItemStack itemstack = p_70085_1_.inventory.getCurrentItem(); + + if(this.isTamed()){ + if (itemstack != null && itemstack.getItem() == Items.spawn_egg) + { + return super.interact(p_70085_1_); + } + + else + if (this.isAdultCamel() && p_70085_1_.isSneaking()) + { + this.openGUI(p_70085_1_); + return true; + } + else if (this.isAdultCamel() && this.riddenByEntity != null) + { + return super.interact(p_70085_1_); + } + else if (itemstack != null && this.isValidBreedingItem(itemstack)) + { + return super.interact(p_70085_1_); + } + else + { + if (itemstack != null) + { + boolean flag = false; + + // if (this.func_110259_cr()) + // { + byte b0 = -1; + + if (itemstack.getItem() == Items.stick) + { + b0 = 1; + } + + /* if (itemstack.getItem() == Items.iron_horse_armor) + { + b0 = 1; + } + else if (itemstack.getItem() == Items.golden_horse_armor) + { + b0 = 2; + } + else if (itemstack.getItem() == Items.diamond_horse_armor) + { + b0 = 3; + }*/ + + if (b0 >= 0) + { + this.openGUI(p_70085_1_); + return true; + } + // } + + if (!flag ) + { + float f = 0.0F; + short short1 = 0; + byte b1 = 0; + + if (itemstack.getItem() == Items.wheat) + { + f = 2.0F; + short1 = 60; + b1 = 3; + } + else if (itemstack.getItem() == Items.sugar) + { + f = 1.0F; + short1 = 30; + b1 = 3; + } + else if (itemstack.getItem() == Items.bread) + { + f = 7.0F; + short1 = 180; + b1 = 3; + } + else if (Block.getBlockFromItem(itemstack.getItem()) == Blocks.hay_block) + { + f = 20.0F; + short1 = 180; + } + else if (itemstack.getItem() == Items.apple) + { + f = 3.0F; + short1 = 60; + b1 = 3; + } + else if (itemstack.getItem() == Items.golden_carrot) + { + f = 4.0F; + short1 = 60; + b1 = 5; + + if (this.isTamed() && this.getGrowingAge() == 0) + { + flag = true; + //this.func_146082_f(p_70085_1_); + } + } + else if (itemstack.getItem() == Items.golden_apple) { + + f = 10.0F; + short1 = 240; + b1 = 10; + + if (this.isTamed() && this.getGrowingAge() == 0) + { + flag = true; + //this.func_146082_f(p_70085_1_); + } + } + + if (this.getHealth() < this.getMaxHealth() && f > 0.0F) + { + this.heal(f); + flag = true; + } + + /*if (!this.isAdultHorse() && short1 > 0) + { + this.addGrowth(short1); + flag = true; + }*/ + + /*if (b1 > 0 && (flag || !this.isTamed())) + { + flag = true; + this.increaseTemper(b1); + }*/ + + if (flag) + { + this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + } + } + + if (!flag && !this.isChested() && itemstack.getItem() == Item.getItemFromBlock(Blocks.chest)) + { + this.setChested(true); + this.playSound("mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + flag = true; + this.createCamelChest(); + } + + if (!flag && this.func_110253_bW() && !this.isCamelSaddled() && itemstack.getItem() == Items.saddle) + { + this.openGUI(p_70085_1_); + return true; + } + + if (flag) + { + if (!p_70085_1_.capabilities.isCreativeMode && --itemstack.stackSize == 0) + { + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + + if (this.func_110253_bW() && this.riddenByEntity == null) + { + if (itemstack != null && itemstack.interactWithEntity(p_70085_1_, this)) + { + return true; + } + else + { + this.func_110237_h(p_70085_1_); + return true; + } + } + else + { + return super.interact(p_70085_1_); + } + } + } + else if (itemstack != null && itemstack.getItem() == Items.saddle ) + { + return false; + } + else if (itemstack != null && itemstack.getItem() == Item.getItemFromBlock(Blocks.chest)) + { + return false; + } + else if(itemstack != null && this.isValidTamingItem(itemstack)) { + if (!p_70085_1_.capabilities.isCreativeMode){ + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, + new ItemStack(Items.bucket)); + } + + if (itemstack.stackSize <= 0){ + p_70085_1_.inventory.setInventorySlotContents(p_70085_1_.inventory.currentItem, (ItemStack)null); + } + + if(!worldObj.isRemote){ + boolean tameEffectSuccess = false; + + if(rand.nextInt(3) == 0){ + this.setTamed(true); + this.setAttackTarget((EntityLiving)null); + this.setHealth(getMaxHealth()); + this.setOwner(p_70085_1_.getCommandSenderName()); + setEntityTamed(getDefaultEntityName()); + tameEffectSuccess = true; + } + + /* Send Tame Effect Packet */ + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + DataOutputStream data = new DataOutputStream(bytes); + /* Write PacketID into Packet */ + try { + data.writeInt(5); + } catch (Exception e) { + e.printStackTrace(); + } + + /* Write Temperature Into Packet */ + try { + data.writeInt(getEntityId()); + data.writeBoolean(tameEffectSuccess); + } catch (Exception e) { + e.printStackTrace(); + } + PZPacketTameParticle message = new PZPacketTameParticle().setPacketData(getEntityId(), tameEffectSuccess); + ProjectZulu_Core.packetHandler.sendToAllAround(message, new TargetPoint(dimension, posX, posY, posZ, 10)); + } + return true; + } + if(super.interact(p_70085_1_)){ + return true; + } + + return false; + } + + public boolean isAdultCamel() + { + return !this.isChild(); + } + + public void openGUI(EntityPlayer player) + { + if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == player) && this.isTamed()) + { + this.camelChest.func_110133_a(this.getCommandSenderName()); + if (player.inventory == null){ + } + + if (this.camelChest == null) { + } + player.openGui(ProjectZulu_Core.modInstance, 5, player.worldObj, this.getEntityId(), 0, 0); + } + } + + /** + * Gets the name of this command sender (usually username, but possibly "Rcon") + */ + public String getCommandSenderName() + { + //if (this.hasCustomNameTag()) + //{ + return this.getCustomNameTag(); + //} + + } + + public boolean func_110253_bW() + { + return this.isAdultCamel(); + } + + private void func_110237_h(EntityPlayer p_110237_1_) + { + p_110237_1_.rotationYaw = this.rotationYaw; + p_110237_1_.rotationPitch = this.rotationPitch; + + if (!this.worldObj.isRemote) + { + p_110237_1_.mountEntity(this); + } + } + + public static boolean func_146085_a(Item p_146085_0_) + { + return p_146085_0_ == Items.iron_horse_armor || p_146085_0_ == Items.golden_horse_armor || p_146085_0_ == Items.diamond_horse_armor; + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + @Override + public void writeEntityToNBT(NBTTagCompound p_70014_1_) + { + super.writeEntityToNBT(p_70014_1_); + p_70014_1_.setBoolean("ChestedCamel", this.isChested()); + + if (this.isChested()) + { + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 2; i < this.camelChest.getSizeInventory(); ++i) + { + ItemStack itemstack = this.camelChest.getStackInSlot(i); + + if (itemstack != null) + { + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + nbttagcompound1.setByte("Slot", (byte)i); + itemstack.writeToNBT(nbttagcompound1); + nbttaglist.appendTag(nbttagcompound1); + } + } + + p_70014_1_.setTag("Items", nbttaglist); + } + + if (this.camelChest.getStackInSlot(1) != null) + { + p_70014_1_.setTag("ArmorItem", this.camelChest.getStackInSlot(1).writeToNBT(new NBTTagCompound())); + } + + if (this.camelChest.getStackInSlot(0) != null) + { + p_70014_1_.setTag("SaddleItem", this.camelChest.getStackInSlot(0).writeToNBT(new NBTTagCompound())); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + @Override + public void readEntityFromNBT(NBTTagCompound p_70037_1_) + { + super.readEntityFromNBT(p_70037_1_); + this.setChested(p_70037_1_.getBoolean("ChestedCamel")); + + if (this.isChested()) + { + NBTTagList nbttaglist = p_70037_1_.getTagList("Items", 10); + this.createCamelChest(); + + for (int i = 0; i < nbttaglist.tagCount(); ++i) + { + NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); + int j = nbttagcompound1.getByte("Slot") & 255; + + if (j >= 2 && j < this.camelChest.getSizeInventory()) + { + this.camelChest.setInventorySlotContents(j, ItemStack.loadItemStackFromNBT(nbttagcompound1)); + } + } + } + + ItemStack itemstack; + + /* if (p_70037_1_.hasKey("ArmorItem", 10)) + { + itemstack = ItemStack.loadItemStackFromNBT(p_70037_1_.getCompoundTag("ArmorItem")); + + if (itemstack != null && func_146085_a(itemstack.getItem())) + { + this.camelChest.setInventorySlotContents(1, itemstack); + } + }*/ + + if (p_70037_1_.hasKey("SaddleItem", 10)) + { + itemstack = ItemStack.loadItemStackFromNBT(p_70037_1_.getCompoundTag("SaddleItem")); + + if (itemstack != null && itemstack.getItem() == Items.saddle) + { + this.camelChest.setInventorySlotContents(0, itemstack); + } + } + else if (p_70037_1_.getBoolean("Saddle")) + { + this.camelChest.setInventorySlotContents(0, new ItemStack(Items.saddle)); + } + } + + /** + * Moves the entity based on the specified heading. Args: strafe, forward + */ + @Override + public void moveEntityWithHeading(float moveStrafe, float moveForward) + { + + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase + && this.getSaddled()) + { + // Apply Rider Movement: + EntityLivingBase rider = (EntityLivingBase)this.riddenByEntity; + + this.prevRotationYaw = this.rotationYaw = rider.rotationYaw; + this.rotationPitch = rider.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.rotationYawHead = this.renderYawOffset = this.rotationYaw; + moveStrafe = ((EntityLivingBase)rider).moveStrafing * 0.5F; + moveForward = ((EntityLivingBase)rider).moveForward; + + // Jumping Controls: + if(!this.isMountJumping() && this.onGround) { + if(this.riddenByEntity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer)this.riddenByEntity; + //ExtendedPlayer playerExt = ExtendedPlayer.getForPlayer(player); + if(this.mountJump) + this.startJumping(); + } + } + + // Jumping Behaviour: + if(this.getJumpPower() > 0.0F && !this.isMountJumping() && this.onGround) { + this.motionY = this.getMountJumpHeight() * (double)this.getJumpPower(); + if(this.isPotionActive(Potion.jump)) + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + this.setMountJumping(true); + this.isAirBorne = true; + if(moveForward > 0.0F) { + float f2 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float f3 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += (double)(-0.4F * f2 * this.jumpPower); + this.motionZ += (double)(0.4F * f3 * this.jumpPower); + } + if(!this.worldObj.isRemote) + this.playSound("mob.horse.jump", 0.4F, 1.0F); + this.setJumpPower(0); + } + //this.jumpMovementFactor = (float)(this.getAIMoveSpeed() * this.getGlideScale()); + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; + + // Apply Movement: + if(!this.worldObj.isRemote) { + this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); + super.moveEntityWithHeading(moveStrafe, moveForward); + } + + // Clear Jumping: + if(this.onGround) { + this.setJumpPower(0); + this.setMountJumping(false); + this.mountJump = false; + } + + // Animate Limbs: + this.prevLimbSwingAmount = this.limbSwingAmount; + double d0 = this.posX - this.prevPosX; + double d1 = this.posZ - this.prevPosZ; + float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F; + if (f4 > 1.0F) + f4 = 1.0F; + this.limbSwingAmount += (f4 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; + } + else + { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; + super.moveEntityWithHeading(moveStrafe, moveForward); + } + } + + /** + * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden + * by a player and the player is holding a carrot-on-a-stick + */ + @Override + public boolean canBeSteered() + { + return false; + } + + /** + * Called when the mob's health reaches 0. + */ + @Override + public void onDeath(DamageSource p_70645_1_) + { + super.onDeath(p_70645_1_); + + if (!this.worldObj.isRemote) + { + this.dropChestItems(); + } + } + + public void dropChestItems() + { + this.dropItemsInChest(this, this.camelChest); + this.dropChests(); + } + + private void dropItemsInChest(Entity p_110240_1_, AnimalChest p_110240_2_) + { + if (p_110240_2_ != null && !this.worldObj.isRemote) + { + for (int i = 0; i < p_110240_2_.getSizeInventory(); ++i) + { + ItemStack itemstack = p_110240_2_.getStackInSlot(i); + + if (itemstack != null) + { + this.entityDropItem(itemstack, 0.0F); + } + } + } + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + @Override + public boolean canBePushed() + { + return this.riddenByEntity == null; + } + + @Override + public double getMountedYOffset() { + return 2.6f; + } + + // ========== Jumping Start ========== + public void startJumping() { + this.setJumpPower(); + } + + // ========== Jump Power ========== + public void setJumpPower(int power) { + if(power < 0) + power = 0; + if(power > 99) + power = 99; + if(power < 90) + this.jumpPower = 1.0F * ((float)power / 89.0F); + else + this.jumpPower = 1.0F + (1.0F * ((float)(power - 89) / 10.0F)); + } + + public void setJumpPower() { + this.setJumpPower(89); + } + + public float getJumpPower() { + return this.jumpPower; + } + + // ========== Gliding ========== + public double getGlideScale() { + return 0.1F; + } + + // ========== Jumping ========== + public double getMountJumpHeight() { + return 0.5D; + } + + public boolean isMountJumping() { + return this.mountJumping; + } + + public void setMountJumping(boolean set) { + this.mountJumping = set; + } + + public void setMountJump(){ + this.mountJump = true; + } + + private boolean getCamelWatchableBoolean(int p_110233_1_) + { + return (this.dataWatcher.getWatchableObjectInt(26) & p_110233_1_) != 0; + } + + private void setCamelWatchableBoolean(int p_110208_1_, boolean p_110208_2_) + { + int j = this.dataWatcher.getWatchableObjectInt(26); + + if (p_110208_2_) + { + this.dataWatcher.updateObject(26, Integer.valueOf(j | p_110208_1_)); + } + else + { + this.dataWatcher.updateObject(26, Integer.valueOf(j & ~p_110208_1_)); + } + } + + public boolean isChested() + { + return this.getCamelWatchableBoolean(8); + } + + public void setChested(boolean p_110207_1_) + { + this.setCamelWatchableBoolean(8, p_110207_1_); + } + + public void riderDismount(){ + if (!this.worldObj.isRemote) + { + if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayerMP) + { + EntityPlayerMP entityplayermp = (EntityPlayerMP)this.riddenByEntity; + entityplayermp.setPositionAndUpdate(this.posX + 0.3D, this.posY, this.posZ); + + } + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCentipede.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCentipede.java index 679ba9a..651177d 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCentipede.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityCentipede.java @@ -7,6 +7,7 @@ import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; +import com.stek101.projectzulu.common.core.DefaultProps; import com.stek101.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; import com.stek101.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; import com.stek101.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; @@ -17,8 +18,8 @@ public class EntityCentipede extends EntityMaster implements IMob { public EntityCentipede(World par1World) { super(par1World); setSize(0.65f, 0.5f); - - tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false, 2.5f * 2.5f)); + this.setPosition(this.posX, this.posY, this.posZ); + tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); // tasks.addTask(4, new EntityAIFollowOwner(this, moveSpeed, 10.0F, 2.0F)); // tasks.addTask(5, new EntityAIMate(this, moveSpeed)); @@ -65,7 +66,28 @@ protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoor @Override public int getTotalArmorValue() { - return 2; + return 3; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "centlivingsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "centhurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; } @Override diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityDuckEgg.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityDuckEgg.java index 34ad7bc..88c3c00 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityDuckEgg.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityDuckEgg.java @@ -8,19 +8,21 @@ public class EntityDuckEgg extends EntityThrowable { - public EntityDuckEgg(World par1World) { - super(par1World); + super(par1World); } + public EntityDuckEgg(World par1World, EntityLivingBase par2EntityLivingBase) { - super(par1World, par2EntityLivingBase); + super(par1World, par2EntityLivingBase); } + public EntityDuckEgg(World par1World, double par2, double par4, double par6) { - super(par1World, par2, par4, par6); + super(par1World, par2, par4, par6); } + /** * Called when this EntityThrowable hits a block or entity. */ @@ -42,7 +44,6 @@ protected void onImpact(MovingObjectPosition movObjPos) for (int i = 0; i < b0; ++i) { - //EntityChicken entitychicken = new EntityChicken(this.worldObj); EntityDuck entityduck = new EntityDuck(this.worldObj); entityduck.setGrowingAge(-24000); entityduck.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericAnimal.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericAnimal.java index 2057edd..5c54ded 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericAnimal.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericAnimal.java @@ -54,8 +54,10 @@ public EntityGenericAnimal(World par1World) { @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); + CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + // Register Damage Attribute this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage); @@ -166,7 +168,7 @@ public boolean attackEntityAsMob(Entity targetEntity) { PZPacketAnimTime message = new PZPacketAnimTime().setPacketData(getEntityId(), animTime); ProjectZulu_Core.packetHandler.sendToAllAround(message, new TargetPoint(dimension, posX, posY, posZ, 30)); } - + float damage = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); int knockbackScale = 0; diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericWaterM.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericWaterM.java deleted file mode 100644 index f4ca289..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGenericWaterM.java +++ /dev/null @@ -1,254 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entity; - -import java.util.Collections; -import java.util.Iterator; -import java.util.List; - -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.ai.EntityAINearestAttackableTarget.Sorter; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntityFishHook; -import net.minecraft.stats.StatList; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -/*Original code from Oceancraft 1.4, adapted by Lots o Mobs*/ -public abstract class EntityGenericWaterM extends EntityGenericAnimal implements IAnimals { - private float factor1 = 0.0F; - private float factor2 = 0.0F; - private float randomSpeed = 0.0F; - private float randomVecX = 0.0F; - private float randomVecY = 0.0F; - private float randomVecZ = 0.0F; - protected int mobInterval = 30; - protected float mobSpeed = 0.35F; - - public EntityGenericWaterM(World p_i1695_1_) - { - super(p_i1695_1_); - this.factor2 = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; - } - - public boolean canBreatheUnderwater() - { - return true; - } - - /** - * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to - * prevent them from trampling crops - */ - protected boolean canTriggerWalking() - { - return false; - } - - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - public boolean getCanSpawnHere() - { - return this.worldObj.checkNoEntityCollision(this.boundingBox); - } - - /** - * Get number of ticks, at least during which the living entity will be silent. - */ - public int getTalkInterval() - { - return 120; - } - - /** - * Determines if an entity can be despawned, used on idle far away entities - */ - protected boolean canDespawn() - { - return true; - } - - /** - * Get the experience points the entity currently has. - */ - protected int getExperiencePoints(EntityPlayer p_70693_1_) - { - return 1 + this.worldObj.rand.nextInt(3); - } - - /** - * Gets called every tick from main Entity class - */ - public void onEntityUpdate() - { - int i = this.getAir(); - super.onEntityUpdate(); - - if (this.isEntityAlive() && !this.isInWater()) - { - --i; - this.setAir(i); - - if (this.getAir() == -20) - { - this.setAir(0); - this.attackEntityFrom(DamageSource.drown, 2.0F); - } - } - else - { - this.setAir(5000); - } - } - - @Override - public boolean isTargetPositionValid(ChunkCoordinates targetPosition){ - /* Invalid if Not Water, is below height = 3 (superflat), and if its null */ - if (targetPosition != null && (this.worldObj.isAirBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ) - || !this.worldObj.getBlock(targetPosition.posX, targetPosition.posY, targetPosition.posZ).getMaterial().equals(Material.water))){ -// targetPosition = null; - return false; - } - return true; - } - - @Override - public void moveEntityWithHeading(float par1, float par2) { - this.moveEntity(this.motionX, this.motionY, this.motionZ); - } - - protected int getAttackStrength() { - return 0; - } - - protected boolean canAttackEntity(Entity var1) { - return var1 instanceof EntityLiving && this.width > var1.width && this.height >= var1.height; - } - - protected Entity findEntityToAttack() { - List var1 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(10.0D, 6.0D, 10.0D)); - Collections.sort(var1, new Sorter(this)); - Iterator var2 = var1.iterator(); - - Entity var3; - do { - if(!var2.hasNext()) { - return null; - } - - var3 = (Entity)var2.next(); - } while(!var3.isInWater() || !this.canAttackEntity(var3)); - - return var3; - } - - public void collideWithEntity(Entity var1) { - super.collideWithEntity(var1); - if(this.entityToAttack == var1 && this.getAttackStrength() != 0) { - this.attackTime = 30; - this.entityToAttack.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength()); - } - - } - - @Override - public void onLivingUpdate() { - super.onLivingUpdate(); - - this.factor1 += this.factor2; - if(this.factor1 > 6.2831855F) { - this.factor1 -= 6.2831855F; - if(this.rand.nextInt(10) == 0) { - this.factor2 = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; - } - } - - if(this.isInWater()) { - float var1; - if(this.factor1 < 3.1415927F) { - var1 = this.factor1 / 3.1415927F; - if((double)var1 > 0.75D) { - this.randomSpeed = 1.0F; - } - } else { - this.randomSpeed *= 0.95F; - } - - if(!this.worldObj.isRemote) { - this.motionX = (double)(this.randomVecX * this.randomSpeed); - this.motionY = (double)(this.randomVecY * this.randomSpeed); - this.motionZ = (double)(this.randomVecZ * this.randomSpeed); - } - - this.renderYawOffset += (-((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / 3.1415927F - this.renderYawOffset) * 0.1F; - this.rotationYaw = this.renderYawOffset; - var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); - if(var1 > 0.07F) { - this.rotationPitch = (float)Math.atan2(this.motionY, (double)var1) * 180.0F / 3.1415927F; - } - } else { - this.motionX = 0.0D; - this.motionY -= 0.08D; - this.motionY *= 0.9800000190734863D; - this.motionZ = 0.0D; - if(!this.isInWater()) { - this.rotationPitch = 0.0F; - if(this.onGround && this.rand.nextInt(30) == 0) { - this.motionY = 0.30000001192092896D; - this.motionX = (double)(-0.4F + this.rand.nextFloat() * 0.8F); - this.motionZ = (double)(-0.4F + this.rand.nextFloat() * 0.8F); - } - } - } - - } - - @Override - protected void updateAITick() { - ++this.entityAge; - if(this.entityAge > 100) { - this.randomVecX = this.randomVecY = this.randomVecZ = 0.0F; - - } else if(this.rand.nextInt(this.mobInterval) == 0 || !this.inWater || this.isCollided || this.randomVecX == 0.0F && this.randomVecY == 0.0F && this.randomVecZ == 0.0F) { - if(this.entityToAttack != null && this.attackTime <= 0) { - if(this.entityToAttack != null) { - if(!this.entityToAttack.isDead && this.entityToAttack.isInWater() && this.getDistanceToEntity(this.entityToAttack) <= 10.0F && this.attackTime <= 0) { - this.randomVecX = (float)Math.signum(this.entityToAttack.posX - this.posX) * this.mobSpeed; - this.randomVecY = (float)Math.signum(this.entityToAttack.posY - this.posY) * 0.1F; - this.randomVecZ = (float)Math.signum(this.entityToAttack.posZ - this.posZ) * this.mobSpeed; - if(!(this.entityToAttack instanceof EntityLiving)) { - this.randomVecY -= 0.12F; - if(this.entityToAttack instanceof EntityFishHook && this.getDistanceToEntity(this.entityToAttack) < 1.0F) { - EntityFishHook var2 = (EntityFishHook)this.entityToAttack; - this.entityToAttack = null; - if(var2.field_146043_c == null) { - this.attackEntityFrom(DamageSource.causeThrownDamage(var2, var2.field_146042_b), 0.0F); - var2.field_146043_c = this; - var2.field_146042_b.addStat(StatList.field_151183_A, 1); - } - } - } - } else { - this.entityToAttack = null; - } - } - } else { - float var1 = this.rand.nextFloat() * 3.1415927F * 2.0F; - this.randomVecX = MathHelper.cos(var1) * this.mobSpeed; - this.randomVecY = -0.1F + this.rand.nextFloat() * 0.2F; - this.randomVecZ = MathHelper.sin(var1) * this.mobSpeed; - if(this.getAttackStrength() > 0) { - this.entityToAttack = this.findEntityToAttack(); - } - } - } - - this.despawnEntity(); - } - -} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGoat.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGoat.java index 34e3fbc..e2364b5 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGoat.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityGoat.java @@ -41,7 +41,7 @@ public EntityGoat(World par1World) { setSize(1.2f, 0.9f); milkCounter = 0; - giveMilk = false; + giveMilk = true; Random rand1 = new Random(); this.textureID = rand1.nextInt(3); this.timeUntilNextMilking = this.rand.nextInt(6000) + 6000; @@ -63,7 +63,7 @@ public EntityGoat(World par1World) { tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); tasks.addTask(3, new EntityAILookIdle(this)); tasks.addTask(4, new EntityAIMate(this, 0.8f)); - tasks.addTask(5, new EntityAITempt(this, 0.9f, Items.apple, false)); + tasks.addTask(5, new EntityAITempt(this, 0.9f, Items.wheat, false)); tasks.addTask(6, new EntityAIFollowParent(this, 0.9f)); tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); tasks.addTask(8, new EntityAIWander(this, 0.8f, 120)); @@ -84,7 +84,7 @@ protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoor public void onLivingUpdate() { super.onLivingUpdate(); if (Math.round(this.aggroRange) != 0) { - EAFF.updateEntityAFF(worldObj, Items.apple); + EAFF.updateEntityAFF(worldObj, Items.wheat); } /* Basic timer to determine whether entity can be milked or not */ @@ -128,7 +128,7 @@ public int getTalkInterval() { @Override public boolean isValidBreedingItem(ItemStack itemStack) { - if (itemStack != null && itemStack.getItem() == Items.apple) { + if (itemStack != null && itemStack.getItem() == Items.wheat) { this.setAngerLevel(0); this.setFleeTick(0); return true; @@ -137,14 +137,6 @@ public boolean isValidBreedingItem(ItemStack itemStack) { return super.isValidBreedingItem(itemStack); } } - -// @Override -// protected void dropRareDrop(int par1) { -// if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { -// entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 7), 1); -// } -// super.dropRareDrop(par1); -// } /** * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. @@ -164,8 +156,8 @@ else if (!p_70085_1_.inventory.addItemStackToInventory(new ItemStack(Items.milk_ { p_70085_1_.dropPlayerItemWithRandomChoice(new ItemStack(Items.milk_bucket, 1, 0), false); } - this.giveMilk = false; - this.timeUntilNextMilking = this.rand.nextInt(6000) + 6000; + //this.giveMilk = false; + //this.timeUntilNextMilking = this.rand.nextInt(6000) + 6000; return true; } else diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBase.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBase.java index a7e348d..04436f0 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBase.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBase.java @@ -33,10 +33,10 @@ public EntityHorseBase(World par1World) { tasks.addTask(1, aiControlledByPlayer = new EntityAIControlledByPlayer(this, 0.34F)); - tasks.addTask(2, new EntityAIPanic(this, 1.25f)); + tasks.addTask(2, new EntityAIPanic(this, 1.0f)); tasks.addTask(3, new EntityAIMate(this, 1.0f)); - tasks.addTask(4, new EntityAITempt(this, 1.2f, Items.apple, false)); - tasks.addTask(5, new EntityAIFollowParent(this, 1.1f)); + tasks.addTask(4, new EntityAITempt(this, 1.0f, Items.apple, false)); + tasks.addTask(5, new EntityAIFollowParent(this, 1.0f)); tasks.addTask(6, new EntityAIAttackOnCollide(this, 1.0f, false)); tasks.addTask(8, new EntityAIWander(this, 1.0f, 20)); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBlack.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBlack.java index cf4321b..d87ae5e 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBlack.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseBlack.java @@ -27,13 +27,13 @@ public boolean getCanSpawnHere() { int var3 = MathHelper.floor_double(this.posZ); boolean wasSuccesful = false; - if (CustomEntityList.HORSEBLACK.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() + if (CustomEntityList.HORSE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ wasSuccesful = true; } - if(CustomEntityList.HORSEBLACK.modData.get().reportSpawningInLog){ + if(CustomEntityList.HORSE.modData.get().reportSpawningInLog){ if(wasSuccesful){ ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s", getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); }else{ diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseRandom.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseRandom.java deleted file mode 100644 index 56c1881..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseRandom.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entity; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - -import com.stek101.projectzulu.common.api.CustomEntityList; - -public class EntityHorseRandom extends EntityHorseBase{ - - int horseType = -1; - - public EntityHorseRandom(World par1World) { - super(par1World); - horseType = rand.nextInt(7); - } - - @Override - protected void entityInit(){ - super.entityInit(); - /* Horse Type */ - this.dataWatcher.addObject(26, Short.valueOf((short) 0)); - } - - public void updateHorseType(){ - this.dataWatcher.updateObject(26, (short)(horseType)); - } - - public int getHorseType(){ - return this.dataWatcher.getWatchableObjectShort(26); - } - - @Override - public void onUpdate() { - horseType = getHorseType(); - if (!this.isDead) { - List horses = new ArrayList(); - if (CustomEntityList.HORSEBEIGE.modData.isPresent()) { - horses.add(new EntityHorseBeige(worldObj)); - } - - if (CustomEntityList.HORSEBLACK.modData.isPresent()) { - horses.add(new EntityHorseBlack(worldObj)); - } - - if (CustomEntityList.HORSEBROWN.modData.isPresent()) { - horses.add(new EntityHorseBrown(worldObj)); - } - - if (CustomEntityList.HORSEDARKBLACK.modData.isPresent()) { - horses.add(new EntityHorseDarkBlack(worldObj)); - } - - if (CustomEntityList.HORSEDARKBROWN.modData.isPresent()) { - horses.add(new EntityHorseDarkBrown(worldObj)); - } - - if (CustomEntityList.HORSEGREY.modData.isPresent()) { - horses.add(new EntityHorseGrey(worldObj)); - } - - if (CustomEntityList.HORSEWHITE.modData.isPresent()) { - horses.add(new EntityHorseWhite(worldObj)); - } - - EntityHorseBase entityToReplace; - if (horses.isEmpty()) { - entityToReplace = null; - } else if (horseType < horses.size()) { - entityToReplace = horses.get(horseType); - } else { - Collections.shuffle(horses); - entityToReplace = horses.get(0); - } - - this.setDead(); - if (entityToReplace != null) { - entityToReplace.setPositionAndRotation(posX, posY, posZ, rotationYaw, rotationPitch); - worldObj.spawnEntityInWorld(entityToReplace); - } - } - super.onUpdate(); - } - - @Override - public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) { - super.readEntityFromNBT(par1nbtTagCompound); - horseType = par1nbtTagCompound.getByte("HorseType"); - updateHorseType(); - - } - - @Override - public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) { - super.writeEntityToNBT(par1nbtTagCompound); - par1nbtTagCompound.setByte("HorseType", (byte) horseType); - updateHorseType(); - - } -} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseWhite.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseWhite.java deleted file mode 100644 index 570485e..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityHorseWhite.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entity; - -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; - -import com.stek101.projectzulu.common.api.CustomEntityList; -import com.stek101.projectzulu.common.core.ProjectZuluLog; - -public class EntityHorseWhite extends EntityHorseBase{ - - public EntityHorseWhite(World par1World) { - super(par1World); - - } - - /** - * Checks if the entity's current position is a valid location to spawn this entity. - */ - @Override - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); - boolean wasSuccesful = false; - - if (CustomEntityList.HORSEWHITE.modData.get().secondarySpawnRate - rand.nextInt(100) >= 0 && super.getCanSpawnHere() - && worldObj.getClosestPlayerToEntity(this, 32) == null && this.worldObj.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 1 - && worldObj.canBlockSeeTheSky(var1, var2, var3) ){ - wasSuccesful = true; - } - - if(CustomEntityList.HORSEWHITE.modData.get().reportSpawningInLog){ - if(wasSuccesful){ - ProjectZuluLog.info("Successfully spawned %s at X:%s Y:%s Z:%s in %s",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - }else{ - ProjectZuluLog.info("Failed to spawn %s at X:%s Y:%s Z:%s in %s, Spawning Location Inhospitable",getCommandSenderName(),var1,var2,var3,worldObj.getBiomeGenForCoords(var1, var3)); - } - } - return wasSuccesful; - } -} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMaster.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMaster.java index 0cb6903..7c22e0a 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMaster.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMaster.java @@ -11,12 +11,12 @@ public abstract class EntityMaster extends EntityGenericAnimal { List followerList = new ArrayList(); - int numberOfFollowers = 9; + int numberOfFollowers = 5; boolean spawnFollowers = true; /* Represents the increments between each slave-Piece, used to determine number of locations needed to track */ - int distanceIncrements = 10; + int distanceIncrements = 5; float distancePerIncrement; boolean isPositionListSetup = false; @@ -25,7 +25,7 @@ public abstract class EntityMaster extends EntityGenericAnimal { public EntityMaster(World par1World) { super(par1World); - distancePerIncrement = width / distanceIncrements; + distancePerIncrement = (width/2) / distanceIncrements; while (followerList.size() < numberOfFollowers) { followerList.add(null); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMonkey.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMonkey.java new file mode 100644 index 0000000..e405711 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMonkey.java @@ -0,0 +1,209 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.EnumSet; + +import net.minecraft.entity.EntityList; +import net.minecraft.entity.ai.EntityAILookIdle; +import net.minecraft.entity.ai.EntityAISwimming; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFollowParent; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMate; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIMoveTowardsRestriction; +import com.stek101.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIPanic; +import com.stek101.projectzulu.common.mobs.entityai.EntityAITempt; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIWander; + +public class EntityMonkey extends EntityGenericAnimal implements IAnimals{ + //private EntityAIArrowAttack aiRockAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private EntityAFightorFlight EAFF; + private CustomEntityList entityEntry; + private float aggroLevel; + private double aggroRange; + private boolean throwRock = false; + private int throwCooldown = 6 * 20; + private int throwTimer = 100; + private int stage = 1; + + public EntityMonkey(World par1World) { + super(par1World); + setSize(1.4f, 0.9f); + this.setPosition(this.posX, this.posY, this.posZ); + this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + + /* Check if aggroLevel and aggroRange have valid values to activate AFoF */ + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + getNavigator().setAvoidsWater(true); + tasks.addTask(0, new EntityAISwimming(this)); + tasks.addTask(1, new EntityAIPanic(this, 1.0f)); + tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0f, false)); + tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0F)); + tasks.addTask(4, new EntityAILookIdle(this)); + tasks.addTask(5, new EntityAIMate(this, 0.8f)); + tasks.addTask(6, new EntityAITempt(this, 0.9f, Items.bread, false)); + tasks.addTask(7, new EntityAIFollowParent(this, 0.9f)); + tasks.addTask(8, new EntityAIWander(this, 0.8f, 120)); + tasks.addTask(9, new EntityAIMoveTowardsRestriction(this, 1.0f)); + + targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); + targetTasks.addTask(2, + new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + EntityPlayer.class, 16.0F, 0, true)); + + } + + @Override + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + + /** + * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is + * false. + */ + public void setBesideClimbableBlock(boolean p_70839_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_70839_1_) + { + b0 = (byte)(b0 | 1); + } + else + { + b0 &= -2; + } + + this.dataWatcher.updateObject(16, Byte.valueOf(b0)); + } + + /** + * returns true if this entity is by a ladder, false otherwise + */ + @Override + public boolean isOnLadder() + { + return this.isBesideClimbableBlock(); + } + + /** + * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using + * setBesideClimableBlock. + */ + public boolean isBesideClimbableBlock() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + + @Override + protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { + return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj, Items.bread); + } + + /* If Shoot Timer is 0, tell Entity its Allowed to Shoot a Rock*/ + if (throwTimer == 0) { + this.throwRock = true; + this.throwTimer = this.throwCooldown; + + //EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); + if (this.angerLevel > 0){ + if (this.throwRock == true && !worldObj.isRemote) { + this.throwRockAtTarget(); + this.throwRock = false; + } + } + } + + this.throwTimer = Math.max(this.throwTimer - 1, 0); + } + + @Override + public int getTotalArmorValue() { + return 1; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "monkeylivingsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "monkeyhurtsound"; + } + + @Override + public int getTalkInterval() { + return 160; + } + + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + if (itemStack != null && itemStack.getItem() == Items.bread) { + this.setAngerLevel(0); + this.setFleeTick(0); + return true; + + } else { + return super.isValidBreedingItem(itemStack); + } + } + + @Override + protected void updateAITick() { + super.updateAITick(); + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } + + private void throwRockAtTarget() { + EntityPlayer targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 32.0D); + + if (targetedEntity != null) { + EntityThrowingRock entityTR = new EntityThrowingRock(this.worldObj, this); + double d0 = targetedEntity.posX - this.posX; + double d1 = targetedEntity.posY + (double)targetedEntity.getEyeHeight() - 1.100000023841858D - entityTR.posY; + double d2 = targetedEntity.posZ - this.posZ; + float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F; + entityTR.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F); + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); + this.worldObj.spawnEntityInWorld(entityTR); + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMummyPharaoh.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMummyPharaoh.java index dd6718f..bde6c30 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMummyPharaoh.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityMummyPharaoh.java @@ -28,7 +28,7 @@ import cpw.mods.fml.common.Loader; -public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob { +public class EntityMummyPharaoh extends EntityGenericAnimal implements IMob{ Vec3 startingPosition; int stage = 1; @@ -423,4 +423,5 @@ protected String getHurtSound() { public int getTalkInterval() { return 160; } + } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityPZBat.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityPZBat.java new file mode 100644 index 0000000..23c28af --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityPZBat.java @@ -0,0 +1,224 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.EnumSet; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityList; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.passive.IAnimals; +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.AxisAlignedBB; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.api.CustomEntityList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.mobs.EntityAFightorFlight; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIAttackOnCollide; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIFlyingWander; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIHurtByTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAINearestAttackableTarget; +import com.stek101.projectzulu.common.mobs.entityai.EntityAIStayStill; + +public class EntityPZBat extends EntityGenericAnimal implements IAnimals { + int stayStillTimer = 0; + private EntityAFightorFlight EAFF; + private float aggroLevel; + private double aggroRange; + boolean manyBats = false; + //private int maxTargetHealthToAttack = (Integer) CustomEntityList.getByEntity(this).modData.get().customData + // .get("maxTargetHealth"); + float curiosity = 0; + int ticksToCheckAbilities = 3; + + public EntityPZBat(World par1World) { + super(par1World); + // noClip = true; + setSize(1.0f, 1.4f); + + float moveSpeed = 0.22f; + CustomEntityList entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); + if (entityEntry != null && entityEntry.modData.get().entityProperties != null) { + // TODO: Switch to this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()??? + moveSpeed = entityEntry.modData.get().entityProperties.moveSpeed; + this.aggroLevel = entityEntry.modData.get().entityProperties.aggroLevel; + this.aggroRange = entityEntry.modData.get().entityProperties.aggroRange; + } + + if (Math.round(this.aggroRange) != 0) { + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + } + + this.maxFlightHeight = 7; + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(2, new EntityAIStayStill(this, EntityStates.posture)); + this.tasks.addTask(3, new EntityAIAttackOnCollide(this, 1.0f, false)); + this.tasks.addTask(4, new EntityAIFlyingWander(this, (float) moveSpeed)); + this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 16.0F)); + + targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, false)); + targetTasks.addTask(2, + new EntityAINearestAttackableTarget(this, EnumSet.of(EntityStates.attacking, EntityStates.looking), + EntityPlayer.class, 16.0F, 0, true)); + } + + @Override + public boolean defaultGrounded() { + return false; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + @Override + protected void fall(float par1) { + } + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + @Override + protected void updateFallState(double par1, boolean par3) { + } + + @Override + public int getTotalArmorValue() { + return 1; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + @Override + protected String getLivingSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "pzbathurtsound"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + @Override + protected String getHurtSound() { + return DefaultProps.mobKey + ":" + DefaultProps.entitySounds + "pzbatlivingsound"; + } + + @Override + public int getTalkInterval() { + return 120; + } + + @Override + public void onLivingUpdate() { + super.onLivingUpdate(); + if (Math.round(this.aggroRange) != 0) { + EAFF.updateEntityAFF(worldObj); + } + } + + /** + * Plays step sound at given x, y, z for the entity + */ + @Override + protected void func_145780_a(int xCoord, int yCoord, int zCoord, Block stepBlock) { + this.worldObj.playSoundAtEntity(this, "sounds.birdplop", 1.0F, 1.0F); + } + + @Override + public boolean isValidBreedingItem(ItemStack itemStack) { + return false; + } + + @Override + protected void updateAITasks() { + super.updateAITasks(); + + if (ticksExisted % ticksToCheckAbilities == 0) { + + /* Check if their is a nearby Player to Follow */ + EntityPlayer nearbyPlayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); + if (nearbyPlayer != null) { + int distToTargetXZ = (int) Math.sqrt(Math.pow(nearbyPlayer.posX - this.posX, 2) + + Math.pow(nearbyPlayer.posZ - this.posZ, 2)); + if (distToTargetXZ < 16) { + curiosity = 140; + } + } + shouldFollow = curiosity > 0 ? true : false; + curiosity = Math.max(curiosity - ticksToCheckAbilities, 0); + + /* + * Assuming we're following a Player, check if We Should Attack by Comparing number of Nearby Vultures to + * the Health of our Target + */ + Entity targetedEntity = nearbyPlayer; + if (curiosity > 0 && targetedEntity != null) { + int nearbyVultures = 0; + AxisAlignedBB var15 = this.boundingBox.copy(); + var15 = var15.expand(10, 10, 10); + List nearbyEntities = this.worldObj.getEntitiesWithinAABB(EntityVulture.class, var15); + if (nearbyEntities != null && !nearbyEntities.isEmpty()) { + Iterator var10 = nearbyEntities.iterator(); + + while (var10.hasNext()) { + Entity var4 = (Entity) var10.next(); + if (var4 instanceof EntityPZBat + && (((EntityPZBat) var4).getEntityState() == EntityStates.following || ((EntityVulture) var4) + .getEntityState() == EntityStates.attacking)) { + nearbyVultures += 1; + } + } + } + // if (((EntityLivingBase) targetedEntity).getHealth() < maxTargetHealthToAttack + // && ((EntityLivingBase) targetedEntity).getHealth() < nearbyVultures * 4) { + // setAngerLevel(400); + // } + } + } + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + @Override + protected boolean canTriggerWalking() { + return false; + } + + // @Override + // protected boolean isValidLightLevel(World world, int xCoord, int yCoord, int zCoord) { + // return this.worldObj.getSavedLightValue(EnumSkyBlock.Block, xCoord, yCoord, zCoord) < 1; + // } + + @Override + protected boolean isValidLocation(World world, int xCoord, int yCoord, int zCoord) { + return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord); + } + + // @Override + // protected void dropRareDrop(int par1) { + // if (Loader.isModLoaded(DefaultProps.BlocksModId) && BlockList.mobHeads.isPresent()) { + // entityDropItem(new ItemStack(BlockList.mobHeads.get(), 1, 0), 1); + // } + // super.dropRareDrop(par1); + // } + + @Override + public boolean attackEntityAsMob(Entity entity) { + boolean success = super.attackEntityAsMob(entity); + if (entity instanceof EntityLivingBase) { + ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.poison.id, 40, 1)); + success = true; + } + return success; + } + + +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityRabbit.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityRabbit.java index b528aa1..7ff068a 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityRabbit.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityRabbit.java @@ -34,7 +34,7 @@ public EntityRabbit(World par1World) { setSize(0.5f, 0.5f); Random rand1 = new Random(); - this.textureID = rand1.nextInt(3); + this.textureID = rand1.nextInt(9); this.entityEntry = CustomEntityList.getByName(EntityList.getEntityString(this)); @@ -45,7 +45,7 @@ public EntityRabbit(World par1World) { } if (Math.round(this.aggroRange) != 0) { - EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange); + EAFF = new EntityAFightorFlight().setEntity(this, worldObj, this.aggroLevel, this.aggroRange, true); } getNavigator().setAvoidsWater(true); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityThrowingRock.java b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityThrowingRock.java new file mode 100644 index 0000000..974808c --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entity/EntityThrowingRock.java @@ -0,0 +1,81 @@ +package com.stek101.projectzulu.common.mobs.entity; + +import java.util.Random; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.projectile.EntityThrowable; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; + +import com.stek101.projectzulu.common.ProjectZulu_Core; +import com.stek101.projectzulu.common.api.ItemList; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.relauncher.Side; + +public class EntityThrowingRock extends EntityThrowable +{ + + public EntityThrowingRock(World par1World) + { + super(par1World); + } + public EntityThrowingRock(World par1World, EntityLivingBase par2EntityLivingBase) + { + super(par1World, par2EntityLivingBase); + } + public EntityThrowingRock(World par1World, double par2, double par4, double par6) + { + super(par1World, par2, par4, par6); + } + + + + /** + * Called when this EntityThrowable hits a block or entity. + */ + protected void onImpact(MovingObjectPosition movObjPos) + { + if (movObjPos.entityHit != null) + { + movObjPos.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 2.0F); + } + + if (!this.worldObj.isRemote && this.rand.nextInt(4) == 0) + { + byte b0 = 1; + + if (this.rand.nextInt(32) == 0) + { + b0 = 4; + } + + Random rand = new Random(); + EntityPlayer player = ProjectZulu_Core.proxy.getClientPlayer(); + Side side = FMLCommonHandler.instance().getEffectiveSide(); + + if (side == Side.SERVER) { + double xrand = (double) (worldObj.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double yrand = (double) (worldObj.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + double zrand = (double) (worldObj.rand.nextFloat() * 0.7F) + (double) (0.3F) * 0.5D; + EntityItem itemDrop = new EntityItem(worldObj, (double) this.posX + xrand, (double) this.posY + yrand, (double) this.posZ + zrand, new ItemStack(ItemList.throwingRock.get())); + itemDrop.delayBeforeCanPickup = 10; + worldObj.spawnEntityInWorld(itemDrop); + } + } + + for (int j = 0; j < 8; ++j) + { + this.worldObj.spawnParticle("crit", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + + if (!this.worldObj.isRemote) + { + this.setDead(); + } + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIAvoidEntity.java b/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIAvoidEntity.java index b2eebae..9cdaba2 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIAvoidEntity.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIAvoidEntity.java @@ -12,6 +12,7 @@ import com.stek101.projectzulu.common.mobs.entity.EntityGenericCreature; import com.stek101.projectzulu.common.mobs.entity.EntityGenericTameable; +import com.stek101.projectzulu.common.mobs.entity.EntityStates; public class EntityAIAvoidEntity extends EntityAIBase{ @@ -44,6 +45,9 @@ public boolean isEntityApplicable(Entity p_82704_1_) private Class targetEntityClass; //private static final String __OBFID = "CL_00001574"; + private boolean shouldHop = false; + private int slimeJumpDelay = 0; + public EntityAIAvoidEntity(EntityGenericCreature par1, Class par2, float par3, double par4, double par5) { this.theEntity = par1; @@ -54,6 +58,12 @@ public EntityAIAvoidEntity(EntityGenericCreature par1, Class par2, float par3, d this.entityPathNavigate = par1.getNavigator(); this.setMutexBits(1); } + + public EntityAIAvoidEntity(EntityGenericCreature par1, Class par2, float par3, double par4, double par5, boolean shouldHop) + { + this(par1, par2, par3, par4, par5); + this.shouldHop = shouldHop; + } /** * Returns whether the EntityAIBase should begin execution. @@ -108,6 +118,10 @@ else if (this.closestLivingEntity.getDistanceSq(vec3.xCoord, vec3.yCoord, vec3.z */ public boolean continueExecuting() { + if(shouldHop){ + tryToHop(); + } + return !this.entityPathNavigate.noPath(); } @@ -117,6 +131,9 @@ public boolean continueExecuting() public void startExecuting() { this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); + if(shouldHop){ + tryToHop(); + } } /** @@ -142,7 +159,31 @@ public void updateTask() } } - + public void tryToHop(){ + if (theEntity.onGround && this.slimeJumpDelay-- <= 0){ + this.slimeJumpDelay = this.getJumpDelay(); + + theEntity.getJumpHelper().setJumping(); + theEntity.getNavigator().setSpeed(this.nearSpeed); + } + else{ + theEntity.getNavigator().setSpeed(0); + } + } + + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + + protected int getJumpDelay(){ + if (this.theEntity.getEntityState() == EntityStates.fleeing){ + return theEntity.getRNG().nextInt(3); + } + else + { + return theEntity.getRNG().nextInt(5) + 2; + } + } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIPanic.java b/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIPanic.java index 5db8c89..ffff9b8 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIPanic.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entityai/EntityAIPanic.java @@ -89,7 +89,14 @@ public void tryToHop(){ /** * Gets the amount of time the slime needs to wait between jumps. */ + protected int getJumpDelay(){ - return theEntityCreature.getRNG().nextInt(5) + 2; + if (this.theEntityCreature.getEntityState() == EntityStates.fleeing){ + return theEntityCreature.getRNG().nextInt(3); + } + else + { + return theEntityCreature.getRNG().nextInt(5) + 2; + } } } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/AntRavegerDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/AntRavegerDeclaration.java new file mode 100644 index 0000000..c747ca6 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/AntRavegerDeclaration.java @@ -0,0 +1,76 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.HashSet; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.core.ConfigHelper; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.ItemGenerics; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityAntRavager; +import com.stek101.projectzulu.common.mobs.models.ModelAntRavager; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericLiving; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AntRavegerDeclaration extends SpawnableDeclaration { + + public AntRavegerDeclaration() { + super("RavagerAnt", 61, EntityAntRavager.class, EnumCreatureType.creature); + setSpawnProperties(8, 100, 1, 4); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 2); + + eggColor1 = (44 << 16) + (44 << 8) + 132; + eggColor2 = (188 << 16) + (188 << 8) + 22; + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 2); + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, + ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); + customMobData.entityProperties = new EntityProperties(9f, 2.0f, 0.10f, 0.0f, 0.5f, 32.0f, 20.0f, 16D).createFromConfig( + config, mobName); + super.outputDataToList(config, customMobData); + } + + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + //int r1 = (int) (Math.random()* goatTextures.length); + + return new RenderGenericLiving(new ModelAntRavager(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + "textures/antravager.png")); + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.birchForestHills.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.birchForest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.roofedForest.biomeName); + + HashSet nonfrozenForest = new HashSet(); + nonfrozenForest.addAll(typeToArray(Type.PLAINS)); + nonfrozenForest.addAll(typeToArray(Type.FOREST)); + nonfrozenForest.addAll(typeToArray(Type.CONIFEROUS)); + nonfrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonfrozenForest); + return defaultBiomesToSpawn; + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ArmadilloDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ArmadilloDeclaration.java index a686519..8adb371 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ArmadilloDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ArmadilloDeclaration.java @@ -56,12 +56,13 @@ public RenderWrapper getEntityrender(Class entityCla @Override public HashSet getDefaultBiomesToSpawn() { HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); - defaultBiomesToSpawn.add("Mountainous Desert"); - defaultBiomesToSpawn.add("Savanna"); - defaultBiomesToSpawn.add("Mountain Ridge"); - defaultBiomesToSpawn.addAll(typeToArray(Type.DESERT)); + defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.jungleEdge.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.savanna.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); + defaultBiomesToSpawn.addAll(typeToArray(Type.JUNGLE)); + defaultBiomesToSpawn.addAll(typeToArray(Type.SAVANNA)); return defaultBiomesToSpawn; } } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BeetleASDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BeetleASDeclaration.java new file mode 100644 index 0000000..79f3f68 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BeetleASDeclaration.java @@ -0,0 +1,79 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleAS; +import com.stek101.projectzulu.common.mobs.models.ModelBeetleAS; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericLivingMT; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BeetleASDeclaration extends SpawnableDeclaration { + private final List entityTextures = new ArrayList (); + + public BeetleASDeclaration() { + super("BeetleAS", 62, EntityBeetleAS.class, EnumCreatureType.ambient); + setSpawnProperties(10, 5, 1, 1); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 1); + + eggColor1 = (226 << 16) + (126 << 8) + 0; + eggColor2 = (64 << 16) + (113 << 8) + 143; + + entityTextures.add("textures/beetleas1.png"); + entityTextures.add("textures/beetleas2.png"); + entityTextures.add("textures/beetleas3.png"); + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + //ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); + customMobData.entityProperties = new EntityProperties(1f, 0.0f, 0.15f).createFromConfig(config, mobName); + super.outputDataToList(config, customMobData); + } + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + // return new RenderGenericLiving(new ModelBeetleAS(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + // "textures/beetleas1.png")); + return new RenderGenericLivingMT(new ModelBeetleAS(), 0.5f, entityTextures); + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); + defaultBiomesToSpawn.add("Autumn Woods"); + defaultBiomesToSpawn.add("Birch Forest"); + defaultBiomesToSpawn.add("Forested Hills"); + defaultBiomesToSpawn.add("Forested Island"); + defaultBiomesToSpawn.add("Green Hills"); + defaultBiomesToSpawn.add("Redwood Forest"); + defaultBiomesToSpawn.add("Lush Redwoods"); + defaultBiomesToSpawn.add("Temperate Rainforest"); + defaultBiomesToSpawn.add("Woodlands"); + + HashSet nonFrozenForest = new HashSet(); + nonFrozenForest.addAll(typeToArray(Type.FOREST)); + nonFrozenForest.addAll(typeToArray(Type.PLAINS)); + nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonFrozenForest); + + return defaultBiomesToSpawn; + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BeetleBSDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BeetleBSDeclaration.java new file mode 100644 index 0000000..2571960 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BeetleBSDeclaration.java @@ -0,0 +1,79 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityBeetleBS; +import com.stek101.projectzulu.common.mobs.models.ModelBeetleBS; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericLivingMT; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BeetleBSDeclaration extends SpawnableDeclaration { + private final List entityTextures = new ArrayList (); + + public BeetleBSDeclaration() { + super("BeetleBS", 63, EntityBeetleBS.class, EnumCreatureType.ambient); + setSpawnProperties(10, 5, 1, 1); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 1); + + eggColor1 = (226 << 16) + (126 << 8) + 0; + eggColor2 = (101 << 16) + (101 << 8) + 143; + + entityTextures.add("textures/beetlebs1.png"); + entityTextures.add("textures/beetlebs2.png"); + entityTextures.add("textures/beetlebs3.png"); + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + //ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); + customMobData.entityProperties = new EntityProperties(1f, 0.0f, 0.15f).createFromConfig(config, mobName); + super.outputDataToList(config, customMobData); + } + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + // return new RenderGenericLiving(new ModelBeetleAS(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + // "textures/beetleas1.png")); + return new RenderGenericLivingMT(new ModelBeetleBS(), 0.5f, entityTextures); + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); + defaultBiomesToSpawn.add("Autumn Woods"); + defaultBiomesToSpawn.add("Birch Forest"); + defaultBiomesToSpawn.add("Forested Hills"); + defaultBiomesToSpawn.add("Forested Island"); + defaultBiomesToSpawn.add("Green Hills"); + defaultBiomesToSpawn.add("Redwood Forest"); + defaultBiomesToSpawn.add("Lush Redwoods"); + defaultBiomesToSpawn.add("Temperate Rainforest"); + defaultBiomesToSpawn.add("Woodlands"); + + HashSet nonFrozenForest = new HashSet(); + nonFrozenForest.addAll(typeToArray(Type.FOREST)); + nonFrozenForest.addAll(typeToArray(Type.PLAINS)); + nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonFrozenForest); + + return defaultBiomesToSpawn; + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BloomDoomDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BloomDoomDeclaration.java new file mode 100644 index 0000000..002c3a0 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/BloomDoomDeclaration.java @@ -0,0 +1,83 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.HashSet; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityBloomDoom; +import com.stek101.projectzulu.common.mobs.models.ModelBloomDoom; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericIdle; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BloomDoomDeclaration extends SpawnableDeclaration { + //private final List entityTextures = new ArrayList (); + + public BloomDoomDeclaration() { + super("BloomDoom", 64, EntityBloomDoom.class, EnumCreatureType.creature); + setSpawnProperties(10, 5, 1, 1); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 1); + + eggColor1 = (133 << 16) + (233 << 8) + 0; + eggColor2 = (101 << 16) + (200 << 8) + 143; + + // entityTextures.add("textures/beetlebs1.png"); + // entityTextures.add("textures/beetlebs2.png"); + // entityTextures.add("textures/beetlebs3.png"); + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + //ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.feather, 0, 8); + customMobData.entityProperties = new EntityProperties(15f, 2.0f, 0.25f).createFromConfig(config, mobName); + //customMobData.entityProperties = new EntityProperties(15f, 3.0f, 0.3f, 0.0f, 0.0f, 32.0f, 50f, 16D).createFromConfig(config, mobName); + super.outputDataToList(config, customMobData); + } + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + //return new RenderGenericLiving(new ModelBloomDoom(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + // "textures/bloomdoom.png")); + + return new RenderGenericIdle(new ModelBloomDoom(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + "textures/bloomdoom0.png"), new ResourceLocation(DefaultProps.mobKey, "textures/bloomdoomidle0.png")); + + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); + defaultBiomesToSpawn.add("Autumn Woods"); + defaultBiomesToSpawn.add("Birch Forest"); + defaultBiomesToSpawn.add("Forested Hills"); + defaultBiomesToSpawn.add("Forested Island"); + defaultBiomesToSpawn.add("Green Hills"); + defaultBiomesToSpawn.add("Redwood Forest"); + defaultBiomesToSpawn.add("Lush Redwoods"); + defaultBiomesToSpawn.add("Temperate Rainforest"); + defaultBiomesToSpawn.add("Woodlands"); + + HashSet nonFrozenForest = new HashSet(); + nonFrozenForest.addAll(typeToArray(Type.FOREST)); + nonFrozenForest.addAll(typeToArray(Type.PLAINS)); + nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonFrozenForest); + + return defaultBiomesToSpawn; + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/CamelDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/CamelDeclaration.java new file mode 100644 index 0000000..e18471f --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/CamelDeclaration.java @@ -0,0 +1,80 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.HashSet; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Items; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.core.ConfigHelper; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.ItemGenerics; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityCamel; +import com.stek101.projectzulu.common.mobs.models.ModelCamel; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class CamelDeclaration extends SpawnableDeclaration { + + public CamelDeclaration() { + super("Camel", 58, EntityCamel.class, EnumCreatureType.creature); + setSpawnProperties(10, 100, 1, 4); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 2); + + eggColor1 = (231 << 16) + (231 << 8) + 12; + eggColor2 = (180 << 16) + (180 << 8) + 12; + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, + Items.beef, 0, 10); + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, + ItemList.genericCraftingItems, ItemGenerics.Properties.BlackLichen.meta(), 4); + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, + ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); + ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); + customMobData.entityProperties = new EntityProperties(20f, 5.0f, 0.20f, 0.0f, 0.5f, 32.0f, 20.0f, 16D).createFromConfig( + config, mobName); + super.outputDataToList(config, customMobData); + } + + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + //return new RenderGenericLiving(new ModelCamel(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + // "textures/camel.png")); + return new RenderGenericHorse(new ModelCamel(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + "textures/camel.png"), new ResourceLocation(DefaultProps.mobKey, + "textures/camel_saddled.png")); + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.desertHills.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.savanna.biomeName); + + HashSet nonfrozenForest = new HashSet(); + nonfrozenForest.addAll(typeToArray(Type.DESERT)); + nonfrozenForest.addAll(typeToArray(Type.SAVANNA)); + nonfrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonfrozenForest); + return defaultBiomesToSpawn; + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/DeerDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/DeerDeclaration.java index 7b932a9..b6d94f8 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/DeerDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/DeerDeclaration.java @@ -28,7 +28,7 @@ public class DeerDeclaration extends SpawnableDeclaration { public DeerDeclaration() { super("Deer", 49, EntityDeer.class, EnumCreatureType.creature); - setSpawnProperties(12, 100, 1, 4); + setSpawnProperties(8, 100, 1, 4); setRegistrationProperties(128, 3, true); setDropAmount(0, 2); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBeigeDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBeigeDeclaration.java deleted file mode 100644 index c4a67dd..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBeigeDeclaration.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseBeige; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBeigeDeclaration extends SpawnableDeclaration { - - public HorseBeigeDeclaration() { - super("Horse Beige", 28, EntityHorseBeige.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_beige.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_beige_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBlackDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBlackDeclaration.java index 14b0875..916c25e 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBlackDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBlackDeclaration.java @@ -65,8 +65,9 @@ public void outputDataToList(Configuration config, CustomMobData customMobData) ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); ConfigHelper.userItemConfigRangeToMobData(config, "MOB CONTROLS." + mobName, customMobData); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - CustomEntityList.HORSEBLACK.modData = Optional.of(customMobData); + customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f, 0.0f, 0.5f, 32.0f, 10.0f, 16D).createFromConfig( + config, mobName); + CustomEntityList.HORSE.modData = Optional.of(customMobData); } @Override @@ -83,12 +84,12 @@ public HashSet getDefaultBiomesToSpawn() { HashSet defaultBiomesToSpawn = new HashSet(); defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.savanna.biomeName); defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); HashSet nonFrozenForest = new HashSet(); nonFrozenForest.addAll(typeToArray(Type.FOREST)); nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); defaultBiomesToSpawn.addAll(nonFrozenForest); return defaultBiomesToSpawn; } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBrownDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBrownDeclaration.java deleted file mode 100644 index 748eb92..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseBrownDeclaration.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseBrown; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseBrownDeclaration extends SpawnableDeclaration { - - public HorseBrownDeclaration() { - super("Horse Brown", 30, EntityHorseBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (137 << 16) + (78 << 8) + 0; - eggColor2 = (81 << 16) + (46 << 8) + 0; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseDarkBlackDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseDarkBlackDeclaration.java deleted file mode 100644 index e7a0a6c..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseDarkBlackDeclaration.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseDarkBlack; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBlackDeclaration extends SpawnableDeclaration { - - public HorseDarkBlackDeclaration() { - super("Horse Dark Black", 31, EntityHorseDarkBlack.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (17 << 16) + (17 << 8) + 17; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_dark_black.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_dark_black_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseDarkBrownDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseDarkBrownDeclaration.java deleted file mode 100644 index 81ed86e..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseDarkBrownDeclaration.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseDarkBrown; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseDarkBrownDeclaration extends SpawnableDeclaration { - - public HorseDarkBrownDeclaration() { - super("Horse Dark Brown", 32, EntityHorseDarkBrown.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_dark_brown.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_dark_brown_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseGreyDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseGreyDeclaration.java deleted file mode 100644 index d339d2b..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseGreyDeclaration.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseGrey; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseGreyDeclaration extends SpawnableDeclaration { - - public HorseGreyDeclaration() { - super("Horse Grey", 33, EntityHorseGrey.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - eggColor1 = (102 << 16) + (73 << 8) + 34; - eggColor2 = (60 << 16) + (43 << 8) + 20; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_grey.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_grey_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseRandomDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseRandomDeclaration.java deleted file mode 100644 index 485d6b9..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseRandomDeclaration.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseRandom; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseRandomDeclaration extends SpawnableDeclaration { - - public HorseRandomDeclaration() { - super("HorseRandom", 42, EntityHorseRandom.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 3, 4); - setRegistrationProperties(128, 3, true); - setDropAmount(0, 3); - - shouldExist = false; - eggColor1 = (200 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - defaultBiomesToSpawn.add("Autumn Woods"); - defaultBiomesToSpawn.add("Birch Forest"); - defaultBiomesToSpawn.add("Forested Hills"); - defaultBiomesToSpawn.add("Forested Island"); - defaultBiomesToSpawn.add("Green Hills"); - defaultBiomesToSpawn.add("Redwood Forest"); - defaultBiomesToSpawn.add("Lush Redwoods"); - defaultBiomesToSpawn.add("Temperate Rainforest"); - defaultBiomesToSpawn.add("Woodlands"); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseWhiteDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseWhiteDeclaration.java deleted file mode 100644 index ca05ada..0000000 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/HorseWhiteDeclaration.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.stek101.projectzulu.common.mobs.entitydefaults; - -import java.util.HashSet; - -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.init.Items; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary.Type; -import net.minecraftforge.common.config.Configuration; - -import com.stek101.projectzulu.common.api.CustomMobData; -import com.stek101.projectzulu.common.api.ItemList; -import com.stek101.projectzulu.common.core.ConfigHelper; -import com.stek101.projectzulu.common.core.DefaultProps; -import com.stek101.projectzulu.common.core.ItemGenerics; -import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; -import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; -import com.stek101.projectzulu.common.mobs.entity.EntityHorseWhite; -import com.stek101.projectzulu.common.mobs.models.ModelHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderGenericHorse; -import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -public class HorseWhiteDeclaration extends SpawnableDeclaration { - - public HorseWhiteDeclaration() { - super("Horse White", 34, EntityHorseWhite.class, EnumCreatureType.creature); - setSpawnProperties(5, 100, 1, 2); - setRegistrationProperties(128, 3, true); - - eggColor1 = (245 << 16) + (245 << 8) + 245; - eggColor2 = (51 << 16) + (51 << 8) + 51; - } - - @Override - public void outputDataToList(Configuration config, CustomMobData customMobData) { - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - Items.beef, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 10); - ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, - ItemList.genericCraftingItems, ItemGenerics.Properties.LargeHeart.meta(), 4); - customMobData.entityProperties = new EntityProperties(20f, 3.0f, 0.3f).createFromConfig(config, mobName); - super.outputDataToList(config, customMobData); - } - - @Override - @SideOnly(Side.CLIENT) - public RenderWrapper getEntityrender(Class entityClass) { - return new RenderGenericHorse(new ModelHorse(), 0.5f, new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_white.png"), new ResourceLocation(DefaultProps.mobKey, - "textures/horse/horse_white_saddled.png")); - } - - @Override - public HashSet getDefaultBiomesToSpawn() { - HashSet defaultBiomesToSpawn = new HashSet(); - defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); - - HashSet nonFrozenForest = new HashSet(); - nonFrozenForest.addAll(typeToArray(Type.FOREST)); - nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); - defaultBiomesToSpawn.addAll(nonFrozenForest); - return defaultBiomesToSpawn; - } -} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/MonkeyDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/MonkeyDeclaration.java new file mode 100644 index 0000000..07e8435 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/MonkeyDeclaration.java @@ -0,0 +1,72 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.HashSet; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.core.ConfigHelper; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.ItemGenerics; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityMonkey; +import com.stek101.projectzulu.common.mobs.models.ModelMonkeyTailed; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericLiving; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class MonkeyDeclaration extends SpawnableDeclaration { + + public MonkeyDeclaration() { + super("Monkey", 59, EntityMonkey.class, EnumCreatureType.creature); + setSpawnProperties(8, 100, 1, 4); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 2); + + eggColor1 = (78 << 16) + (78 << 8) + 132; + eggColor2 = (99 << 16) + (99 << 8) + 22; + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, ItemList.scrapMeat, 0, 2); + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, + ItemList.genericCraftingItems, ItemGenerics.Properties.SmallHeart.meta(), 5); + customMobData.entityProperties = new EntityProperties(9f, 2.0f, 0.3f, 0.0f, 0.5f, 32.0f, 10.0f, 16D).createFromConfig( + config, mobName); + super.outputDataToList(config, customMobData); + } + + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + //int r1 = (int) (Math.random()* goatTextures.length); + + return new RenderGenericLiving(new ModelMonkeyTailed(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + "textures/monkey.png" /*goatTextures[r1]*/ )); + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.jungle.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.jungleEdge.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.jungleHills.biomeName); + + HashSet nonfrozenForest = new HashSet(); + nonfrozenForest.addAll(typeToArray(Type.JUNGLE)); + nonfrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonfrozenForest); + return defaultBiomesToSpawn; + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/PZBatDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/PZBatDeclaration.java new file mode 100644 index 0000000..4eeaa24 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/PZBatDeclaration.java @@ -0,0 +1,75 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import java.util.HashSet; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.init.Items; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.core.ConfigHelper; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.entitydeclaration.EntityProperties; +import com.stek101.projectzulu.common.core.entitydeclaration.SpawnableDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityPZBat; +import com.stek101.projectzulu.common.mobs.models.ModelPZBat; +import com.stek101.projectzulu.common.mobs.renders.RenderGenericLiving; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PZBatDeclaration extends SpawnableDeclaration { + + public PZBatDeclaration() { + super("PZBat", 65, EntityPZBat.class, EnumCreatureType.monster); + setSpawnProperties(10, 5, 4, 4); + setRegistrationProperties(128, 3, true); + setDropAmount(0, 1); + + eggColor1 = (16 << 16) + (16 << 8) + 255; + eggColor2 = (161 << 16) + (161 << 8) + 255; + } + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) { + ConfigHelper.configDropToMobData(config, "MOB CONTROLS." + mobName, customMobData, Items.leather, 0, 8); + customMobData.entityProperties = new EntityProperties(6f, 1.0f, 0.3f, 100f, 0.0f, 32.0f, 30.0f, 10D).createFromConfig(config, mobName); + super.outputDataToList(config, customMobData); + } + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + return new RenderGenericLiving(new ModelPZBat(), 0.5f, new ResourceLocation(DefaultProps.mobKey, + "textures/pzbat.png")); + } + + @Override + public HashSet getDefaultBiomesToSpawn() { + HashSet defaultBiomesToSpawn = new HashSet(); + defaultBiomesToSpawn.add(BiomeGenBase.forest.biomeName); + defaultBiomesToSpawn.add(BiomeGenBase.forestHills.biomeName); + defaultBiomesToSpawn.add("Autumn Woods"); + defaultBiomesToSpawn.add("Birch Forest"); + defaultBiomesToSpawn.add("Forested Hills"); + defaultBiomesToSpawn.add("Forested Island"); + defaultBiomesToSpawn.add("Green Hills"); + defaultBiomesToSpawn.add("Redwood Forest"); + defaultBiomesToSpawn.add("Lush Redwoods"); + defaultBiomesToSpawn.add("Temperate Rainforest"); + defaultBiomesToSpawn.add("Woodlands"); + + HashSet nonFrozenForest = new HashSet(); + nonFrozenForest.addAll(typeToArray(Type.FOREST)); + nonFrozenForest.addAll(typeToArray(Type.PLAINS)); + nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); + defaultBiomesToSpawn.addAll(nonFrozenForest); + + return defaultBiomesToSpawn; + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RabbitDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RabbitDeclaration.java index ef7f042..1b5144b 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RabbitDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RabbitDeclaration.java @@ -39,6 +39,12 @@ public RabbitDeclaration() { entityTextures.add("textures/rabbit0.png"); entityTextures.add("textures/rabbit1.png"); entityTextures.add("textures/rabbit2.png"); + entityTextures.add("textures/rabbit3.png"); + entityTextures.add("textures/rabbit4.png"); + entityTextures.add("textures/rabbit5.png"); + entityTextures.add("textures/rabbit6.png"); + entityTextures.add("textures/rabbit7.png"); + entityTextures.add("textures/rabbit8.png"); } @Override @@ -82,6 +88,7 @@ public HashSet getDefaultBiomesToSpawn() { HashSet nonFrozenForest = new HashSet(); nonFrozenForest.addAll(typeToArray(Type.FOREST)); nonFrozenForest.addAll(typeToArray(Type.PLAINS)); + nonFrozenForest.addAll(typeToArray(Type.SAVANNA)); nonFrozenForest.removeAll(typeToArray(Type.SNOWY)); defaultBiomesToSpawn.addAll(nonFrozenForest); return defaultBiomesToSpawn; diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RhinoDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RhinoDeclaration.java index a7167bc..b27978e 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RhinoDeclaration.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/RhinoDeclaration.java @@ -58,13 +58,12 @@ public RenderWrapper getEntityrender(Class entityCla public HashSet getDefaultBiomesToSpawn() { HashSet defaultBiomesToSpawn = new HashSet(); defaultBiomesToSpawn.add(BiomeGenBase.plains.biomeName); - defaultBiomesToSpawn.add(BiomeGenBase.desert.biomeName); defaultBiomesToSpawn.add(BiomeGenBase.savanna.biomeName); defaultBiomesToSpawn.add(BiomeGenBase.savannaPlateau.biomeName); HashSet nonFrozenForest = new HashSet(); nonFrozenForest.addAll(typeToArray(Type.PLAINS)); - defaultBiomesToSpawn.addAll(typeToArray(Type.DRY)); + nonFrozenForest.addAll(typeToArray(Type.SAVANNA)); nonFrozenForest.removeAll(typeToArray(Type.FROZEN)); defaultBiomesToSpawn.addAll(nonFrozenForest); return defaultBiomesToSpawn; diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ThrowingRockDeclaration.java b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ThrowingRockDeclaration.java new file mode 100644 index 0000000..3fef45c --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/entitydefaults/ThrowingRockDeclaration.java @@ -0,0 +1,34 @@ +package com.stek101.projectzulu.common.mobs.entitydefaults; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraftforge.common.config.Configuration; + +import com.stek101.projectzulu.common.api.CustomMobData; +import com.stek101.projectzulu.common.core.entitydeclaration.CreatureDeclaration; +import com.stek101.projectzulu.common.mobs.entity.EntityThrowingRock; +import com.stek101.projectzulu.common.mobs.renders.RenderThrowingRock; +import com.stek101.projectzulu.common.mobs.renders.RenderWrapper; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ThrowingRockDeclaration extends CreatureDeclaration { + + public ThrowingRockDeclaration() { + super("ThrowingRock", 60, EntityThrowingRock.class, null); + setRegistrationProperties(128, 3, true); + } + + @Override + public void loadCreaturesFromConfig(Configuration config) {} + + @Override + public void outputDataToList(Configuration config, CustomMobData customMobData) {} + + @Override + @SideOnly(Side.CLIENT) + public RenderWrapper getEntityrender(Class entityClass) { + return new RenderThrowingRock(0.5f); + //return new RenderThrowRock(); + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelAntRavager.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelAntRavager.java new file mode 100644 index 0000000..6cc1101 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelAntRavager.java @@ -0,0 +1,418 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +public class ModelAntRavager extends ModelBase +{ + //fields + ModelRenderer HEAD; + ModelRenderer segment1; + ModelRenderer thorax; + ModelRenderer segment2; + ModelRenderer Abdomen; + ModelRenderer leg6; + ModelRenderer leg62; + ModelRenderer leg63; + ModelRenderer leg5; + ModelRenderer leg52; + ModelRenderer leg53; + ModelRenderer leg4; + ModelRenderer leg42; + ModelRenderer leg43; + ModelRenderer leg3; + ModelRenderer leg32; + ModelRenderer leg33; + ModelRenderer leg2; + ModelRenderer leg22; + ModelRenderer leg23; + ModelRenderer leg1; + ModelRenderer leg12; + ModelRenderer leg13; + ModelRenderer eyeRight; + ModelRenderer eyeLeft; + ModelRenderer mandibleRight; + ModelRenderer mandibleLeft; + ModelRenderer antennaeRightA; + ModelRenderer antennaeLeftA; + ModelRenderer antennaeRightB; + ModelRenderer antennaeLeftB; + ModelRenderer leg5B; + ModelRenderer leg3B; + ModelRenderer leg1B; + ModelRenderer leg6B; + ModelRenderer leg4B; + ModelRenderer leg2B; + + public ModelAntRavager() + { + textureWidth = 64; + textureHeight = 128; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-5F, -4F, -8F, 9, 6, 8); + HEAD.setRotationPoint(1.5F, 10.5F, -7F); + HEAD.setTextureSize(64, 128); + HEAD.mirror = true; + setRotation(HEAD, 0.1919862F, 0F, 0F); + antennaeRightA = new ModelRenderer(this, 42, 77); + antennaeRightA.addBox(-1F, -7F, 0F, 1, 7, 1); + //antennaeRightA.setRotationPoint(-1F, 11F, -12F); + antennaeRightA.setRotationPoint(-1.5F, -2.5F, -5F); + antennaeRightA.setTextureSize(64, 128); + antennaeRightA.mirror = true; + setRotation(antennaeRightA, 0.5235988F, 0F, -0.1745329F); + HEAD.addChild(antennaeRightA); + antennaeRightB = new ModelRenderer(this, 42, 88); + antennaeRightB.addBox(-1F, -7F, 0F, 1, 7, 1); + //antennaeRightB.setRotationPoint(-2F, 6F, -15F); + antennaeRightB.setRotationPoint(0F, -6.5F, 0F); + antennaeRightB.setTextureSize(64, 128); + antennaeRightB.mirror = true; + setRotation(antennaeRightB, 0.5235988F, 0F, 0F); + antennaeRightA.addChild(antennaeRightB); + antennaeLeftA = new ModelRenderer(this, 36, 77); + antennaeLeftA.addBox(0F, -7F, 0F, 1, 7, 1); + //antennaeLeftA.setRotationPoint(3F, 11F, -12F); + antennaeLeftA.setRotationPoint(1.5F, -2.5F, -5F); + antennaeLeftA.setTextureSize(64, 128); + antennaeLeftA.mirror = true; + setRotation(antennaeLeftA, 0.5235988F, 0F, 0.1745329F); + HEAD.addChild(antennaeLeftA); + antennaeLeftB = new ModelRenderer(this, 36, 88); + antennaeLeftB.addBox(0F, -7F, 0F, 1, 7, 1); + //antennaeLeftB.setRotationPoint(4F, 6F, -15F); + antennaeLeftB.setRotationPoint(0F, -6.5F, 0F); + antennaeLeftB.setTextureSize(64, 128); + antennaeLeftB.mirror = true; + setRotation(antennaeLeftB, 0.5235988F, 0F, 0F); + antennaeLeftA.addChild(antennaeLeftB); + mandibleRight = new ModelRenderer(this, 45, 39); + mandibleRight.addBox(-2F, 0F, -5F, 2, 1, 5); + //mandibleRight.setRotationPoint(-1F, 13F, -14F); + mandibleRight.setRotationPoint(-2.5F, -2F, -7F); + mandibleRight.setTextureSize(64, 128); + mandibleRight.mirror = true; + setRotation(mandibleRight, 0F, -0.2617994F, 0F); + HEAD.addChild(mandibleRight); + mandibleLeft = new ModelRenderer(this, 45, 28); + mandibleLeft.addBox(0F, 0F, -5F, 2, 1, 5); + //mandibleLeft.setRotationPoint(3F, 13F, -14F); + mandibleLeft.setRotationPoint(1.5F, -2F, -7F); + mandibleLeft.setTextureSize(64, 128); + mandibleLeft.mirror = true; + setRotation(mandibleLeft, 0F, 0.2617994F, 0F); + HEAD.addChild(mandibleLeft); + eyeRight = new ModelRenderer(this, 45, 15); + eyeRight.addBox(-2F, -1F, -3F, 1, 2, 3); + //eyeRight.setRotationPoint(-2.5F, 12F, -11F); + eyeRight.setRotationPoint(-4.0F, -2F, -4F); + eyeRight.setTextureSize(64, 128); + eyeRight.mirror = true; + setRotation(eyeRight, 0F, 0F, 0F); + HEAD.addChild(eyeRight); + eyeLeft = new ModelRenderer(this, 45, 3); + eyeLeft.addBox(0F, -1F, -2F, 1, 2, 3); + //eyeLeft.setRotationPoint(5.5F, 12F, -12F); + eyeLeft.setRotationPoint(4.0F, -2F, -4F); + eyeLeft.setTextureSize(64, 128); + eyeLeft.mirror = true; + setRotation(eyeLeft, 0F, 0F, 0F); + HEAD.addChild(eyeLeft); + segment1 = new ModelRenderer(this, 1, 109); + segment1.addBox(-2F, -2F, -2F, 5, 5, 5); + segment1.setRotationPoint(0F, 10F, -8F); + segment1.setTextureSize(64, 128); + segment1.mirror = true; + setRotation(segment1, 0F, 0F, 0F); + thorax = new ModelRenderer(this, 1, 22); + thorax.addBox(-3F, -3F, -3F, 8, 7, 11); + thorax.setRotationPoint(0F, 11.5F, -3F); + thorax.setTextureSize(64, 128); + thorax.mirror = true; + setRotation(thorax, -0.2974289F, 0F, 0F); + segment2 = new ModelRenderer(this, 23, 109); + segment2.addBox(-2F, -2F, 0F, 6, 6, 7); + segment2.setRotationPoint(0F, 13F, 2F); + segment2.setTextureSize(64, 128); + segment2.mirror = true; + setRotation(segment2, 0F, 0F, 0F); + Abdomen = new ModelRenderer(this, 1, 49); + Abdomen.addBox(-4F, -4F, -7F, 10, 9, 14); + Abdomen.setRotationPoint(0F, 13F, 13.5F); + Abdomen.setTextureSize(64, 128); + Abdomen.mirror = true; + setRotation(Abdomen, 0F, 0F, 0F); + leg5B = new ModelRenderer(this, 1, 77); + leg5B.addBox(-3F, -1F, -1F, 3, 2, 2); + leg5B.setRotationPoint(-2F, 13F, -3F); + leg5B.setTextureSize(64, 128); + leg5B.mirror = true; + setRotation(leg5B, 0F, 0F, 0F); + leg3B = new ModelRenderer(this, 1, 77); + leg3B.addBox(-3F, -1F, -1F, 3, 2, 2); + leg3B.setRotationPoint(-2F, 13F, 1F); + leg3B.setTextureSize(64, 128); + leg3B.mirror = true; + setRotation(leg3B, 0F, 0F, 0F); + leg1B = new ModelRenderer(this, 1, 77); + leg1B.addBox(-3F, -1F, -1F, 3, 2, 2); + leg1B.setRotationPoint(-2F, 13F, 5F); + leg1B.setTextureSize(64, 128); + leg1B.mirror = true; + setRotation(leg1B, 0F, 0F, 0F); + leg6B = new ModelRenderer(this, 1, 94); + leg6B.addBox(0F, -1F, -1F, 3, 2, 2); + leg6B.setRotationPoint(4F, 13F, -3F); + leg6B.setTextureSize(64, 128); + leg6B.mirror = true; + setRotation(leg6B, 0F, 0F, 0F); + leg4B = new ModelRenderer(this, 1, 94); + leg4B.addBox(0F, -1F, -1F, 3, 2, 2); + leg4B.setRotationPoint(4F, 13F, 1F); + leg4B.setTextureSize(64, 128); + leg4B.mirror = true; + setRotation(leg4B, 0F, 0F, 0F); + leg2B = new ModelRenderer(this, 1, 94); + leg2B.addBox(0F, -1F, -1F, 3, 2, 2); + leg2B.setRotationPoint(4F, 13F, 5F); + leg2B.setTextureSize(64, 128); + leg2B.mirror = true; + setRotation(leg2B, 0F, 0F, 0F); + leg6 = new ModelRenderer(this, 1, 94); + leg6.addBox(0F, -1F, -1F, 8, 2, 2); + //leg6.setRotationPoint(6F, 16F, -3F); + leg6.setRotationPoint(3F, 0F, 0F); + leg6.setTextureSize(64, 128); + leg6.mirror = true; + setRotation(leg6, 0F, 0F, -0.7679449F); + leg6B.addChild(leg6); + leg62 = new ModelRenderer(this, 1, 102); + leg62.addBox(0F, -1F, -1F, 10, 2, 2); + //leg62.setRotationPoint(12F, 11F, -3F); + leg62.setRotationPoint(8F, 0F, 0F); + leg62.setTextureSize(64, 128); + leg62.mirror = true; + setRotation(leg62, 0F, 0F, 1.047198F); + leg6.addChild(leg62); + leg63 = new ModelRenderer(this, 23, 92); + leg63.addBox(0F, -1F, -1F, 3, 2, 2); + leg63.setRotationPoint(9F, 0F, 0F); + leg63.setTextureSize(64, 128); + leg63.mirror = true; + setRotation(leg63, 0F, 0F, 0.3839724F); + leg62.addChild(leg63); + leg5 = new ModelRenderer(this, 1, 77); + leg5.addBox(-8F, -1F, -1F, 8, 2, 2); + //leg5.setRotationPoint(-4F, 16F, -3F); + leg5.setRotationPoint(-3F, 0F, 0F); + leg5.setTextureSize(64, 128); + leg5.mirror = true; + setRotation(leg5, 0F, 0F, 0.6108652F); + leg5B.addChild(leg5); + leg52 = new ModelRenderer(this, 1, 84); + leg52.addBox(-10F, -1F, -1F, 10, 2, 2); + leg52.setRotationPoint(-7.5F, 0F, 0F); + leg52.setTextureSize(64, 128); + leg52.mirror = true; + setRotation(leg52, 0F, 0F, -1.047198F); + leg5.addChild(leg52); + leg53 = new ModelRenderer(this, 23, 76); + leg53.addBox(-3F, -1F, -1F, 3, 2, 2); + leg53.setRotationPoint(-8.5F, 0F, 0F); + leg53.setTextureSize(64, 128); + leg53.mirror = true; + setRotation(leg53, 0F, 0F, -0.3839724F); + leg52.addChild(leg53); + leg4 = new ModelRenderer(this, 1, 94); + leg4.addBox(0F, -1F, -1F, 8, 2, 2); + //leg4.setRotationPoint(6F, 16F, 1F); + leg4.setRotationPoint(3F, 0F, 0F); + leg4.setTextureSize(64, 128); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, -0.5235988F); + leg4B.addChild(leg4); + leg42 = new ModelRenderer(this, 1, 102); + leg42.addBox(0F, -1F, -1F, 10, 2, 2); + leg42.setRotationPoint(8.5F, 0F, 0F); + leg42.setTextureSize(64, 128); + leg42.mirror = true; + setRotation(leg42, 0F, 0F, 1.099557F); + leg4.addChild(leg42); + leg43 = new ModelRenderer(this, 23, 92); + leg43.addBox(0F, -1F, -1F, 3, 2, 2); + leg43.setRotationPoint(8.5F, 0F, 0F); + leg43.setTextureSize(64, 128); + leg43.mirror = true; + setRotation(leg43, 0F, 0F, 0.0174533F); + leg42.addChild(leg43); + leg3 = new ModelRenderer(this, 1, 77); + leg3.addBox(-8F, -1F, -1F, 8, 2, 2); + leg3.setRotationPoint(-3F, 0F, 0F); + leg3.setTextureSize(64, 128); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0.5235988F); + leg3B.addChild(leg3); + leg32 = new ModelRenderer(this, 1, 84); + leg32.addBox(-10F, -1F, -1F, 10, 2, 2); + leg32.setRotationPoint(-8F, 0F, 0F); + leg32.setTextureSize(64, 128); + leg32.mirror = true; + setRotation(leg32, 0F, 0F, -1.099557F); + leg3.addChild(leg32); + leg33 = new ModelRenderer(this, 23, 76); + leg33.addBox(-3F, -1F, -1F, 3, 2, 2); + leg33.setRotationPoint(-7.5F, 0F, 0F); + leg33.setTextureSize(64, 128); + leg33.mirror = true; + setRotation(leg33, 0F, 0F, -0.0174533F); + leg32.addChild(leg33); + leg2 = new ModelRenderer(this, 1, 94); + leg2.addBox(0F, -1F, -1F, 8, 2, 2); + //leg2.setRotationPoint(6F, 16F, 5F); + leg2.setRotationPoint(3F, 0F, 0F); + leg2.setTextureSize(64, 128); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, -0.7853982F); + leg2B.addChild(leg2); + leg22 = new ModelRenderer(this, 1, 102); + leg22.addBox(0F, -1F, -1F, 10, 2, 2); + leg22.setRotationPoint(8F, 0F, 0F); + leg22.setTextureSize(64, 128); + leg22.mirror = true; + setRotation(leg22, 0F, 0F, 1.073532F); + leg2.addChild(leg22); + leg23 = new ModelRenderer(this, 23, 92); + leg23.addBox(0F, -1F, -1F, 3, 2, 2); + leg23.setRotationPoint(9F, 0F, 0F); + leg23.setTextureSize(64, 128); + leg23.mirror = true; + setRotation(leg23, 0F, 0F, 0.3839724F); + leg22.addChild(leg23); + leg1 = new ModelRenderer(this, 1, 77); + leg1.addBox(-8F, -1F, -1F, 8, 2, 2); + leg1.setRotationPoint(-3F, 0F, 0F); + leg1.setTextureSize(64, 128); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0.5235988F); + leg1B.addChild(leg1); + leg12 = new ModelRenderer(this, 1, 84); + leg12.addBox(-10F, -1F, -1F, 10, 2, 2); + leg12.setRotationPoint(-7.5F, 0F, 0F); + leg12.setTextureSize(64, 128); + leg12.mirror = true; + setRotation(leg12, 0F, 0F, -1.000724F); + leg1.addChild(leg12); + leg13 = new ModelRenderer(this, 23, 76); + leg13.addBox(-3F, -1F, -1F, 3, 2, 2); + leg13.setRotationPoint(-8.5F, 0F, 0F); + leg13.setTextureSize(64, 128); + leg13.mirror = true; + setRotation(leg13, 0F, 0F, -0.3839724F); + leg12.addChild(leg13); + + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.render(f5); + segment1.render(f5); + thorax.render(f5); + segment2.render(f5); + Abdomen.render(f5); + leg5B.render(f5); + leg3B.render(f5); + leg1B.render(f5); + leg6B.render(f5); + leg4B.render(f5); + leg2B.render(f5); + //leg6.render(f5); + //leg62.render(f5); + //leg63.render(f5); + //leg5.render(f5); + //leg52.render(f5); + //leg53.render(f5); + //leg4.render(f5); + //leg42.render(f5); + //leg43.render(f5); + //leg3.render(f5); + //leg32.render(f5); + //leg33.render(f5); + //leg2.render(f5); + //leg22.render(f5); + //leg23.render(f5); + //leg1.render(f5); + //leg12.render(f5); + //leg13.render(f5); + //eyeRight.render(f5); + //eyeLeft.render(f5); + //mandibleRight.render(f5); + //mandibleLeft.render(f5); + //antennaeRightA.render(f5); + //antennaeLeftA.render(f5); + //antennaeRightB.render(f5); + //antennaeLeftB.render(f5); + + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + this.HEAD.rotateAngleX = f4 / (180F / (float)Math.PI); + float f6 = ((float)Math.PI / 4F); + this.leg1B.rotateAngleZ = -f6; + this.leg2B.rotateAngleZ = f6; + this.leg3B.rotateAngleZ = -f6 * 0.74F; + this.leg4B.rotateAngleZ = f6 * 0.74F; + this.leg5B.rotateAngleZ = -f6 * 0.74F; + this.leg6B.rotateAngleZ = f6 * 0.74F; + //this.spiderLeg7.rotateAngleZ = -f6; + //this.spiderLeg8.rotateAngleZ = f6; + float f7 = -0.0F; + float f8 = 0.3926991F; + this.leg1B.rotateAngleY = f8 * 2.0F + f7; + this.leg2B.rotateAngleY = -f8 * 2.0F - f7; + this.leg3B.rotateAngleY = f8 * 1.0F + f7; + this.leg4B.rotateAngleY = -f8 * 1.0F - f7; + this.leg5B.rotateAngleY = -f8 * 1.0F + f7; + this.leg6B.rotateAngleY = f8 * 1.0F - f7; + //this.spiderLeg7.rotateAngleY = -f8 * 2.0F + f7; + //this.spiderLeg8.rotateAngleY = f8 * 2.0F - f7; + float f9 = -(MathHelper.cos(f * 0.6662F * 2.0F + 0.0F) * 0.4F) * f1; + float f10 = -(MathHelper.cos(f * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * f1; + float f11 = -(MathHelper.cos(f * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * f1; + float f12 = -(MathHelper.cos(f * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * f1; + float f13 = Math.abs(MathHelper.sin(f * 0.6662F + 0.0F) * 0.4F) * f1; + float f14 = Math.abs(MathHelper.sin(f * 0.6662F + (float)Math.PI) * 0.4F) * f1; + float f15 = Math.abs(MathHelper.sin(f * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * f1; + float f16 = Math.abs(MathHelper.sin(f * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * f1; + this.leg1B.rotateAngleY += f9; + this.leg2B.rotateAngleY += -f9; + this.leg3B.rotateAngleY += f10; + this.leg4B.rotateAngleY += -f10; + this.leg5B.rotateAngleY += f11; + this.leg6B.rotateAngleY += -f11; + //this.spiderLeg7.rotateAngleY += f12; + //this.spiderLeg8.rotateAngleY += -f12; + this.leg1B.rotateAngleZ += f13; + this.leg2B.rotateAngleZ += -f13; + this.leg3B.rotateAngleZ += f14; + this.leg4B.rotateAngleZ += -f14; + this.leg5B.rotateAngleZ += f15; + this.leg6B.rotateAngleZ += -f15; + //this.spiderLeg7.rotateAngleZ += f16; + //this.spiderLeg8.rotateAngleZ += -f16; + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBear.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBear.java index 3c9e9cc..cfd07e1 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBear.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBear.java @@ -160,9 +160,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { EntityBear var5 = (EntityBear) par1EntityLiving; LEG1ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + LEG3ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; LEG2ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + LEG4ROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; super.setLivingAnimations(par1EntityLiving, par2, par3, par4); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeaver.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeaver.java index 9a54805..8dcc6a7 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeaver.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeaver.java @@ -117,9 +117,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; TAILROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; super.setLivingAnimations(par1EntityLiving, par2, par3, par4); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeetleAS.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeetleAS.java new file mode 100644 index 0000000..f97ec69 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeetleAS.java @@ -0,0 +1,187 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelBeetleAS extends ModelBase +{ + //fields + float heightToRaise = 12f; + float renderScale = 0.50f; + ModelRenderer antennaeLeft; + ModelRenderer antennaeRight; + ModelRenderer HEAD; + ModelRenderer thorax; + ModelRenderer BODY; + ModelRenderer BODY2; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer leg5; + ModelRenderer leg6; + + public ModelBeetleAS() + { + textureWidth = 64; + textureHeight = 32; + + antennaeLeft = new ModelRenderer(this, 10, 10); + antennaeLeft.addBox(0F, -7F, -1.5F, 0, 8, 3); + antennaeLeft.setRotationPoint(1.5F, 40F, -13F); + antennaeLeft.setTextureSize(64, 32); + antennaeLeft.mirror = true; + setRotation(antennaeLeft, 0.6632251F, 0F, 0.7853982F); + antennaeRight = new ModelRenderer(this, 2, 10); + antennaeRight.addBox(0F, -7F, -1.5F, 0, 8, 3); + antennaeRight.setRotationPoint(-3F, 40F, -13F); + antennaeRight.setTextureSize(64, 32); + antennaeRight.mirror = true; + setRotation(antennaeRight, 0.6632251F, 0F, -0.7853982F); + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -2F, -3F, 3, 3, 3); + HEAD.setRotationPoint(-0.5F, 42.5F, -10F); + HEAD.setTextureSize(64, 32); + HEAD.mirror = true; + setRotation(HEAD, 0F, 0F, 0F); + thorax = new ModelRenderer(this, 20, 17); + thorax.addBox(-3F, -3F, -6F, 6, 5, 4); + thorax.setRotationPoint(-1F, 42F, -5F); + thorax.setTextureSize(64, 32); + thorax.mirror = true; + setRotation(thorax, 0F, 0F, 0F); + BODY = new ModelRenderer(this, 26, 1); + BODY.addBox(-5F, -3F, -6F, 9, 5, 9); + BODY.setRotationPoint(-0.5F, 42F, -1F); + BODY.setTextureSize(64, 32); + BODY.mirror = true; + setRotation(BODY, 0F, 0F, 0F); + BODY2 = new ModelRenderer(this, 42, 17); + BODY2.addBox(-4F, -2F, -1F, 7, 4, 2); + BODY2.setRotationPoint(-0.5F, 41.5F, 3F); + BODY2.setTextureSize(64, 32); + BODY2.mirror = true; + setRotation(BODY2, 0F, 0F, 0F); + leg1 = new ModelRenderer(this, 2, 28); + leg1.addBox(-5F, -1F, -1F, 5, 1, 1); + leg1.setRotationPoint(-4F, 44F, -1F); + leg1.setTextureSize(64, 32); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 2, 28); + leg2.addBox(-1F, -1F, -1F, 5, 1, 1); + leg2.setRotationPoint(3F, 44F, -1F); + leg2.setTextureSize(64, 32); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 2, 25); + leg3.addBox(-5F, -1F, -1F, 5, 1, 1); + leg3.setRotationPoint(-4F, 44F, -5F); + leg3.setTextureSize(64, 32); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 2, 25); + leg4.addBox(-1F, -1F, -1F, 5, 1, 1); + leg4.setRotationPoint(3F, 44F, -5F); + leg4.setTextureSize(64, 32); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + leg5 = new ModelRenderer(this, 2, 22); + leg5.addBox(-5F, -1F, -1F, 5, 1, 1); + leg5.setRotationPoint(-4F, 44F, -9F); + leg5.setTextureSize(64, 32); + leg5.mirror = true; + setRotation(leg5, 0F, 0F, 0F); + leg6 = new ModelRenderer(this, 2, 22); + leg6.addBox(0F, -1F, -1F, 5, 1, 1); + leg6.setRotationPoint(2F, 44F, -9F); + leg6.setTextureSize(64, 32); + leg6.mirror = true; + setRotation(leg6, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + antennaeLeft.render(f5 * renderScale); + antennaeRight.render(f5 * renderScale); + HEAD.render(f5 * renderScale); + thorax.render(f5 * renderScale); + BODY.render(f5 * renderScale); + BODY2.render(f5 * renderScale); + leg1.render(f5 * renderScale); + leg2.render(f5 * renderScale); + leg3.render(f5 * renderScale); + leg4.render(f5 * renderScale); + leg5.render(f5 * renderScale); + leg6.render(f5 * renderScale); + GL11.glPopMatrix(); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + this.HEAD.rotateAngleX = f4 / (180F / (float)Math.PI); + float f6 = ((float)Math.PI / 4F); + this.leg1.rotateAngleZ = -f6; + this.leg2.rotateAngleZ = f6; + this.leg3.rotateAngleZ = -f6 * 0.74F; + this.leg4.rotateAngleZ = f6 * 0.74F; + this.leg5.rotateAngleZ = -f6 * 0.74F; + this.leg6.rotateAngleZ = f6 * 0.74F; + //this.spiderLeg7.rotateAngleZ = -f6; + //this.spiderLeg8.rotateAngleZ = f6; + float f7 = -0.0F; + float f8 = 0.3926991F; + this.leg1.rotateAngleY = f8 * 2.0F + f7; + this.leg2.rotateAngleY = -f8 * 2.0F - f7; + this.leg3.rotateAngleY = f8 * 1.0F + f7; + this.leg4.rotateAngleY = -f8 * 1.0F - f7; + this.leg5.rotateAngleY = -f8 * 1.0F + f7; + this.leg6.rotateAngleY = f8 * 1.0F - f7; + //this.spiderLeg7.rotateAngleY = -f8 * 2.0F + f7; + //this.spiderLeg8.rotateAngleY = f8 * 2.0F - f7; + float f9 = -(MathHelper.cos(f * 0.6662F * 2.0F + 0.0F) * 0.4F) * f1; + float f10 = -(MathHelper.cos(f * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * f1; + float f11 = -(MathHelper.cos(f * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * f1; + float f12 = -(MathHelper.cos(f * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * f1; + float f13 = Math.abs(MathHelper.sin(f * 0.6662F + 0.0F) * 0.4F) * f1; + float f14 = Math.abs(MathHelper.sin(f * 0.6662F + (float)Math.PI) * 0.4F) * f1; + float f15 = Math.abs(MathHelper.sin(f * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * f1; + float f16 = Math.abs(MathHelper.sin(f * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * f1; + this.leg1.rotateAngleY += f9; + this.leg2.rotateAngleY += -f9; + this.leg3.rotateAngleY += f10; + this.leg4.rotateAngleY += -f10; + this.leg5.rotateAngleY += f11; + this.leg6.rotateAngleY += -f11; + //this.spiderLeg7.rotateAngleY += f12; + //this.spiderLeg8.rotateAngleY += -f12; + this.leg1.rotateAngleZ += f13; + this.leg2.rotateAngleZ += -f13; + this.leg3.rotateAngleZ += f14; + this.leg4.rotateAngleZ += -f14; + this.leg5.rotateAngleZ += f15; + this.leg6.rotateAngleZ += -f15; + //this.spiderLeg7.rotateAngleZ += f16; + //this.spiderLeg8.rotateAngleZ += -f16; + } + +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeetleBS.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeetleBS.java new file mode 100644 index 0000000..9682439 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBeetleBS.java @@ -0,0 +1,187 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +public class ModelBeetleBS extends ModelBase +{ + //fields + float heightToLower = 21f; + float renderScale = 0.50f; + ModelRenderer antennaeLeft; + ModelRenderer antennaeRight; + ModelRenderer HEAD; + ModelRenderer thorax; + ModelRenderer BODY; + ModelRenderer BODY2; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer leg5; + ModelRenderer leg6; + + public ModelBeetleBS() + { + textureWidth = 64; + textureHeight = 32; + + antennaeLeft = new ModelRenderer(this, 10, 10); + antennaeLeft.addBox(0F, -7F, -1.5F, 0, 8, 3); + antennaeLeft.setRotationPoint(1.5F, 19F + heightToLower, -13F); + antennaeLeft.setTextureSize(64, 32); + antennaeLeft.mirror = true; + setRotation(antennaeLeft, 0.6981317F, -0.1745329F, 0.7853982F); + antennaeRight = new ModelRenderer(this, 2, 10); + antennaeRight.addBox(0F, -7F, -1.5F, 0, 8, 3); + antennaeRight.setRotationPoint(-3F, 19F + heightToLower, -13F); + antennaeRight.setTextureSize(64, 32); + antennaeRight.mirror = true; + setRotation(antennaeRight, 0.6632251F, 0.1745329F, -0.7853982F); + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -2F, -3F, 3, 3, 3); + HEAD.setRotationPoint(-0.5F, 21.5F + heightToLower, -10F); + HEAD.setTextureSize(64, 32); + HEAD.mirror = true; + setRotation(HEAD, 0F, 0F, 0F); + thorax = new ModelRenderer(this, 20, 17); + thorax.addBox(-3F, -3F, -6F, 6, 4, 3); + thorax.setRotationPoint(-1F, 22F + heightToLower, -4F); + thorax.setTextureSize(64, 32); + thorax.mirror = true; + setRotation(thorax, 0F, 0F, 0F); + BODY = new ModelRenderer(this, 26, 1); + BODY.addBox(-5F, -3F, -6F, 7, 5, 9); + BODY.setRotationPoint(0.5F, 21F + heightToLower, -1F); + BODY.setTextureSize(64, 32); + BODY.mirror = true; + setRotation(BODY, 0F, 0F, 0F); + BODY2 = new ModelRenderer(this, 42, 17); + BODY2.addBox(-4F, -2F, -1F, 6, 4, 4); + BODY2.setRotationPoint(0F, 20.5F + heightToLower, 3F); + BODY2.setTextureSize(64, 32); + BODY2.mirror = true; + setRotation(BODY2, 0F, 0F, 0F); + leg1 = new ModelRenderer(this, 2, 28); + leg1.addBox(-5F, -1F, -1F, 5, 1, 1); + leg1.setRotationPoint(-4F, 23F + heightToLower, 0F); + leg1.setTextureSize(64, 32); + leg1.mirror = true; + setRotation(leg1, 0F, 0F, 0F); + leg2 = new ModelRenderer(this, 2, 28); + leg2.addBox(-1F, -1F, -1F, 5, 1, 1); + leg2.setRotationPoint(3F, 23F + heightToLower, 0F); + leg2.setTextureSize(64, 32); + leg2.mirror = true; + setRotation(leg2, 0F, 0F, 0F); + leg3 = new ModelRenderer(this, 2, 25); + leg3.addBox(-5F, -1F, -1F, 5, 1, 1); + leg3.setRotationPoint(-4F, 23F + heightToLower, -4F); + leg3.setTextureSize(64, 32); + leg3.mirror = true; + setRotation(leg3, 0F, 0F, 0F); + leg4 = new ModelRenderer(this, 2, 25); + leg4.addBox(-1F, -1F, -1F, 5, 1, 1); + leg4.setRotationPoint(3F, 23F + heightToLower, -4F); + leg4.setTextureSize(64, 32); + leg4.mirror = true; + setRotation(leg4, 0F, 0F, 0F); + leg5 = new ModelRenderer(this, 2, 22); + leg5.addBox(-5F, -1F, -1F, 5, 1, 1); + leg5.setRotationPoint(-4F, 23F + heightToLower, -7F); + leg5.setTextureSize(64, 32); + leg5.mirror = true; + setRotation(leg5, 0F, 0F, 0F); + leg6 = new ModelRenderer(this, 2, 22); + leg6.addBox(0F, -1F, -1F, 5, 1, 1); + leg6.setRotationPoint(2F, 23F + heightToLower, -7F); + leg6.setTextureSize(64, 32); + leg6.mirror = true; + setRotation(leg6, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + antennaeLeft.render(f5 * renderScale); + antennaeRight.render(f5 * renderScale); + HEAD.render(f5 * renderScale); + thorax.render(f5 * renderScale); + BODY.render(f5 * renderScale); + BODY2.render(f5 * renderScale); + leg1.render(f5 * renderScale); + leg2.render(f5 * renderScale); + leg3.render(f5 * renderScale); + leg4.render(f5 * renderScale); + leg5.render(f5 * renderScale); + leg6.render(f5 * renderScale); + GL11.glPopMatrix(); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + this.HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + this.HEAD.rotateAngleX = f4 / (180F / (float)Math.PI); + float f6 = ((float)Math.PI / 4F); + this.leg1.rotateAngleZ = -f6; + this.leg2.rotateAngleZ = f6; + this.leg3.rotateAngleZ = -f6 * 0.74F; + this.leg4.rotateAngleZ = f6 * 0.74F; + this.leg5.rotateAngleZ = -f6 * 0.74F; + this.leg6.rotateAngleZ = f6 * 0.74F; + //this.spiderLeg7.rotateAngleZ = -f6; + //this.spiderLeg8.rotateAngleZ = f6; + float f7 = -0.0F; + float f8 = 0.3926991F; + this.leg1.rotateAngleY = f8 * 2.0F + f7; + this.leg2.rotateAngleY = -f8 * 2.0F - f7; + this.leg3.rotateAngleY = f8 * 1.0F + f7; + this.leg4.rotateAngleY = -f8 * 1.0F - f7; + this.leg5.rotateAngleY = -f8 * 1.0F + f7; + this.leg6.rotateAngleY = f8 * 1.0F - f7; + //this.spiderLeg7.rotateAngleY = -f8 * 2.0F + f7; + //this.spiderLeg8.rotateAngleY = f8 * 2.0F - f7; + float f9 = -(MathHelper.cos(f * 0.6662F * 2.0F + 0.0F) * 0.4F) * f1; + float f10 = -(MathHelper.cos(f * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * f1; + float f11 = -(MathHelper.cos(f * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * f1; + float f12 = -(MathHelper.cos(f * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * f1; + float f13 = Math.abs(MathHelper.sin(f * 0.6662F + 0.0F) * 0.4F) * f1; + float f14 = Math.abs(MathHelper.sin(f * 0.6662F + (float)Math.PI) * 0.4F) * f1; + float f15 = Math.abs(MathHelper.sin(f * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * f1; + float f16 = Math.abs(MathHelper.sin(f * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * f1; + this.leg1.rotateAngleY += f9; + this.leg2.rotateAngleY += -f9; + this.leg3.rotateAngleY += f10; + this.leg4.rotateAngleY += -f10; + this.leg5.rotateAngleY += f11; + this.leg6.rotateAngleY += -f11; + //this.spiderLeg7.rotateAngleY += f12; + //this.spiderLeg8.rotateAngleY += -f12; + this.leg1.rotateAngleZ += f13; + this.leg2.rotateAngleZ += -f13; + this.leg3.rotateAngleZ += f14; + this.leg4.rotateAngleZ += -f14; + this.leg5.rotateAngleZ += f15; + this.leg6.rotateAngleZ += -f15; + //this.spiderLeg7.rotateAngleZ += f16; + //this.spiderLeg8.rotateAngleZ += -f16; + } + + } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBloomDoom.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBloomDoom.java new file mode 100644 index 0000000..b6729a2 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBloomDoom.java @@ -0,0 +1,264 @@ +package com.stek101.projectzulu.common.mobs.models; + +import java.util.Random; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; +import com.stek101.projectzulu.common.mobs.entity.EntityStates; + +public class ModelBloomDoom extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer armLeftA1; + ModelRenderer armLeftA2; + ModelRenderer armLeftB1; + ModelRenderer armRightA1; + ModelRenderer armRightA2; + ModelRenderer armRightB1; + ModelRenderer lowerBody; + ModelRenderer leg1; + ModelRenderer leg2; + ModelRenderer leg3; + ModelRenderer leg4; + ModelRenderer leg5; + ModelRenderer leg6; + ModelRenderer leg7; + ModelRenderer leg8; + + public ModelBloomDoom() + { + textureWidth = 128; + textureHeight = 32; + + Shape1 = new ModelRenderer(this, 69, 1); + Shape1.addBox(-8F, 0F, 0F, 16, 30, 0); + Shape1.setRotationPoint(-1F, -8F, 0F); + Shape1.setTextureSize(128, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 1); + Shape2.addBox(-8F, 0F, 0F, 16, 30, 0); + Shape2.setRotationPoint(0F, -8F, 0F); + Shape2.setTextureSize(128, 32); + Shape2.mirror = true; + setRotation(Shape2, 0F, 1.570796F, 0F); + armLeftA1 = new ModelRenderer(this, 51, 12); + armLeftA1.addBox(-1.5F, -1F, 0F, 3, 9, 0); + armLeftA1.setRotationPoint(3.5F, 10F, -1F); + armLeftA1.setTextureSize(128, 32); + armLeftA1.mirror = true; + setRotation(armLeftA1, -1.396263F, 0F, 0F); + armLeftA2 = new ModelRenderer(this, 61, 15); + armLeftA2.addBox(-1.5F, -1F, 0F, 3, 7, 0); + armLeftA2.setRotationPoint(0F, 8.5F, 0F); + armLeftA2.setTextureSize(128, 32); + armLeftA2.mirror = true; + setRotation(armLeftA2, 0F, 0F, 0F); + armLeftA1.addChild(armLeftA2); + armLeftB1 = new ModelRenderer(this, 55, 1); + armLeftB1.addBox(0.5F, -7F, 0F, 1, 7, 0); + armLeftB1.setRotationPoint(2F, 0F, 0F); + armLeftB1.setTextureSize(128, 32); + armLeftB1.mirror = true; + setRotation(armLeftB1, 0F, 0F, 0F); + armRightA1 = new ModelRenderer(this, 51, 22); + armRightA1.addBox(-1.5F, -1F, 0F, 3, 9, 0); + armRightA1.setRotationPoint(-4.5F, 10F, -1F); + armRightA1.setTextureSize(128, 32); + armRightA1.mirror = true; + setRotation(armRightA1, -1.396263F, 0F, 0F); + armRightA2 = new ModelRenderer(this, 61, 23); + armRightA2.addBox(-1.5F, -1F, 0F, 3, 7, 0); + armRightA2.setRotationPoint(0F, 8.5F, 0F); + armRightA2.setTextureSize(128, 32); + armRightA2.mirror = true; + setRotation(armRightA2, 0F, 0F, 0F); + armRightA1.addChild(armRightA2); + armRightB1 = new ModelRenderer(this, 51, 1); + armRightB1.addBox(-1.5F, -7F, 0F, 1, 7, 0); + armRightB1.setRotationPoint(-2F, 0F, -1F); + armRightB1.setTextureSize(128, 32); + armRightB1.mirror = true; + setRotation(armRightB1, 0F, 0F, 0F); + lowerBody = new ModelRenderer(this, 102, 22); + lowerBody.addBox(-4F, 0F, -2F, 6, 3, 6); + lowerBody.setRotationPoint(1F, 20F, -1F); + lowerBody.setTextureSize(128, 32); + lowerBody.mirror = true; + setRotation(lowerBody, 0F, 0F, 0F); + leg1 = new ModelRenderer(this, 36, 12); + leg1.addBox(-5F, 0F, -1F, 5, 1, 1); + leg1.setRotationPoint(-2F, 21F, 2F); + leg1.setTextureSize(128, 32); + leg1.mirror = true; + setRotation(leg1, 0F, 0.4363323F, -0.3839724F); + leg2 = new ModelRenderer(this, 36, 18); + leg2.addBox(0F, 0F, -1F, 5, 1, 1); + leg2.setRotationPoint(2F, 21F, 2F); + leg2.setTextureSize(128, 32); + leg2.mirror = true; + setRotation(leg2, 0F, -0.4363323F, 0.3839724F); + leg3 = new ModelRenderer(this, 36, 0); + leg3.addBox(-5F, 0F, -1F, 5, 1, 1); + leg3.setRotationPoint(-2F, 21F, -1F); + leg3.setTextureSize(128, 32); + leg3.mirror = true; + setRotation(leg3, 0F, -0.4363323F, -0.3839724F); + leg4 = new ModelRenderer(this, 36, 6); + leg4.addBox(0F, 0F, -1F, 5, 1, 1); + leg4.setRotationPoint(2F, 21F, -1.033333F); + leg4.setTextureSize(128, 32); + leg4.mirror = true; + setRotation(leg4, 0F, 0.4363323F, 0.3839724F); + leg5 = new ModelRenderer(this, 36, 23); + leg5.addBox(-1F, 0F, -2F, 1, 5, 1); + leg5.setRotationPoint(2F, 22F, -1F); + leg5.setTextureSize(128, 32); + leg5.mirror = true; + setRotation(leg5, -0.9424778F, -0.1745329F, 0F); + leg6 = new ModelRenderer(this, 36, 23); + leg6.addBox(-1F, 0F, 0F, 1, 5, 1); + leg6.setRotationPoint(-1F, 21F, 1F); + leg6.setTextureSize(128, 32); + leg6.mirror = true; + setRotation(leg6, 0.9424778F, -0.1745329F, 0F); + leg7 = new ModelRenderer(this, 41, 23); + leg7.addBox(-1F, 0F, -2F, 1, 5, 1); + leg7.setRotationPoint(-1F, 22F, -1F); + leg7.setTextureSize(128, 32); + leg7.mirror = true; + setRotation(leg7, -0.9424778F, 0.1745329F, 0F); + leg8 = new ModelRenderer(this, 41, 23); + leg8.addBox(-1F, 0F, 0F, 1, 5, 1); + leg8.setRotationPoint(2F, 21F, 1F); + leg8.setTextureSize(128, 32); + leg8.mirror = true; + setRotation(leg8, 0.9424778F, 0.1745329F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape1.render(f5); + Shape2.render(f5); + armLeftA1.render(f5); + //armLeftA2.render(f5); + //armLeftB1.render(f5); + armRightA1.render(f5); + //armRightA2.render(f5); + //armRightB1.render(f5); + lowerBody.render(f5); + leg1.render(f5); + leg2.render(f5); + leg3.render(f5); + leg4.render(f5); + leg5.render(f5); + leg6.render(f5); + leg7.render(f5); + leg8.render(f5); + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + + EntityGenericAnimal var5 = (EntityGenericAnimal) par1EntityLiving; + + /* State Based Animations */ + if (var5.getEntityState() != EntityStates.idle) { + float heightToRaise = 0.0f; + Shape1.rotationPointY = -8F - heightToRaise; + Shape2.rotationPointY = -8F - heightToRaise; + armLeftA1.rotationPointY = 10F - heightToRaise; + armLeftA2.rotationPointY = 8.5F - heightToRaise; + armLeftB1.rotationPointY = 0F - heightToRaise; + armRightA1.rotationPointY = 10F - heightToRaise; + armRightA2.rotationPointY = 8.5F - heightToRaise; + armRightB1.rotationPointY = 0F - heightToRaise; + lowerBody.rotationPointY = 20F - heightToRaise; + leg1.rotationPointY = 21F - heightToRaise; + leg2.rotationPointY = 21F - heightToRaise; + leg3.rotationPointY = 21F - heightToRaise; + leg4.rotationPointY =21F - heightToRaise; + leg5.rotationPointY =22F - heightToRaise; + leg6.rotationPointY =21F - heightToRaise; + leg7.rotationPointY =22F - heightToRaise; + leg8.rotationPointY =21F - heightToRaise; + + leg1.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + leg2.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + leg3.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; + leg4.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; //MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + leg5.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + leg7.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; + leg8.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; + leg6.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; + } + else + { + float heightToRaise = -4.15f; + Shape1.rotationPointY = -8F - heightToRaise; + Shape2.rotationPointY = -8F - heightToRaise; + armLeftA1.rotationPointY = 10F - heightToRaise; + armLeftA2.rotationPointY = 8.5F - heightToRaise; + armLeftB1.rotationPointY = 0F - heightToRaise; + armRightA1.rotationPointY = 10F - heightToRaise; + armRightA2.rotationPointY = 8.5F - heightToRaise; + armRightB1.rotationPointY = 0F - heightToRaise; + lowerBody.rotationPointY = 20F - heightToRaise; + leg1.rotationPointY = 21F - heightToRaise; + leg2.rotationPointY = 21F - heightToRaise; + leg3.rotationPointY = 21F - heightToRaise; + leg4.rotationPointY =21F - heightToRaise; + leg5.rotationPointY =22F - heightToRaise; + leg6.rotationPointY =21F - heightToRaise; + leg7.rotationPointY =22F - heightToRaise; + leg8.rotationPointY =21F - heightToRaise; + } + + + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Random rand1 = new Random(); + + int randActLeft = rand1.nextInt(3); + int randActRight = rand1.nextInt(3); + + if (randActLeft == 1) { + armLeftA1.rotateAngleX = (float) (-85 * Math.PI / 180 + 50 * Math.PI / 180 + * MathHelper.cos(f * 0.6662F + (float) Math.PI)); + armLeftA1.rotateAngleZ = 0F; + + + + armLeftA2.rotateAngleZ = 0F; + armLeftA2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI); + } + + if (randActRight == 0) { + armRightA1.rotateAngleX = (float) (-85 * Math.PI / 180 + 50 * Math.PI / 180 + * MathHelper.cos(f * 0.6662F)); + armRightA2.rotateAngleX = MathHelper.cos(f * 0.6662F); + } + } + +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBoar.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBoar.java index ea85a02..7e02d17 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBoar.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelBoar.java @@ -111,9 +111,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { LEGROT1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; + LEGROT3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; LEGROT2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; + LEGROT4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; super.setLivingAnimations(par1EntityLiving, par2, par3, par4); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCamel.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCamel.java new file mode 100644 index 0000000..0117b84 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCamel.java @@ -0,0 +1,334 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelCamel extends ModelBase +{ + float heightToRaise = 33f; + float renderScale = 1.0f; + //fields + //fields + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer HEADbump; + ModelRenderer HEAD; + ModelRenderer neckTop; + ModelRenderer neckBase; + ModelRenderer humpMain; + ModelRenderer humpMain2; + ModelRenderer saddleBase; + ModelRenderer saddleHorn1; + ModelRenderer saddleHorn2; + ModelRenderer Body; + ModelRenderer hip1; + ModelRenderer Leg1toProt; + ModelRenderer Leg1BotRot; + ModelRenderer hip2; + ModelRenderer Leg2toProt; + ModelRenderer Leg2BotRot; + ModelRenderer hip3; + ModelRenderer Leg3toProt; + ModelRenderer Leg3BotRot; + ModelRenderer hip4; + ModelRenderer Leg4toProt; + ModelRenderer Leg4BotRot; + ModelRenderer tail; + + public ModelCamel() + { + textureWidth = 128; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -3F, -4F, 5, 4, 7); + HEAD.setRotationPoint(0F, 3F - heightToRaise, -15F); + HEAD.setTextureSize(128, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.2268928F, 0F, 0F); + HEADbump = new ModelRenderer(this, 105, 42); + HEADbump.addBox(-2F, -2F, -3F, 3, 2, 6); + //HEADbump.setRotationPoint(1F, 1.5F, -15.5F); + HEADbump.setRotationPoint(1F, -1.5F, -0.5F); + HEADbump.setTextureSize(128, 64); + HEADbump.mirror = true; + setRotation(HEADbump, 0.296706F, 0F, 0F); + HEAD.addChild(HEADbump); + earLeft = new ModelRenderer(this, 60, 6); + earLeft.addBox(0F, -3F, -1F, 1, 4, 1); + //earLeft.setRotationPoint(1.5F, 1F, -13F); + earLeft.setRotationPoint(1.5F, -1.0F, 2.5F); + earLeft.setTextureSize(128, 64); + earLeft.mirror = true; + setRotation(earLeft, 0F, 0F, 0.5235988F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 60, 1); + earRight.addBox(-1F, -3F, -1F, 1, 4, 1); + //earRight.setRotationPoint(-0.5F, 1F, -13F); + earRight.setRotationPoint(-0.5F, -1.0F, 2.5F); + earRight.setTextureSize(128, 64); + earRight.mirror = true; + setRotation(earRight, 0F, 0F, -0.5235988F); + HEAD.addChild(earRight); + + neckTop = new ModelRenderer(this, 29, 1); + neckTop.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + neckTop.setRotationPoint(0.5F, 1.8F - heightToRaise , -14F); + neckTop.setTextureSize(128, 64); + neckTop.mirror = true; + setRotation(neckTop, 0.6457718F, 0F, 0F); + neckBase = new ModelRenderer(this, 43, 1); + neckBase.addBox(-1.5F, 0F, -1.5F, 3, 6, 4); + neckBase.setRotationPoint(0.5F, 6F - heightToRaise, -11.5F); + neckBase.setTextureSize(128, 64); + neckBase.mirror = true; + setRotation(neckBase, 1.117011F, 0F, 0F); + humpMain = new ModelRenderer(this, 1, 41); + humpMain.addBox(-3.5F, -2F, -2F, 8, 4, 9); + humpMain.setRotationPoint(0F, 3F - heightToRaise, -0.5F); + humpMain.setTextureSize(128, 64); + humpMain.mirror = true; + setRotation(humpMain, 0F, 0F, 0F); + humpMain2 = new ModelRenderer(this, 37, 42); + humpMain2.addBox(-3F, -2F, -2F, 7, 4, 7); + humpMain2.setRotationPoint(0F, 0.75F - heightToRaise, 0.5F); + humpMain2.setTextureSize(128, 64); + humpMain2.mirror = true; + setRotation(humpMain2, 0F, 0F, 0F); + saddleBase = new ModelRenderer(this, 68, 52); + saddleBase.addBox(-3.5F, -2F, -2F, 6, 1, 5); + saddleBase.setRotationPoint(1F, 4F - heightToRaise, -5F); + saddleBase.setTextureSize(128, 64); + saddleBase.mirror = true; + setRotation(saddleBase, 0F, 0F, 0F); + saddleHorn1 = new ModelRenderer(this, 67, 1); + saddleHorn1.addBox(-1F, -3F, -1F, 1, 5, 1); + saddleHorn1.setRotationPoint(1F, 1F - heightToRaise, -6F); + saddleHorn1.setTextureSize(128, 64); + saddleHorn1.mirror = true; + setRotation(saddleHorn1, 0.3346075F, 0F, 0F); + saddleHorn2 = new ModelRenderer(this, 73, 5); + saddleHorn2.addBox(-2F, -1F, -1F, 4, 1, 1); + saddleHorn2.setRotationPoint(0.5F, 0F - heightToRaise, -7F); + saddleHorn2.setTextureSize(128, 64); + saddleHorn2.mirror = true; + setRotation(saddleHorn2, 0F, 0F, 0F); + Body = new ModelRenderer(this, 1, 14); + Body.addBox(-3.5F, -2F, -10F, 9, 9, 16); + Body.setRotationPoint(-0.5F, 5F - heightToRaise, 3F); + Body.setTextureSize(128, 64); + Body.mirror = true; + setRotation(Body, 0F, 0F, 0F); + hip1 = new ModelRenderer(this, 68, 42); + hip1.addBox(-1F, -3F, -1F, 4, 4, 4); + hip1.setRotationPoint(-4F, 12F - heightToRaise, -5.5F); + hip1.setTextureSize(128, 64); + hip1.mirror = true; + setRotation(hip1, 0.0698132F, 0F, 0F); + Leg1toProt = new ModelRenderer(this, 65, 13); + Leg1toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg1toProt.setRotationPoint(-3F, 12F, -4.5F); + Leg1toProt.setRotationPoint(1F, 0F, 0.5F); + Leg1toProt.setTextureSize(128, 64); + Leg1toProt.mirror = true; + setRotation(Leg1toProt, 0.0698132F, 0F, 0F); + hip1.addChild(Leg1toProt); + Leg1BotRot = new ModelRenderer(this, 65, 25); + Leg1BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg1BotRot.setRotationPoint(-3F, 17F, -4F); + Leg1BotRot.setRotationPoint(0F, 6F, 0F); + Leg1BotRot.setTextureSize(128, 64); + Leg1BotRot.mirror = true; + setRotation(Leg1BotRot, -0.0698132F, 0F, 0F); + Leg1toProt.addChild(Leg1BotRot); + hip2 = new ModelRenderer(this, 68, 42); + hip2.addBox(-1F, -1F, -1F, 4, 4, 4); + hip2.setRotationPoint(3F, 10F - heightToRaise, -5.5F); + hip2.setTextureSize(128, 64); + hip2.mirror = true; + setRotation(hip2, 0.0698132F, 0F, 0F); + Leg2toProt = new ModelRenderer(this, 52, 13); + Leg2toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg2toProt.setRotationPoint(4F, 11F, -4.5F); + Leg2toProt.setRotationPoint(1F, 2F, 0.5F); + Leg2toProt.setTextureSize(128, 64); + Leg2toProt.mirror = true; + setRotation(Leg2toProt, 0.0698132F, 0F, 0F); + hip2.addChild(Leg2toProt); + Leg2BotRot = new ModelRenderer(this, 52, 25); + Leg2BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg2BotRot.setRotationPoint(4F, 17F, -4F); + Leg2BotRot.setRotationPoint(0F, 6F, 0F); + Leg2BotRot.setTextureSize(128, 64); + Leg2BotRot.mirror = true; + setRotation(Leg2BotRot, -0.0698132F, 0F, 0F); + Leg2toProt.addChild(Leg2BotRot); + hip3 = new ModelRenderer(this, 87, 42); + hip3.addBox(-1F, -1F, -1F, 4, 5, 4); + hip3.setRotationPoint(-4F, 9F - heightToRaise, 5F); + hip3.setTextureSize(128, 64); + hip3.mirror = true; + setRotation(hip3, 0.0698132F, 0F, 0F); + Leg3toProt = new ModelRenderer(this, 95, 13); + Leg3toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg3toProt.setRotationPoint(-3F, 12F, 6F); + Leg3toProt.setRotationPoint(1F, 2F, 1F); + Leg3toProt.setTextureSize(128, 64); + Leg3toProt.mirror = true; + setRotation(Leg3toProt, 0.0872665F, 0F, 0F); + hip3.addChild(Leg3toProt); + Leg3BotRot = new ModelRenderer(this, 95, 25); + Leg3BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg3BotRot.setRotationPoint(-3F, 17F, 6.5F); + Leg3BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg3BotRot.setTextureSize(128, 64); + Leg3BotRot.mirror = true; + setRotation(Leg3BotRot, -0.0698132F, 0F, 0F); + Leg3toProt.addChild(Leg3BotRot); + + hip4 = new ModelRenderer(this, 87, 42); + hip4.addBox(-1F, -1F, -1F, 4, 5, 4); + hip4.setRotationPoint(3F, 9F - heightToRaise, 5F); + hip4.setTextureSize(128, 64); + hip4.mirror = true; + setRotation(hip4, 0.0698132F, 0F, 0F); + Leg4toProt = new ModelRenderer(this, 81, 13); + Leg4toProt.addBox(-1.5F, 0F, -1.5F, 3, 6, 3); + //Leg4toProt.setRotationPoint(4F, 12F, 6F); + Leg4toProt.setRotationPoint(1F, 2F, 1F); + Leg4toProt.setTextureSize(128, 64); + Leg4toProt.mirror = true; + setRotation(Leg4toProt, 0.0872665F, 0F, 0F); + hip4.addChild(Leg4toProt); + Leg4BotRot = new ModelRenderer(this, 81, 25); + Leg4BotRot.addBox(-1.5F, 0F, -1.5F, 3, 7, 3); + //Leg4BotRot.setRotationPoint(4F, 17F, 6.5F); + Leg4BotRot.setRotationPoint(0F, 6F, 0.5F); + Leg4BotRot.setTextureSize(128, 64); + Leg4BotRot.mirror = true; + setRotation(Leg4BotRot, -0.0698132F, 0F, 0F); + Leg4toProt.addChild(Leg4BotRot); + tail = new ModelRenderer(this, 109, 13); + tail.addBox(-1F, -1F, 0F, 2, 7, 2); + tail.setRotationPoint(0F, 7F - heightToRaise, 7.6F); + tail.setTextureSize(128, 64); + tail.mirror = true; + setRotation(tail, 0.5585054F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float field_78145_x = 0.0f; + float field_78145_g = 2.2F; + float field_78151_h = 3.4F; + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + //Leg1toProt.render(f5); + //Leg1BotRot.render(f5); + hip2.render(renderScale * f5); + //Leg2toProt.render(f5); + //Leg2BotRot.render(f5); + hip3.render(renderScale * f5); + //Leg3toProt.render(f5); + //Leg3BotRot.render(f5); + hip4.render(renderScale * f5); + //Leg4toProt.render(f5); + //Leg4BotRot.render(f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + GL11.glPushMatrix(); + GL11.glScalef(1.6F, 1.6F, 1.6F); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(renderScale * f5); + neckTop.render(renderScale * f5); + neckBase.render(renderScale * f5); + humpMain.render(renderScale * f5); + humpMain2.render(renderScale * f5); + saddleBase.render(renderScale * f5); + saddleHorn1.render(renderScale * f5); + saddleHorn2.render(renderScale * f5); + Body.render(renderScale * f5); + hip1.render(renderScale * f5); + hip2.render(renderScale * f5); + hip3.render(renderScale * f5); + hip4.render(renderScale * f5); + tail.render(renderScale * f5); + GL11.glPopMatrix(); + } + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + /* Tail Rotation */ + //NECKROT.rotateAngleX = (float) (45 * Math.PI / 180 + 7 * Math.PI / 180 + //* MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + /* Tail Rotation */ + tail.rotateAngleZ = (float) (0.5f * MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + /* Leg Animation */ + hip1.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + hip2.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + Leg1BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg2BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + hip3.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + hip4.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + Leg3BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + Leg4BotRot.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleX = f4 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + } + + } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCentipede.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCentipede.java index ff682b3..4552f02 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCentipede.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCentipede.java @@ -6,8 +6,13 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; + public class ModelCentipede extends ModelBase { + float heightToRaise = 27f; + float renderScale = 0.5f; + ModelRenderer sidebody2; ModelRenderer body; ModelRenderer sidebody3; @@ -47,30 +52,30 @@ public ModelCentipede() { sidebody2 = new ModelRenderer(this, 42, 17); sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); + sidebody2.setRotationPoint(4.5F, 18.5F - heightToRaise, 0F); sidebody2.setTextureSize(64, 32); sidebody2.mirror = true; setRotation(sidebody2, 0F, 0F, 0F); body = new ModelRenderer(this, 0, 14); body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); + body.setRotationPoint(0F, 18.5F - heightToRaise, 6F); body.setTextureSize(64, 32); body.mirror = true; setRotation(body, 0F, 0F, 0F); sidebody3 = new ModelRenderer(this, 0, 2); sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); + sidebody3.setRotationPoint(0F, 21.5F - heightToRaise, 0F); sidebody3.setTextureSize(64, 32); sidebody3.mirror = true; setRotation(sidebody3, 0F, 0F, 0F); sidebody1 = new ModelRenderer(this, 42, 17); sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); + sidebody1.setRotationPoint(-4.5F, 18.5F - heightToRaise, 0F); sidebody1.setTextureSize(64, 32); sidebody1.mirror = true; setRotation(sidebody1, 0F, 0F, 0F); ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); + ANTENLEFROT1.setRotationPoint(-3F, 17.5F - heightToRaise, -6F); setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); ANTENLEFROT1.mirror = true; ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); @@ -87,7 +92,7 @@ public ModelCentipede() { ANTENLEFROT2.addChild(ANTENLEFROT3); ANTENLEFROT1.addChild(ANTENLEFROT2); ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); + ANTENRIGROT1.setRotationPoint(3F, 17.5F - heightToRaise, -6F); setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); ANTENRIGROT1.mirror = true; ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); @@ -104,7 +109,7 @@ public ModelCentipede() { ANTENRIGROT2.addChild(ANTENRIGROT3); ANTENRIGROT1.addChild(ANTENRIGROT2); LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); + LEG11ROT.setRotationPoint(-3F, 22F - heightToRaise, -3F); setRotation(LEG11ROT, 0F, 0F, -0.1745329F); LEG11ROT.mirror = true; LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); @@ -115,7 +120,7 @@ public ModelCentipede() { LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); LEG11ROT.addChild(LEG12ROT); LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); + LEG21ROT.setRotationPoint(3F, 22F - heightToRaise, -3F); setRotation(LEG21ROT, 0F, 0F, 0.1745329F); LEG21ROT.mirror = true; LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); @@ -126,7 +131,7 @@ public ModelCentipede() { LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); LEG21ROT.addChild(LEG22ROT); LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); + LEG31ROT.setRotationPoint(-3F, 22F - heightToRaise, 3F); setRotation(LEG31ROT, 0F, 0F, -0.1745329F); LEG31ROT.mirror = true; LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); @@ -137,7 +142,7 @@ public ModelCentipede() { LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); LEG31ROT.addChild(LEG32ROT); LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); + LEG41ROT.setRotationPoint(3F, 22F - heightToRaise, 3F); setRotation(LEG41ROT, 0F, 0F, 0.1745329F); LEG41ROT.mirror = true; LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); @@ -151,48 +156,55 @@ public ModelCentipede() { @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - sidebody2.render(f5); - body.render(f5); - sidebody3.render(f5); - sidebody1.render(f5); - ANTENLEFROT1.render(f5); - ANTENRIGROT1.render(f5); - LEG11ROT.render(f5); - LEG21ROT.render(f5); - LEG31ROT.render(f5); - LEG41ROT.render(f5); + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + float var8 = 1.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + + sidebody2.render(renderScale * f5); + body.render(renderScale * f5); + sidebody3.render(renderScale * f5); + sidebody1.render(renderScale * f5); + ANTENLEFROT1.render(renderScale * f5); + ANTENRIGROT1.render(renderScale * f5); + LEG11ROT.render(renderScale * f5); + LEG21ROT.render(renderScale * f5); + LEG31ROT.render(renderScale * f5); + LEG41ROT.render(renderScale * f5); + GL11.glPopMatrix(); } @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { - super.setLivingAnimations(par1EntityLiving, par2, par3, par4); - - ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 - * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); - - LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; - LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + + ANTENLEFROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 + * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); + ANTENLEFROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 + * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); + + ANTENRIGROT2.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 + * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); + ANTENRIGROT3.rotateAngleX = (float) (-15 * Math.PI / 180 + 20 * Math.PI / 180 + * MathHelper.cos(par2 * 0.6662F + (float) Math.PI)); + + LEG11ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; + LEG21ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + LEG31ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.4F * par3; + LEG41ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; } private void setRotation(ModelRenderer model, float x, float y, float z) { - model.rotateAngleX = x; - model.rotateAngleY = y; - model.rotateAngleZ = z; + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; } @Override public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity par7Entity) { - super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); + super.setRotationAngles(f, f1, f2, f3, f4, f5, par7Entity); } } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCrocodile.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCrocodile.java index c4b32e9..1e9f34f 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCrocodile.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelCrocodile.java @@ -487,9 +487,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { LEG2TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; + LEG4TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; LEG1TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; - LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; + LEG3TOPROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; BODY1ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 0 / 4 * (float) Math.PI) * 0.1F * par3; BODY2ROT.rotateAngleY = MathHelper.cos(par2 * 0.6662F * 2f + 1 / 4 * (float) Math.PI) * 0.1F * par3; diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelDeer.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelDeer.java index ee96f23..8ad721a 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelDeer.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelDeer.java @@ -245,19 +245,16 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f leg3.render(renderScale * f5); leg4.render(renderScale * f5); tail.render(renderScale * f5); - - } - - + } } @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { /* Constant Animation Rotations */ leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; /*tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math .log(par3 + 1))); @@ -281,9 +278,10 @@ private void setRotation(ModelRenderer model, float x, float y, float z) public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); - HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +15) * (float) (Math.PI / 180f); - HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +15) * (float) (Math.PI / 180f); - + //HEADROT.rotateAngleX = Math.min(Math.max(f4, -14), +45) * (float) (Math.PI / 180f); + //HEADROT.rotateAngleY = Math.min(Math.max(f3, -15), +45) * (float) (Math.PI / 180f); + HEADROT.rotateAngleX = f4 / (180F / (float)Math.PI); //Math.min(Math.max(f4, -14), +35) * (float) (Math.PI / 180f); + HEADROT.rotateAngleY = f3 / (180F / (float)Math.PI); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelElephant.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelElephant.java index 8a0a8be..552b472 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelElephant.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelElephant.java @@ -252,19 +252,21 @@ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, f public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { LEG1TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper .abs(Math.log(par3 + 1))); + LEG2TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + LEG1BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG2BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); + LEG2BOTROT.rotateAngleX = - LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper - .abs(Math.log(par3 + 1))); - LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); - LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); - LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F - * ModelHelper.abs(Math.log(par3 + 1))); + LEG3TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + LEG4TOPROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + LEG3BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + LEG4BOTROT.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); tail.rotateAngleZ = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper.abs(Math .log(par3 + 1))); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFollower.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFollower.java index e0bd984..cf75a5f 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFollower.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFollower.java @@ -10,6 +10,9 @@ public class ModelFollower extends ModelBase { + float heightToRaise = -21f; + float renderScale = 0.5f; + ModelRenderer sidebody2; ModelRenderer body; ModelRenderer sidebody3; @@ -49,30 +52,30 @@ public ModelFollower() { sidebody2 = new ModelRenderer(this, 42, 17); sidebody2.addBox(0F, -2.5F, -5F, 1, 5, 10); - sidebody2.setRotationPoint(4.5F, 18.5F, 0F); + sidebody2.setRotationPoint(4.5F, 18.5F - heightToRaise, 0F); sidebody2.setTextureSize(64, 32); sidebody2.mirror = true; setRotation(sidebody2, 0F, 0F, 0F); body = new ModelRenderer(this, 0, 14); body.addBox(-4.5F, -3F, -12F, 9, 6, 12); - body.setRotationPoint(0F, 18.5F, 6F); + body.setRotationPoint(0F, 18.5F - heightToRaise, 6F); body.setTextureSize(64, 32); body.mirror = true; setRotation(body, 0F, 0F, 0F); sidebody3 = new ModelRenderer(this, 0, 2); sidebody3.addBox(-3F, 0F, -5.5F, 6, 1, 11); - sidebody3.setRotationPoint(0F, 21.5F, 0F); + sidebody3.setRotationPoint(0F, 21.5F - heightToRaise, 0F); sidebody3.setTextureSize(64, 32); sidebody3.mirror = true; setRotation(sidebody3, 0F, 0F, 0F); sidebody1 = new ModelRenderer(this, 42, 17); sidebody1.addBox(-1F, -2.5F, -5F, 1, 5, 10); - sidebody1.setRotationPoint(-4.5F, 18.5F, 0F); + sidebody1.setRotationPoint(-4.5F, 18.5F - heightToRaise, 0F); sidebody1.setTextureSize(64, 32); sidebody1.mirror = true; setRotation(sidebody1, 0F, 0F, 0F); ANTENLEFROT1 = new ModelRenderer(this, "ANTENLEFROT1"); - ANTENLEFROT1.setRotationPoint(-3F, 17.5F, -6F); + ANTENLEFROT1.setRotationPoint(-3F, 17.5F - heightToRaise, -6F); setRotation(ANTENLEFROT1, -0.5235988F, 0.5235988F, 0F); ANTENLEFROT1.mirror = true; ANTENLEFROT1.addBox("antenlef1", -0.5F, -0.5F, -4F, 1, 1, 4); @@ -89,7 +92,7 @@ public ModelFollower() { ANTENLEFROT2.addChild(ANTENLEFROT3); ANTENLEFROT1.addChild(ANTENLEFROT2); ANTENRIGROT1 = new ModelRenderer(this, "ANTENRIGROT1"); - ANTENRIGROT1.setRotationPoint(3F, 17.5F, -6F); + ANTENRIGROT1.setRotationPoint(3F, 17.5F - heightToRaise, -6F); setRotation(ANTENRIGROT1, -0.5235988F, -0.5235988F, 0F); ANTENRIGROT1.mirror = true; ANTENRIGROT1.addBox("antenrig1", -0.5F, -0.5F, -4F, 1, 1, 4); @@ -106,7 +109,7 @@ public ModelFollower() { ANTENRIGROT2.addChild(ANTENRIGROT3); ANTENRIGROT1.addChild(ANTENRIGROT2); LEG11ROT = new ModelRenderer(this, "LEG11ROT"); - LEG11ROT.setRotationPoint(-3F, 22F, -3F); + LEG11ROT.setRotationPoint(-3F, 22F - heightToRaise, -3F); setRotation(LEG11ROT, 0F, 0F, -0.1745329F); LEG11ROT.mirror = true; LEG11ROT.addBox("leg11", -4F, -0.5F, -1F, 4, 1, 2); @@ -117,7 +120,7 @@ public ModelFollower() { LEG12ROT.addBox("leg12", -2F, -0.5F, -1F, 2, 1, 2); LEG11ROT.addChild(LEG12ROT); LEG21ROT = new ModelRenderer(this, "LEG21ROT"); - LEG21ROT.setRotationPoint(3F, 22F, -3F); + LEG21ROT.setRotationPoint(3F, 22F - heightToRaise, -3F); setRotation(LEG21ROT, 0F, 0F, 0.1745329F); LEG21ROT.mirror = true; LEG21ROT.addBox("leg21", 0F, -0.5F, -1F, 4, 1, 2); @@ -128,7 +131,7 @@ public ModelFollower() { LEG22ROT.addBox("leg22", 0F, -0.5F, -1F, 2, 1, 2); LEG21ROT.addChild(LEG22ROT); LEG31ROT = new ModelRenderer(this, "LEG31ROT"); - LEG31ROT.setRotationPoint(-3F, 22F, 3F); + LEG31ROT.setRotationPoint(-3F, 22F - heightToRaise, 3F); setRotation(LEG31ROT, 0F, 0F, -0.1745329F); LEG31ROT.mirror = true; LEG31ROT.addBox("leg31", -4F, -0.5F, -1F, 4, 1, 2); @@ -139,7 +142,7 @@ public ModelFollower() { LEG32ROT.addBox("leg32", -2F, -0.5F, -1F, 2, 1, 2); LEG31ROT.addChild(LEG32ROT); LEG41ROT = new ModelRenderer(this, "LEG41ROT"); - LEG41ROT.setRotationPoint(3F, 22F, 3F); + LEG41ROT.setRotationPoint(3F, 22F - heightToRaise, 3F); setRotation(LEG41ROT, 0F, 0F, 0.1745329F); LEG41ROT.mirror = true; LEG41ROT.addBox("leg41", 0F, -0.5F, -1F, 4, 1, 2); @@ -153,21 +156,25 @@ public ModelFollower() { @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(f, f1, f2, f3, f4, f5, entity); - float scale = f5; - if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { - scale = f5 * 0.98f; - } - sidebody2.render(scale); - body.render(scale); - sidebody3.render(scale); - sidebody1.render(scale); - LEG11ROT.render(scale); - LEG21ROT.render(scale); - LEG31ROT.render(scale); - LEG41ROT.render(scale); - } + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float scale = f5; + if (entity instanceof EntityFollower && ((EntityFollower) entity).getFollowerIndex() % 2 == 0) { + scale = f5 * 0.58f; + } + + sidebody2.render(renderScale * f5); + body.render(renderScale * f5); + sidebody3.render(renderScale * f5); + sidebody1.render(renderScale * f5); + //ANTENLEFROT1.render(renderScale * f5); + //ANTENRIGROT1.render(renderScale * f5); + LEG11ROT.render(renderScale * f5); + LEG21ROT.render(renderScale * f5); + LEG31ROT.render(renderScale * f5); + LEG41ROT.render(renderScale * f5); + + } @Override public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFox.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFox.java index 255ddce..72a2f34 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFox.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelFox.java @@ -147,6 +147,7 @@ public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, f TAILROT.rotateAngleX = (float) (-23 * Math.PI / 180); LEG1ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); LEG1ROT.setRotationPoint(-1.5F, 2.5F, 7F); + LEG2ROT.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper .abs(Math.log(par3 + 1))); LEG2ROT.setRotationPoint(1.5F, 2.5F, 7F); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGiantRat.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGiantRat.java index 90fd2c3..e642468 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGiantRat.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGiantRat.java @@ -162,9 +162,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { /* Constant Animation Rotations */ frontLegLeft.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - backLegLeft.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + backLegLeft.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; frontLegRight.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - backLegRight.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + backLegRight.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; super.setLivingAnimations(par1EntityLiving, par2, par3, par4); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGoat.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGoat.java index 5bbe7d6..303826c 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGoat.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelGoat.java @@ -10,7 +10,7 @@ public class ModelGoat extends ModelBase { - float heightToRaise = 4f; + float heightToRaise = 2f; float renderScale = 1.0f; //fields ModelRenderer HEADROT; @@ -167,9 +167,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { /* Constant Animation Rotations */ leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + leg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + leg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; super.setLivingAnimations(par1EntityLiving, par2, par3, par4); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelHorse.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelHorse.java index df4da3e..9457d9c 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelHorse.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelHorse.java @@ -12,7 +12,7 @@ public class ModelHorse extends ModelBase { - float heightToRaise = 6; + float heightToRaise = 4; ModelRenderer body1; ModelRenderer tail; ModelRenderer body2; @@ -134,7 +134,7 @@ public ModelHorse() { @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - float scale = 0.8f * f5; + float scale = 1.2f * f5; super.render(entity, f, f1, f2, f3, f4, scale); setRotationAngles(f, f1, f2, f3, f4, scale, entity); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelMonkeyTailed.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelMonkeyTailed.java new file mode 100644 index 0000000..fd029e1 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelMonkeyTailed.java @@ -0,0 +1,251 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import com.stek101.projectzulu.common.core.ModelHelper; + +public class ModelMonkeyTailed extends ModelBase { + + float heightToRaise = 1f; + float renderScale = 0.80f; + + //fields + ModelRenderer HEAD; + ModelRenderer neck; + ModelRenderer snoutHEAD; + ModelRenderer earLeft; + ModelRenderer earRight; + ModelRenderer BODYbase; + ModelRenderer BODYtop; + ModelRenderer leftTopArm; + ModelRenderer leftBotArm; + ModelRenderer rightTopArm; + ModelRenderer rightBotArm; + ModelRenderer leftTopLeg; + ModelRenderer leftBotLeg; + ModelRenderer rightTopLeg; + ModelRenderer rightBotLeg; + ModelRenderer tailBase; + ModelRenderer tailExt1; + ModelRenderer tailExt2; + + public ModelMonkeyTailed() + { + textureWidth = 64; + textureHeight = 64; + + HEAD = new ModelRenderer(this, 1, 1); + HEAD.addBox(-2F, -4F, -3F, 5, 5, 5); + HEAD.setRotationPoint(0.5F, 11F - heightToRaise, -5F); + HEAD.setTextureSize(64, 64); + HEAD.mirror = true; + setRotation(HEAD, 0.1745329F, 0F, 0F); + neck = new ModelRenderer(this, 19, 44); + neck.addBox(-2F, -2F, -1F, 3, 4, 3); + neck.setRotationPoint(1.5F, 11F - heightToRaise, -4F); + neck.setTextureSize(64, 64); + neck.mirror = true; + setRotation(neck, 0.0174533F, 0F, 0F); + snoutHEAD = new ModelRenderer(this, 21, 1); + snoutHEAD.addBox(-1F, -1F, -3F, 3, 3, 5); + //snoutHEAD.setRotationPoint(0.5F, 10.2F, -7F); + snoutHEAD.setRotationPoint(0F, -0.9F, -1.0F); + snoutHEAD.setTextureSize(64, 64); + snoutHEAD.mirror = true; + setRotation(snoutHEAD, 0.1745329F, 0F, 0F); + HEAD.addChild(snoutHEAD); + earLeft = new ModelRenderer(this, 1, 44); + earLeft.addBox(0F, -1F, 0F, 3, 3, 1); + //earLeft.setRotationPoint(2F, 8.4F, -5F); + earLeft.setRotationPoint(2.0F, -2.6F, 0F); + earLeft.setTextureSize(64, 64); + earLeft.mirror = true; + setRotation(earLeft, 0.1396263F, 0F, 0F); + HEAD.addChild(earLeft); + earRight = new ModelRenderer(this, 1, 50); + earRight.addBox(-2F, -1F, 0F, 3, 3, 1); + //earRight.setRotationPoint(-1F, 8.4F, -5F); + earRight.setRotationPoint(-2.0F, -2.6F, 0F); + earRight.setTextureSize(64, 64); + earRight.mirror = true; + setRotation(earRight, 0.1396263F, 0F, 0F); + HEAD.addChild(earRight); + BODYbase = new ModelRenderer(this, 1, 12); + BODYbase.addBox(-2F, -2F, -2F, 6, 5, 12); + BODYbase.setRotationPoint(0F, 11F - heightToRaise, -1F); + BODYbase.setTextureSize(64, 64); + BODYbase.mirror = true; + setRotation(BODYbase, -0.2974289F, 0F, 0F); + BODYtop = new ModelRenderer(this, 1, 30); + BODYtop.addBox(-2F, -1F, -2F, 5, 4, 8); + BODYtop.setRotationPoint(0.5F, 9.5F - heightToRaise, 0F); + BODYtop.setTextureSize(64, 64); + BODYtop.mirror = true; + setRotation(BODYtop, -0.2974289F, 0F, 0F); + leftTopArm = new ModelRenderer(this, 37, 1); + leftTopArm.addBox(0F, -1F, -1F, 3, 7, 3); + leftTopArm.setRotationPoint(3F, 11F - heightToRaise, -2F); + leftTopArm.setTextureSize(64, 64); + leftTopArm.mirror = true; + setRotation(leftTopArm, -0.1858931F, 0F, 0F); + leftBotArm = new ModelRenderer(this, 37, 12); + leftBotArm.addBox(-1F, 0F, -1F, 3, 8, 3); + //leftBotArm.setRotationPoint(4F, 16F, -3F); + leftBotArm.setRotationPoint(1.0F, 5.0F, 0.0F); + leftBotArm.setTextureSize(64, 64); + leftBotArm.mirror = true; + setRotation(leftBotArm, -0.5576792F, 0F, 0F); + leftTopArm.addChild(leftBotArm); + rightTopArm = new ModelRenderer(this, 51, 1); + rightTopArm.addBox(-2F, -1F, -1F, 3, 7, 3); + rightTopArm.setRotationPoint(-2F, 11F - heightToRaise, -2F); + rightTopArm.setTextureSize(64, 64); + rightTopArm.mirror = true; + setRotation(rightTopArm, -0.1858931F, 0F, 0F); + rightBotArm = new ModelRenderer(this, 51, 12); + rightBotArm.addBox(-1F, 0F, -1F, 3, 8, 3); + //rightBotArm.setRotationPoint(-3F, 16F, -3F); + rightBotArm.setRotationPoint(-1.0F, 5.0F, 0.0F); + rightBotArm.setTextureSize(64, 64); + rightBotArm.mirror = true; + setRotation(rightBotArm, -0.5576792F, 0F, 0F); + rightTopArm.addChild(rightBotArm); + leftTopLeg = new ModelRenderer(this, 37, 25); + leftTopLeg.addBox(0F, -1F, -1F, 3, 7, 3); + leftTopLeg.setRotationPoint(2F, 13F - heightToRaise, 6F); + leftTopLeg.setTextureSize(64, 64); + leftTopLeg.mirror = true; + setRotation(leftTopLeg, -0.6108652F, 0F, 0F); + leftBotLeg = new ModelRenderer(this, 37, 36); + leftBotLeg.addBox(-1F, 0F, -1F, 3, 7, 3); + //leftBotLeg.setRotationPoint(3F, 17F, 3F); + leftBotLeg.setRotationPoint(1F, 4F, 0F); + leftBotLeg.setTextureSize(64, 64); + leftBotLeg.mirror = true; + setRotation(leftBotLeg, 0.3717861F, 0F, 0F); + leftTopLeg.addChild(leftBotLeg); + rightTopLeg = new ModelRenderer(this, 51, 25); + rightTopLeg.addBox(-2F, -1F, -1F, 3, 7, 3); + rightTopLeg.setRotationPoint(-1F, 13F - heightToRaise, 6F); + rightTopLeg.setTextureSize(64, 64); + rightTopLeg.mirror = true; + setRotation(rightTopLeg, -0.6108652F, 0F, 0F); + rightBotLeg = new ModelRenderer(this, 51, 36); + rightBotLeg.addBox(-1F, 0F, -1F, 3, 7, 3); + //rightBotLeg.setRotationPoint(-2F, 17F, 3F); + rightBotLeg.setRotationPoint(-1F, 4F, 0F); + rightBotLeg.setTextureSize(64, 64); + rightBotLeg.mirror = true; + setRotation(rightBotLeg, 0.3717861F, 0F, 0F); + rightTopLeg.addChild(rightBotLeg); + tailBase = new ModelRenderer(this, 1, 56); + tailBase.addBox(0F, 0F, 0F, 1, 1, 6); + tailBase.setRotationPoint(0.5F, 13F - heightToRaise, 7F); + tailBase.setTextureSize(64, 64); + tailBase.mirror = true; + setRotation(tailBase, 0F, 0F, 0F); + tailExt1 = new ModelRenderer(this, 16, 56); + tailExt1.addBox(0F, 0F, 0F, 1, 1, 6); + tailExt1.setRotationPoint(0.5F, 13F - heightToRaise, 13F); + tailExt1.setTextureSize(64, 64); + tailExt1.mirror = true; + setRotation(tailExt1, -0.5576792F, 0F, 0F); + tailExt2 = new ModelRenderer(this, 29, 55); + tailExt2.addBox(0F, 0F, 0F, 1, 1, 7); + tailExt2.setRotationPoint(0.5F, 15.9F - heightToRaise, 18F); + tailExt2.setTextureSize(64, 64); + tailExt2.mirror = true; + setRotation(tailExt2, -0.9856463F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + + if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); + GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + //GL11.glTranslatef(field_78145_x, field_78145_g * f5, field_78151_h * f5); + HEAD.render(renderScale * f5); + neck.render(renderScale * f5); + BODYbase.render(renderScale * f5); + BODYtop.render(renderScale * f5); + leftTopArm.render(renderScale * f5); + rightTopArm.render(renderScale * f5); + leftTopLeg.render(renderScale * f5); + rightTopLeg.render(renderScale * f5); + tailBase.render(renderScale * f5); + tailExt1.render(renderScale * f5); + tailExt2.render(renderScale * f5); + GL11.glPopMatrix(); + } else { + //GL11.glPushMatrix(); + // GL11.glScalef(0.85F, 0.85F, 0.85F); + // GL11.glTranslatef(0.0F, 24.0F * f5, 0.0F); + HEAD.render(f5); + neck.render(f5); + //snoutHEAD.render(f5); + //earLeft.render(f5); + //earRight.render(f5); + BODYbase.render(f5); + BODYtop.render(f5); + leftTopArm.render(f5); + //leftBotArm.render(f5); + rightTopArm.render(f5); + //rightBotArm.render(f5); + leftTopLeg.render(f5); + //leftBotLeg.render(f5); + rightTopLeg.render(f5); + //rightBotLeg.render(f5); + tailBase.render(f5); + tailExt1.render(f5); + tailExt2.render(f5); + // GL11.glPopMatrix(); + } + + } + + @Override + public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { + + leftTopArm.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + rightTopArm.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + + + leftTopLeg.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F + (float) Math.PI) * 1.8F * ModelHelper + .abs(Math.log(par3 + 1))); + + rightTopLeg.rotateAngleX = (float) (MathHelper.cos(par2 * 0.6662F) * 1.8F * ModelHelper.abs(Math.log(par3 + 1))); + leftBotLeg.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2 + (float) Math.PI) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + rightBotLeg.rotateAngleX = (float) Math.abs(MathHelper.cos(par2 * 0.6662F / 2) * 1.8F + * ModelHelper.abs(Math.log(par3 + 1))); + + super.setLivingAnimations(par1EntityLiving, par2, par3, par4); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + HEAD.rotateAngleY = f3 / (180F / (float)Math.PI); + HEAD.rotateAngleX = f3 / (180F / (float)Math.PI); + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelPZBat.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelPZBat.java new file mode 100644 index 0000000..e4d4c3e --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelPZBat.java @@ -0,0 +1,116 @@ +package com.stek101.projectzulu.common.mobs.models; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; + +import com.stek101.projectzulu.common.mobs.entity.EntityPZBat; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class ModelPZBat extends ModelBase +{ + private ModelRenderer batHead; + /** The body box of the bat model. */ + private ModelRenderer batBody; + /** The inner right wing box of the bat model. */ + private ModelRenderer batRightWing; + /** The inner left wing box of the bat model. */ + private ModelRenderer batLeftWing; + /** The outer right wing box of the bat model. */ + private ModelRenderer batOuterRightWing; + /** The outer left wing box of the bat model. */ + private ModelRenderer batOuterLeftWing; + + public ModelPZBat() + { + this.textureWidth = 64; + this.textureHeight = 64; + this.batHead = new ModelRenderer(this, 0, 0); + this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); + ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0); + modelrenderer.addBox(-4.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(modelrenderer); + ModelRenderer modelrenderer1 = new ModelRenderer(this, 24, 0); + modelrenderer1.mirror = true; + modelrenderer1.addBox(1.0F, -6.0F, -2.0F, 3, 4, 1); + this.batHead.addChild(modelrenderer1); + this.batBody = new ModelRenderer(this, 0, 16); + this.batBody.addBox(-3.0F, 4.0F, -3.0F, 6, 12, 6); + this.batBody.setTextureOffset(0, 34).addBox(-5.0F, 16.0F, 0.0F, 10, 6, 1); + this.batRightWing = new ModelRenderer(this, 42, 0); + this.batRightWing.addBox(-12.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterRightWing = new ModelRenderer(this, 24, 16); + this.batOuterRightWing.setRotationPoint(-12.0F, 1.0F, 1.5F); + this.batOuterRightWing.addBox(-8.0F, 1.0F, 0.0F, 8, 12, 1); + this.batLeftWing = new ModelRenderer(this, 42, 0); + this.batLeftWing.mirror = true; + this.batLeftWing.addBox(2.0F, 1.0F, 1.5F, 10, 16, 1); + this.batOuterLeftWing = new ModelRenderer(this, 24, 16); + this.batOuterLeftWing.mirror = true; + this.batOuterLeftWing.setRotationPoint(12.0F, 1.0F, 1.5F); + this.batOuterLeftWing.addBox(0.0F, 1.0F, 0.0F, 8, 12, 1); + this.batBody.addChild(this.batRightWing); + this.batBody.addChild(this.batLeftWing); + this.batRightWing.addChild(this.batOuterRightWing); + this.batLeftWing.addChild(this.batOuterLeftWing); + } + + /** + * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and + * it seems a good match for a bats size + */ + public int getBatSize() + { + return 36; + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) + { + EntityPZBat entitybat = (EntityPZBat)p_78088_1_; + float f6; + + /* if (entitybat.getIsBatHanging()) + { + f6 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); + this.batHead.rotateAngleY = (float)Math.PI - p_78088_5_ / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = (float)Math.PI; + this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); + this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); + this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); + this.batBody.rotateAngleX = (float)Math.PI; + this.batRightWing.rotateAngleX = -0.15707964F; + this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); + this.batOuterRightWing.rotateAngleY = -1.7278761F; + this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; + } + else*/ + { + f6 = (180F / (float)Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); + this.batHead.rotateAngleY = p_78088_5_ / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = 0.0F; + this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F; + this.batBody.rotateAngleY = 0.0F; + this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float)Math.PI * 0.25F; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; + this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; + } + + this.batHead.render(p_78088_7_); + this.batBody.render(p_78088_7_); + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRabbit.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRabbit.java index 0b617e1..7d13cf7 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRabbit.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRabbit.java @@ -146,7 +146,7 @@ public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, f } else { /* Walking On The Ground */ leg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; - leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; + leg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; //MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.8F * par3; LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; LEGLEFROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.8F * par3; diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRhino.java b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRhino.java index 015c5cb..a1174e1 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRhino.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/models/ModelRhino.java @@ -151,9 +151,9 @@ public void render(Entity entity, float f, float f1, float f2, float f3, float f public void setLivingAnimations(EntityLivingBase par1EntityLiving, float par2, float par3, float par4) { /* Constant Animation Rotations */ LEG1ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; - LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; + LEG3ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; LEG2ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; - LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f + (float) Math.PI) * 1.2F * par3; + LEG4ROT.rotateAngleX = MathHelper.cos(par2 * 0.6662F * 2f) * 1.2F * par3; TAILROT.rotateAngleX = (float) (-90 * Math.PI / 180); super.setLivingAnimations(par1EntityLiving, par2, par3, par4); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketKeyBind.java b/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketKeyBind.java new file mode 100644 index 0000000..25a8098 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketKeyBind.java @@ -0,0 +1,98 @@ +package com.stek101.projectzulu.common.mobs.packets; + +import io.netty.buffer.ByteBuf; + +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.PacketBuffer; + +import com.stek101.projectzulu.common.ProjectZulu_Core; +import com.stek101.projectzulu.common.core.ProjectZuluLog; +import com.stek101.projectzulu.common.mobs.entity.EntityCamel; + +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import cpw.mods.fml.relauncher.Side; + +public class PZPacketKeyBind implements IMessage, IMessageHandler { + private String keyBindCode; + private int keyBindValue; + + public PZPacketKeyBind setPacketData (String keyCode, int keyValue) { + this.keyBindCode = keyCode; + this.keyBindValue = keyValue; + return this; + } + + /** + * Called when this message is received. + */ + + @Override + public IMessage onMessage(PZPacketKeyBind message, MessageContext ctx) { + if(ctx.side != Side.SERVER) return null; + + if (message.keyBindCode.equalsIgnoreCase("jump")){ + EntityPlayerMP player = ctx.getServerHandler().playerEntity; + if (player.ridingEntity != null && player.ridingEntity instanceof EntityCamel) + { + ((EntityCamel)player.ridingEntity).setMountJump(); + } + } + if (message.keyBindCode.equalsIgnoreCase("inventory")){ + EntityPlayerMP player = ctx.getServerHandler().playerEntity; + if (player.ridingEntity != null && player.ridingEntity instanceof EntityCamel) + { + player.openGui(ProjectZulu_Core.modInstance, 5, player.worldObj, player.ridingEntity.getEntityId(), 0, 0); + } + } + + if (message.keyBindCode.equalsIgnoreCase("dismount")){ + EntityPlayerMP player = ctx.getServerHandler().playerEntity; + if (player.ridingEntity != null && player.ridingEntity instanceof EntityCamel) + { + ((EntityCamel)player.ridingEntity).riderDismount(); + } + } + return null; + } + + /** + * Reads the message from bytes. + */ + @Override + public void fromBytes(ByteBuf buf) { + PacketBuffer buffer = new PacketBuffer(buf); + + try { + int kBCLength = buffer.readInt(); + this.keyBindCode = buffer.readStringFromBuffer(kBCLength); + this.keyBindValue = buffer.readInt(); + + } catch (Exception e) { + ProjectZuluLog.severe("There was a problem decoding the packet in PZPacketKeyBind : " + buffer + ".", this); + e.printStackTrace(); + } + } + + /** + * Writes the message into bytes. + */ + @Override + public void toBytes(ByteBuf buf) { + PacketBuffer buffer = new PacketBuffer(buf); + try { + buffer.writeInt(this.keyBindCode.length()); + buffer.writeStringToBuffer(this.keyBindCode); + buffer.writeInt(this.keyBindValue); + + } catch (IOException e) { + ProjectZuluLog.severe("There was a problem encoding the packet in PZPacketKeyBind : " + buffer + ".", this); + e.printStackTrace(); + } + + } + +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketNameSync.java b/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketNameSync.java index 72cdc7c..0bd77e2 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketNameSync.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/packets/PZPacketNameSync.java @@ -52,7 +52,6 @@ public void fromBytes(ByteBuf buf) { PacketBuffer buffer = new PacketBuffer(buf); try { - entityIdToBeNamed = buffer.readInt(); int nameLength = buffer.readInt(); RentityName = buffer.readStringFromBuffer(nameLength); diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericHorse.java b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericHorse.java index d9a2c5b..f222736 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericHorse.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericHorse.java @@ -9,20 +9,27 @@ public class RenderGenericHorse extends RenderGenericLiving { public final ResourceLocation saddledTexture; + public final ResourceLocation wildTexture; public RenderGenericHorse(ModelBase modelBase, float shadowSize, ResourceLocation wildTexture, ResourceLocation saddledTexture) { super(modelBase, shadowSize, wildTexture); this.saddledTexture = saddledTexture; + this.wildTexture = wildTexture; } @Override protected ResourceLocation getEntityTexture(Entity entity) { if (entity instanceof EntityGenericAnimal) { + EntityGenericAnimal animal = (EntityGenericAnimal) entity; if (animal.getSaddled()) { return saddledTexture; } + else{ + return wildTexture; + } + } return livingTexture; } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericIdleMT.java b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericIdleMT.java new file mode 100644 index 0000000..748a004 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericIdleMT.java @@ -0,0 +1,28 @@ +package com.stek101.projectzulu.common.mobs.renders; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; + +import com.stek101.projectzulu.common.mobs.entity.EntityGenericAnimal; +import com.stek101.projectzulu.common.mobs.entity.EntityStates; + +public class RenderGenericIdleMT extends RenderGenericLiving { + + public final ResourceLocation idleTexture; + + public RenderGenericIdleMT(ModelBase par1ModelBase, float shadowSize, ResourceLocation livingTexture, + ResourceLocation idleTexture) { + super(par1ModelBase, shadowSize, livingTexture); + this.idleTexture = idleTexture; + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + if (((EntityGenericAnimal) entity).getEntityState() == EntityStates.idle) { + return idleTexture; + } else { + return livingTexture; + } + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericLiving.java b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericLiving.java index 4a433d9..5c219eb 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericLiving.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderGenericLiving.java @@ -11,8 +11,7 @@ public class RenderGenericLiving extends RenderLiving implements RenderWrapper { public final ResourceLocation livingTexture; public RenderGenericLiving(ModelBase modelBase, float shadowSize, ResourceLocation livingTexture) { - super(modelBase, shadowSize); - + super(modelBase, shadowSize); this.livingTexture = livingTexture; } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderMummyPharaoh.java b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderMummyPharaoh.java index 39a63f8..2cf69be 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderMummyPharaoh.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderMummyPharaoh.java @@ -82,7 +82,7 @@ protected void renderEquippedItems(EntityLivingBase par1EntityLiving, float par2 @Override public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, - float par9) { + float par9) { this.renderMummyPharaoh((EntityMummyPharaoh) par1EntityLiving, par2, par4, par6, par8, par9); } diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderSnow.java b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderSnow.java index f8415ae..33a4066 100644 --- a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderSnow.java +++ b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderSnow.java @@ -15,7 +15,7 @@ public RenderSnow(ModelBase modelBase, float shadowSize, ResourceLocation living this.snowTexture = snowTexture; } - @Override + @Override protected ResourceLocation getEntityTexture(Entity entity) { if (BiomeDictionary.isBiomeOfType(entity.worldObj.getBiomeGenForCoords((int) entity.posX, (int) entity.posZ), Type.FROZEN)) { diff --git a/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderThrowRock.java b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderThrowRock.java new file mode 100644 index 0000000..afdfaec --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/mobs/renders/RenderThrowRock.java @@ -0,0 +1,165 @@ +package com.stek101.projectzulu.common.mobs.renders; + + + + import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.stek101.projectzulu.common.api.ItemList; +import com.stek101.projectzulu.common.core.DefaultProps; +import com.stek101.projectzulu.common.core.ItemGenerics; +import com.stek101.projectzulu.common.mobs.entity.EntityThrowingRock; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + + @SideOnly(Side.CLIENT) + public class RenderThrowRock extends Render implements RenderWrapper + { + private static final ResourceLocation thrownRockTextures = new ResourceLocation(DefaultProps.blockKey, "textures/items/throwingrock.png"); + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render 0.0F) + // { + // float f12 = -MathHelper.sin(f11 * 3.0F) * f11; + // GL11.glRotatef(f12, 0.0F, 0.0F, 1.0F); + // } + + GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); + GL11.glScalef(f10, f10, f10); + GL11.glTranslatef(-4.0F, 0.0F, 0.0F); + GL11.glNormal3f(f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9); + tessellator.draw(); + GL11.glNormal3f(-f10, 0.0F, 0.0F); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8); + tessellator.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8); + tessellator.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9); + tessellator.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9); + tessellator.draw(); + + // for (int i = 0; i < 4; ++i) + // { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, f10); + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4); + tessellator.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4); + tessellator.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5); + tessellator.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5); + tessellator.draw(); + // } + */ + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + //} + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + protected ResourceLocation getEntityTexture(EntityThrowingRock p_110775_1_) + { + return thrownRockTextures; + } + + /** + * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. + */ + @Override + protected ResourceLocation getEntityTexture(Entity p_110775_1_) + { + ///return TextureMap.locationItemsTexture; + return this.getEntityTexture((EntityThrowingRock)p_110775_1_); + //return thrownRockTextures; + } + + /** + * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then + * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic + * (Render> 16 & 255) / 255.0F; + float f3 = (float)(i >> 8 & 255) / 255.0F; + float f4 = (float)(i & 255) / 255.0F; + GL11.glColor3f(f2, f3, f4); + GL11.glPushMatrix(); + this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay")); + GL11.glPopMatrix(); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + + this.func_77026_a(tessellator, icon); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + } + } + // For Forge 804: + /* + protected ResourceLocation func_110775_a(Entity par1Entity) + { + return TextureMap.field_110576_c; + } + */ + // For Forge 871: + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + return TextureMap.locationItemsTexture; + } + + private void func_77026_a(Tessellator par1Tessellator, IIcon par2Icon){ + float f = par2Icon.getMinU(); + float f1 = par2Icon.getMaxU(); + float f2 = par2Icon.getMinV(); + float f3 = par2Icon.getMaxV(); + float f4 = 1.0F; + float f5 = 0.5F; + float f6 = 0.25F; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + par1Tessellator.startDrawingQuads(); + par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); + par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3); + par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3); + par1Tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2); + par1Tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2); + par1Tessellator.draw(); + } + + public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { + this.doRenderTR((EntityThrowingRock) par1Entity, par2, par4, par6, par8, par9); + } + + @Override + public Render getRender() { + // TODO Auto-generated method stub + return this; + } + } \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/potion/EventHandleNullPotions.java b/src/main/java/com/stek101/projectzulu/common/potion/EventHandleNullPotions.java index f7e2dd0..10ff149 100644 --- a/src/main/java/com/stek101/projectzulu/common/potion/EventHandleNullPotions.java +++ b/src/main/java/com/stek101/projectzulu/common/potion/EventHandleNullPotions.java @@ -20,14 +20,21 @@ public void removeNullPotionEffects(LivingUpdateEvent event) { if (entityLiving.ticksExisted < 20) { Collection potionEffects = entityLiving.getActivePotionEffects(); Iterator iterator = potionEffects.iterator(); + try { while (iterator.hasNext()) { PotionEffect potionEffectToRemove = (PotionEffect) iterator.next(); + if (Potion.potionTypes[potionEffectToRemove.getPotionID()] == null) { ProjectZuluLog.info("Found Invalid Potion Effect. Removing Effect with ID %s.", potionEffectToRemove.getPotionID()); iterator.remove(); } + } } + catch(ArrayIndexOutOfBoundsException exception) { + ProjectZuluLog.info("Error encountered when removing Effect"); + } + } } } diff --git a/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/ChunkCoord.java b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/ChunkCoord.java new file mode 100644 index 0000000..616224d --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/ChunkCoord.java @@ -0,0 +1,83 @@ +package com.stek101.projectzulu.common.world.retroGenerator; + +import net.minecraft.world.chunk.Chunk; + +public class ChunkCoord { + public int chunkX; + public int chunkZ; + + public ChunkCoord(Chunk chunk) + { + this.chunkX = chunk.xPosition; + this.chunkZ = chunk.zPosition; + } + + public ChunkCoord(int x, int z) + { + this.chunkX = x; + this.chunkZ = z; + } + + public ChunkCoord() + { + this(0, 0); + } + + public ChunkCoord(ChunkCoord cCoord) + { + this.chunkX = cCoord.chunkX; + this.chunkZ = cCoord.chunkZ; + } + + public int getCenterX() + { + return (this.chunkX << 4) + 8; + } + + public int getCenterZ() + { + return (this.chunkZ << 4) + 8; + } + + public boolean isEqual(ChunkCoord cCoord) + { + return (this.chunkX == cCoord.chunkX) && (this.chunkZ == cCoord.chunkZ); + } + + public static ChunkCoord getChunkCoordFromBlockCoords(int x, int z) + { + int chunkX = (int) Math.floor(x / 16); + int chunkZ = (int) Math.floor(z / 16); + + return new ChunkCoord(chunkX, chunkZ); + } + + public static ChunkCoord getChunkCoordFromBlockCoord(Location bCoord) + { + return getChunkCoordFromBlockCoords(bCoord.x, bCoord.z); + } + + @Override + public Object clone() + { + return new ChunkCoord(this); + } + + @Override + public String toString() + { + return "ChunkCoord: [chunkX: " + this.chunkX + ", chunkZ: " + this.chunkZ + "]"; + } + + @Override + public int hashCode() + { + return ("chunkX:" + this.chunkX + "chunkZ:" + this.chunkZ).hashCode(); + } + + @Override + public boolean equals(Object obj) + { + return (obj instanceof ChunkCoord) && isEqual((ChunkCoord) obj); + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/IRetroGenerator.java b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/IRetroGenerator.java new file mode 100644 index 0000000..71c3693 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/IRetroGenerator.java @@ -0,0 +1,15 @@ +package com.stek101.projectzulu.common.world.retroGenerator; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; + +public interface IRetroGenerator +{ + public String getUniqueGenerationID(); + + public boolean canGenerateIn(World world, Chunk chunk, Random random); + + public void generate(Random rand, World world, int chunkX, int chunkZ); +} diff --git a/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/Location.java b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/Location.java new file mode 100644 index 0000000..368aa3e --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/Location.java @@ -0,0 +1,114 @@ +package com.stek101.projectzulu.common.world.retroGenerator; + +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.ChunkPosition; +import net.minecraftforge.common.util.ForgeDirection; + +public class Location { + public int x; + public int y; + public int z; + + public Location(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + public Location(int xCoord, int yCoord, int zCoord, ForgeDirection dir) { + this.x = xCoord + dir.offsetX; + this.y = yCoord + dir.offsetY; + this.z = zCoord + dir.offsetZ; + } + + public Location(int[] coords) { + if (coords.length >= 2) { + this.x = coords[0]; + this.y = coords[1]; + this.z = coords[2]; + } + } + + public Location(ChunkPosition pos) { + if (pos != null) { + this.x = pos.chunkPosX; + this.y = pos.chunkPosY; + this.z = pos.chunkPosZ; + } + } + + public Location(MovingObjectPosition blockLookedAt) { + if (blockLookedAt != null) { + this.x = blockLookedAt.blockX; + this.y = blockLookedAt.blockY; + this.z = blockLookedAt.blockZ; + } + } + + public boolean equals(Location toTest) { + if (this.x == toTest.x && this.y == toTest.y && this.z == toTest.z) { + return true; + } + return false; + } + + public void setLocation(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + public int getX() { + return this.x; + } + + public void setX(int newX) { + this.x = newX; + } + + public int getY() { + return this.y; + } + + public void setY(int newY) { + this.y = newY; + } + + public int getZ() { + return this.z; + } + + public void setZ(int newZ) { + this.z = newZ; + } + + public int[] getLocation() { + int[] ret = new int[3]; + ret[0] = this.x; + ret[1] = this.y; + ret[2] = this.z; + return ret; + } + + public void setLocation(int[] coords) { + this.x = coords[0]; + this.y = coords[1]; + this.z = coords[2]; + } + + public int getDifference(Location otherLoc) { + return (int) Math.sqrt(Math.pow(this.x - otherLoc.x, 2) + Math.pow(this.y - otherLoc.y, 2) + Math.pow(this.z - otherLoc.z, 2)); + } + + public String printLocation() { + return "X: " + this.x + " Y: " + this.y + " Z: " + this.z; + } + + public String printCoords() { + return this.x + ", " + this.y + ", " + this.z; + } + + public boolean compare(int x, int y, int z) { + return (this.x == x && this.y == y && this.z == z); + } +} diff --git a/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/RetroGenSaveData.java b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/RetroGenSaveData.java new file mode 100644 index 0000000..dca0e3e --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/RetroGenSaveData.java @@ -0,0 +1,62 @@ +package com.stek101.projectzulu.common.world.retroGenerator; + +import java.util.Map; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSavedData; + +import com.google.common.collect.Maps; + +public class RetroGenSaveData extends WorldSavedData { + private Map chunks = Maps.newHashMap(); + + private final String NBT_SIZE = "size"; + private final String NBT_LOC_X = "CoordLocX"; + private final String NBT_LOC_Z = "CoordLocZ"; + private final String NBT_TAG = "tag"; + + public RetroGenSaveData(String name) { + super(name); + } + + public boolean isGenerationNeeded(ChunkCoord coord, String genID) { + NBTTagCompound nbt = chunks.get(coord); + + return nbt == null || !nbt.hasKey(genID) || !nbt.getBoolean(genID); + } + + public void markChunkRetroGenerated(ChunkCoord coord, String genID) { + NBTTagCompound nbt = chunks.get(coord); + + if (nbt == null) + nbt = new NBTTagCompound(); + + nbt.setBoolean(genID, true); + chunks.put(coord, nbt); + + markDirty(); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + int size = nbt.getInteger(NBT_SIZE); + + for (int i = 0; i < size; ++i) { + ChunkCoord coord = new ChunkCoord(nbt.getInteger(i + NBT_LOC_X), nbt.getInteger(i + NBT_LOC_Z)); + chunks.put(coord, nbt.getCompoundTag(i + NBT_TAG)); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + nbt.setInteger(NBT_SIZE, chunks.size()); + int index = 0; + + for (ChunkCoord coord : chunks.keySet()) { + nbt.setInteger(index + NBT_LOC_X, coord.chunkX); + nbt.setInteger(index + NBT_LOC_Z, coord.chunkZ); + nbt.setTag(index + NBT_TAG, chunks.get(coord)); + index++; + } + } +} \ No newline at end of file diff --git a/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/RetroactiveWorldGenerator.java b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/RetroactiveWorldGenerator.java new file mode 100644 index 0000000..34a4b20 --- /dev/null +++ b/src/main/java/com/stek101/projectzulu/common/world/retroGenerator/RetroactiveWorldGenerator.java @@ -0,0 +1,95 @@ +package com.stek101.projectzulu.common.world.retroGenerator; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.event.world.ChunkEvent; + +import com.google.common.collect.Lists; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; + + +public class RetroactiveWorldGenerator { + private static ArrayList generators = Lists.newArrayList(); + private static ArrayList genQueue = Lists.newArrayList(); + + public static final String retroGenSaveDataName = "mc_retroDATA"; + + public static void registerRetroGenerator(IRetroGenerator generator) + { + generators.add(generator); + } + + private RetroGenSaveData getRetroGenSaveData(World world) + { + RetroGenSaveData data = (RetroGenSaveData) world.perWorldStorage.loadData(RetroGenSaveData.class, retroGenSaveDataName); + + if (data == null) + { + data = new RetroGenSaveData(retroGenSaveDataName); + world.perWorldStorage.setData(retroGenSaveDataName, data); + } + + return data; + } + + @SubscribeEvent + public void onChunkLoad(ChunkEvent.Load event) + { + RetroGenSaveData data = getRetroGenSaveData(event.world); + ChunkCoord coord = new ChunkCoord(event.getChunk()); + World world = event.world; + Chunk chunk = event.getChunk(); + + for (IRetroGenerator gen : generators) + if (gen.canGenerateIn(world, chunk, new Random()) && data.isGenerationNeeded(coord, gen.getUniqueGenerationID())) + { + genQueue.add(new RetroGenEntry(world, coord, gen)); + data.markChunkRetroGenerated(coord, gen.getUniqueGenerationID()); + } + } + + @SubscribeEvent + public void onWorldTick(TickEvent.WorldTickEvent event) + { + if (genQueue.isEmpty()) + return; + + if (event.phase == TickEvent.Phase.START) + return; + + int count = 0; + ArrayList removeQueue = Lists.newArrayList(); + ArrayList iterationQueue = (ArrayList) genQueue.clone(); + + for (RetroGenEntry entry : iterationQueue) + { + entry.gen.generate(entry.world.rand, entry.world, entry.coord.chunkX, entry.coord.chunkZ); + removeQueue.add(entry); + count++; + + if (count >= 32) + break; + } + + genQueue.removeAll(removeQueue); + } + + public class RetroGenEntry + { + World world; + ChunkCoord coord; + IRetroGenerator gen; + + public RetroGenEntry(World world, ChunkCoord coord, IRetroGenerator gen) + { + this.world = world; + this.coord = coord; + this.gen = gen; + } + } +} diff --git a/src/main/resources/assets/projectzulublock/lang/en_US.lang b/src/main/resources/assets/projectzulublock/lang/en_US.lang index d20b4a1..731c734 100644 --- a/src/main/resources/assets/projectzulublock/lang/en_US.lang +++ b/src/main/resources/assets/projectzulublock/lang/en_US.lang @@ -92,6 +92,7 @@ item.smallunhealthyheart.name=Small Unhealthy Heart item.largeunhealthyheart.name=Large Unhealthy Heart item.duckegg.name=Duck Egg item.ostrichegg.name=Ostrich Egg +item.throwingrock.name=Throwing Rock item.scalehelmet.name=Scale Helmet item.scalechest.name=Scale Chest diff --git a/src/main/resources/assets/projectzulublock/textures/blocks/spikes.png b/src/main/resources/assets/projectzulublock/textures/blocks/spikes.png deleted file mode 100644 index b67b2e5..0000000 Binary files a/src/main/resources/assets/projectzulublock/textures/blocks/spikes.png and /dev/null differ diff --git a/src/main/resources/assets/projectzulublock/textures/blocks/spikes_poison.png b/src/main/resources/assets/projectzulublock/textures/blocks/spikes_poison.png deleted file mode 100644 index bb63de2..0000000 Binary files a/src/main/resources/assets/projectzulublock/textures/blocks/spikes_poison.png and /dev/null differ diff --git a/src/main/resources/assets/projectzulublock/textures/blocks/spikes_sticky.png b/src/main/resources/assets/projectzulublock/textures/blocks/spikes_sticky.png deleted file mode 100644 index efe1e91..0000000 Binary files a/src/main/resources/assets/projectzulublock/textures/blocks/spikes_sticky.png and /dev/null differ diff --git a/src/main/resources/assets/projectzulublock/textures/items/flintandstone.png b/src/main/resources/assets/projectzulublock/textures/items/flintandstone.png new file mode 100644 index 0000000..77bc340 Binary files /dev/null and b/src/main/resources/assets/projectzulublock/textures/items/flintandstone.png differ diff --git a/src/main/resources/assets/projectzulublock/textures/items/throwingrock.png b/src/main/resources/assets/projectzulublock/textures/items/throwingrock.png new file mode 100644 index 0000000..ebe5185 Binary files /dev/null and b/src/main/resources/assets/projectzulublock/textures/items/throwingrock.png differ diff --git a/src/main/resources/assets/projectzulucore/lang/en_US.lang b/src/main/resources/assets/projectzulucore/lang/en_US.lang new file mode 100644 index 0000000..ea3f72d --- /dev/null +++ b/src/main/resources/assets/projectzulucore/lang/en_US.lang @@ -0,0 +1,3 @@ +key.categories.pz=PZ Controls +key.ping=Ping +key.pong=Pong \ No newline at end of file diff --git a/src/main/resources/assets/projectzulumob/lang/en_US.lang b/src/main/resources/assets/projectzulumob/lang/en_US.lang index a1a97be..8913c0e 100644 --- a/src/main/resources/assets/projectzulumob/lang/en_US.lang +++ b/src/main/resources/assets/projectzulumob/lang/en_US.lang @@ -48,6 +48,7 @@ entity.ProjectZulu|Core.Goat.name=Goat entity.ProjectZulu|Core.Duck.name=Duck entity.ProjectZulu|Core.DuckEgg.name=Duck Egg entity.ProjectZulu|Core.OstrichEgg.name=Ostrich Egg +entity.ProjectZulu|Core.ThrowingRock.name=Throwing Rock entity.ProjectZulu|Core.Deer.name=Deer entity.ProjectZulu|Core.Skeletonn.name=Draugr entity.ProjectZulu|Core.Cyclops.name=Cyclops @@ -55,4 +56,11 @@ entity.ProjectZulu|Core.FishA.name=Fish entity.ProjectZulu|Core.RipperFin.name=Ripper Fin entity.ProjectZulu|Core.GiantRat.name=Giant Rat entity.ProjectZulu|Core.FishB.name=Fish -entity.ProjectZulu|Core.Crow.name=Crow \ No newline at end of file +entity.ProjectZulu|Core.Crow.name=Crow +entity.ProjectZulu|Core.Camel.name=Camel +entity.ProjectZulu|Core.Monkey.name=Monkey +entity.ProjectZulu|Core.RavagerAnt.name=Ravager Ant +entity.ProjectZulu|Core.BeetleAS.name=Small Beetle +entity.ProjectZulu|Core.BeetleBS.name=Small Beetle +entity.ProjectZulu|Core.BloomDoom.name=Bloom Doom +entity.ProjectZulu|Core.PZBat.name=Rabid Bat \ No newline at end of file diff --git a/src/main/resources/assets/projectzulumob/lang/ru_RU.lang b/src/main/resources/assets/projectzulumob/lang/ru_RU.lang index f1bfa91..38fce68 100644 --- a/src/main/resources/assets/projectzulumob/lang/ru_RU.lang +++ b/src/main/resources/assets/projectzulumob/lang/ru_RU.lang @@ -55,4 +55,11 @@ entity.ProjectZulu|Core.FishA.name=Рыба entity.ProjectZulu|Core.RipperFin.name=Ripper Fin entity.ProjectZulu|Core.GiantRat.name=Гигантская крыса entity.ProjectZulu|Core.FishB.name=Рыба -entity.ProjectZulu|Core.Crow.name=Ворона \ No newline at end of file +entity.ProjectZulu|Core.Crow.name=Ворона +entity.ProjectZulu|Core.Camel.name=верблюд +entity.ProjectZulu|Core.Monkey.name=обезьяна +entity.ProjectZulu|Core.RavagerAnt.name=убийца муравей +entity.ProjectZulu|Core.BeetleAS.name=небольшой жук +entity.ProjectZulu|Core.BeetleBS.name=небольшой жук +entity.ProjectZulu|Core.BloomDoom.name=умер цветок +entity.ProjectZulu|Core.PZBat.name=бешеный летучая мышь \ No newline at end of file diff --git a/src/main/resources/assets/projectzulumob/sounds.json b/src/main/resources/assets/projectzulumob/sounds.json index 5457e2c..3d39792 100644 --- a/src/main/resources/assets/projectzulumob/sounds.json +++ b/src/main/resources/assets/projectzulumob/sounds.json @@ -15,6 +15,20 @@ "mob.boarliving": { "category": "neutral", "sounds": ["mob/boarliving1", "mob/nosound", "mob/boarliving2"]}, "mob.deerlivingsound": { "category": "neutral", "sounds": ["mob/deerlivingsound1", "mob/nosound", "mob/deerlivingsound2"]}, "mob.deerhurtsound": { "category": "neutral", "sounds": ["mob/deerhurtsound1"]}, + "mob.dbloomlivingsound": { "category": "hostile", "sounds": ["mob/doombloomlivingsound1", "mob/doombloomlivingsound2"]}, + "mob.dbloomhurtsound": { "category": "hostile", "sounds": ["mob/doombloomhurtsound1"]}, + "mob.pzbatlivingsound": { "category": "hostile", "sounds": ["mob/pzbatlivingsound1", "mob/nosound", "mob/pzbatlivingsound2"]}, + "mob.pzbathurtsound": { "category": "hostile", "sounds": ["mob/pzbathurtsound1"]}, + "mob.centlivingsound": { "category": "neutral", "sounds": ["mob/centipedelivingsound1", "mob/nosound", "mob/centipedelivingsound2"]}, + "mob.centhurtsound": { "category": "neutral", "sounds": ["mob/centipedehurtsound1"]}, + "mob.ravantlivingsound": { "category": "neutral", "sounds": ["mob/ravantlivingsound1", "mob/nosound", "mob/ravantlivingsound2"]}, + "mob.ravanthurtsound": { "category": "neutral", "sounds": ["mob/ravanthurtsound1"]}, + "mob.beetlelivingsound": { "category": "neutral", "sounds": ["mob/beetlelivingsound1", "mob/nosound", "mob/beetlelivingsound2"]}, + "mob.beetlehurtsound": { "category": "neutral", "sounds": ["mob/beetlehurtsound1"]}, + "mob.camellivingsound": { "category": "neutral", "sounds": ["mob/camellivingsound1", "mob/nosound", "mob/camellivingsound2"]}, + "mob.camelhurtsound": { "category": "neutral", "sounds": ["mob/camelhurtsound1"]}, + "mob.monkeylivingsound": { "category": "neutral", "sounds": ["mob/monkeylivingsound1", "mob/monkeylivingsound2"]}, + "mob.monkeyhurtsound": { "category": "neutral", "sounds": ["mob/monkeyhurtsound1"]}, "mob.boarhurt": { "category": "neutral", "sounds": ["mob/boarhurt"]}, "mob.mimicliving": { "category": "neutral", "sounds": ["mob/mimicliving"]}, "mob.minotaurlivingsound": { "category": "hostile", "sounds": ["mob/minotaurlivingsound1", "mob/minotaurlivingsound2", "mob/minotaurlivingsound3"]}, diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/beetlehurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/beetlehurtsound1.ogg new file mode 100644 index 0000000..8b88a9c Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/beetlehurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/beetlelivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/beetlelivingsound1.ogg new file mode 100644 index 0000000..2980817 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/beetlelivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/beetlelivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/beetlelivingsound2.ogg new file mode 100644 index 0000000..a45f6a8 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/beetlelivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/camelhurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/camelhurtsound1.ogg new file mode 100644 index 0000000..9d27434 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/camelhurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/camellivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/camellivingsound1.ogg new file mode 100644 index 0000000..a72b1ef Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/camellivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/camellivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/camellivingsound2.ogg new file mode 100644 index 0000000..a4279c1 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/camellivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/centipedehurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/centipedehurtsound1.ogg new file mode 100644 index 0000000..5a917fe Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/centipedehurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/centipedelivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/centipedelivingsound1.ogg new file mode 100644 index 0000000..e4e1101 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/centipedelivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/centipedelivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/centipedelivingsound2.ogg new file mode 100644 index 0000000..2d09882 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/centipedelivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/doombloomhurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/doombloomhurtsound1.ogg new file mode 100644 index 0000000..bf9324b Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/doombloomhurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/doombloomlivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/doombloomlivingsound1.ogg new file mode 100644 index 0000000..b119314 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/doombloomlivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/doombloomlivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/doombloomlivingsound2.ogg new file mode 100644 index 0000000..e72d31b Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/doombloomlivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/monkeyhurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/monkeyhurtsound1.ogg new file mode 100644 index 0000000..1a23d40 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/monkeyhurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/monkeylivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/monkeylivingsound1.ogg new file mode 100644 index 0000000..774ccaa Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/monkeylivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/monkeylivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/monkeylivingsound2.ogg new file mode 100644 index 0000000..0b80a2a Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/monkeylivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/pzbathurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/pzbathurtsound1.ogg new file mode 100644 index 0000000..c4ee6e0 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/pzbathurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/pzbatlivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/pzbatlivingsound1.ogg new file mode 100644 index 0000000..0f73476 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/pzbatlivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/pzbatlivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/pzbatlivingsound2.ogg new file mode 100644 index 0000000..9b5692b Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/pzbatlivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/ravanthurtsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/ravanthurtsound1.ogg new file mode 100644 index 0000000..7b3cd8c Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/ravanthurtsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/ravantlivingsound1.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/ravantlivingsound1.ogg new file mode 100644 index 0000000..e1d506d Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/ravantlivingsound1.ogg differ diff --git a/src/main/resources/assets/projectzulumob/sounds/mob/ravantlivingsound2.ogg b/src/main/resources/assets/projectzulumob/sounds/mob/ravantlivingsound2.ogg new file mode 100644 index 0000000..40b4f10 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/sounds/mob/ravantlivingsound2.ogg differ diff --git a/src/main/resources/assets/projectzulumob/textures/antravager.png b/src/main/resources/assets/projectzulumob/textures/antravager.png new file mode 100644 index 0000000..fd5b0c2 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/antravager.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/beetleas1.png b/src/main/resources/assets/projectzulumob/textures/beetleas1.png new file mode 100644 index 0000000..8c04a68 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/beetleas1.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/beetleas2.png b/src/main/resources/assets/projectzulumob/textures/beetleas2.png new file mode 100644 index 0000000..c46670a Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/beetleas2.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/beetleas3.png b/src/main/resources/assets/projectzulumob/textures/beetleas3.png new file mode 100644 index 0000000..38928e7 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/beetleas3.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/beetlebs1.png b/src/main/resources/assets/projectzulumob/textures/beetlebs1.png new file mode 100644 index 0000000..4f3acc6 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/beetlebs1.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/beetlebs2.png b/src/main/resources/assets/projectzulumob/textures/beetlebs2.png new file mode 100644 index 0000000..e053000 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/beetlebs2.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/beetlebs3.png b/src/main/resources/assets/projectzulumob/textures/beetlebs3.png new file mode 100644 index 0000000..ca1d7c2 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/beetlebs3.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/bloomdoom0.png b/src/main/resources/assets/projectzulumob/textures/bloomdoom0.png new file mode 100644 index 0000000..18ad49f Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/bloomdoom0.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/bloomdoomidle0.png b/src/main/resources/assets/projectzulumob/textures/bloomdoomidle0.png new file mode 100644 index 0000000..f4490ea Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/bloomdoomidle0.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/camel.png b/src/main/resources/assets/projectzulumob/textures/camel.png new file mode 100644 index 0000000..e759ffa Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/camel.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/camel_saddled.png b/src/main/resources/assets/projectzulumob/textures/camel_saddled.png new file mode 100644 index 0000000..8ef8236 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/camel_saddled.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/fisha.png b/src/main/resources/assets/projectzulumob/textures/fisha.png deleted file mode 100644 index a0c48d5..0000000 Binary files a/src/main/resources/assets/projectzulumob/textures/fisha.png and /dev/null differ diff --git a/src/main/resources/assets/projectzulumob/textures/giantrat0.png b/src/main/resources/assets/projectzulumob/textures/giantrat0.png index 7740e28..4d4b604 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/giantrat0.png and b/src/main/resources/assets/projectzulumob/textures/giantrat0.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/goat0.png b/src/main/resources/assets/projectzulumob/textures/goat0.png index 345e647..56e3537 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/goat0.png and b/src/main/resources/assets/projectzulumob/textures/goat0.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/goat1.png b/src/main/resources/assets/projectzulumob/textures/goat1.png index 101d6fb..ee52e6a 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/goat1.png and b/src/main/resources/assets/projectzulumob/textures/goat1.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/goat2.png b/src/main/resources/assets/projectzulumob/textures/goat2.png index 1d9c144..82c2632 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/goat2.png and b/src/main/resources/assets/projectzulumob/textures/goat2.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/goat3.png b/src/main/resources/assets/projectzulumob/textures/goat3.png deleted file mode 100644 index ce126ea..0000000 Binary files a/src/main/resources/assets/projectzulumob/textures/goat3.png and /dev/null differ diff --git a/src/main/resources/assets/projectzulumob/textures/monkey.png b/src/main/resources/assets/projectzulumob/textures/monkey.png new file mode 100644 index 0000000..8a4b12c Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/monkey.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/pzbat.png b/src/main/resources/assets/projectzulumob/textures/pzbat.png new file mode 100644 index 0000000..fd7466e Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/pzbat.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit.png b/src/main/resources/assets/projectzulumob/textures/rabbit.png deleted file mode 100644 index 2c28016..0000000 Binary files a/src/main/resources/assets/projectzulumob/textures/rabbit.png and /dev/null differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit0.png b/src/main/resources/assets/projectzulumob/textures/rabbit0.png index 2c28016..301abe3 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/rabbit0.png and b/src/main/resources/assets/projectzulumob/textures/rabbit0.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit1.png b/src/main/resources/assets/projectzulumob/textures/rabbit1.png index 81c7d72..819c0df 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/rabbit1.png and b/src/main/resources/assets/projectzulumob/textures/rabbit1.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit2.png b/src/main/resources/assets/projectzulumob/textures/rabbit2.png index 0154872..bc9541b 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/rabbit2.png and b/src/main/resources/assets/projectzulumob/textures/rabbit2.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit3.png b/src/main/resources/assets/projectzulumob/textures/rabbit3.png new file mode 100644 index 0000000..c27c24a Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/rabbit3.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit4.png b/src/main/resources/assets/projectzulumob/textures/rabbit4.png new file mode 100644 index 0000000..a4c51e8 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/rabbit4.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit5.png b/src/main/resources/assets/projectzulumob/textures/rabbit5.png new file mode 100644 index 0000000..02ff1eb Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/rabbit5.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit6.png b/src/main/resources/assets/projectzulumob/textures/rabbit6.png new file mode 100644 index 0000000..119c748 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/rabbit6.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit7.png b/src/main/resources/assets/projectzulumob/textures/rabbit7.png new file mode 100644 index 0000000..3cc98a8 Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/rabbit7.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/rabbit8.png b/src/main/resources/assets/projectzulumob/textures/rabbit8.png new file mode 100644 index 0000000..cae5a7a Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/rabbit8.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/ripperfin1.png b/src/main/resources/assets/projectzulumob/textures/ripperfin1.png index 9f10d9e..b7a064d 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/ripperfin1.png and b/src/main/resources/assets/projectzulumob/textures/ripperfin1.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/serpent.png b/src/main/resources/assets/projectzulumob/textures/serpent.png index ffcd468..1255415 100644 Binary files a/src/main/resources/assets/projectzulumob/textures/serpent.png and b/src/main/resources/assets/projectzulumob/textures/serpent.png differ diff --git a/src/main/resources/assets/projectzulumob/textures/throwingrock.png b/src/main/resources/assets/projectzulumob/textures/throwingrock.png new file mode 100644 index 0000000..8d8445b Binary files /dev/null and b/src/main/resources/assets/projectzulumob/textures/throwingrock.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 59624fc..d1f6a04 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ { "modid" : "ProjectZulu|Core", "name" : "Project Zulu", - "version" : "1.3f", + "version" : "1.4b4", "url" : "", "credits" : "Soultek101, CrudeDragos", "authors": [